LibJS: Allow JS::Value to store a non-object Cell

This will allow us to refer to non-object Cells more readily in bytecode
and opens up for some nice optimizations.
This commit is contained in:
Andreas Kling 2025-03-22 11:45:40 -05:00 committed by Andreas Kling
parent f0abf5a43b
commit 1d88c4529c

View File

@ -214,6 +214,11 @@ public:
{
}
Value(Cell const* cell)
: Value(GC::IS_CELL_BIT << GC::TAG_SHIFT, reinterpret_cast<void const*>(cell))
{
}
Value(Object const* object)
: Value(OBJECT_TAG << GC::TAG_SHIFT, reinterpret_cast<void const*>(object))
{