From 1d88c4529c5e90c2d3516cf1d80194798f6c89ab Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 22 Mar 2025 11:45:40 -0500 Subject: [PATCH] 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. --- Libraries/LibJS/Runtime/Value.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/LibJS/Runtime/Value.h b/Libraries/LibJS/Runtime/Value.h index a35410fef5a..c60c88fc9ce 100644 --- a/Libraries/LibJS/Runtime/Value.h +++ b/Libraries/LibJS/Runtime/Value.h @@ -214,6 +214,11 @@ public: { } + Value(Cell const* cell) + : Value(GC::IS_CELL_BIT << GC::TAG_SHIFT, reinterpret_cast(cell)) + { + } + Value(Object const* object) : Value(OBJECT_TAG << GC::TAG_SHIFT, reinterpret_cast(object)) {