summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Interpreter.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-18 13:18:06 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-18 13:24:45 +0200
commitfca08bd000e613459baf62fa8d37552ef11f3fe6 (patch)
treef20e36879896fb150a6031b4383b53296de6ca45 /Libraries/LibJS/Interpreter.h
parentcbcf317e760c3370d10cfc525f0f528abd44e820 (diff)
downloadserenity-fca08bd000e613459baf62fa8d37552ef11f3fe6.zip
LibJS: Move builtin prototypes to the global object
This moves us towards being able to run JavaScript in different global objects without allocating a separate GC heap.
Diffstat (limited to 'Libraries/LibJS/Interpreter.h')
-rw-r--r--Libraries/LibJS/Interpreter.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/Libraries/LibJS/Interpreter.h b/Libraries/LibJS/Interpreter.h
index fb50d719d0..de9cbb3717 100644
--- a/Libraries/LibJS/Interpreter.h
+++ b/Libraries/LibJS/Interpreter.h
@@ -74,6 +74,7 @@ public:
{
auto interpreter = adopt_own(*new Interpreter);
interpreter->m_global_object = interpreter->heap().allocate<GlobalObjectType>(forward<Args>(args)...);
+ static_cast<GlobalObjectType*>(interpreter->m_global_object)->initialize();
return interpreter;
}
@@ -140,11 +141,6 @@ public:
Shape* empty_object_shape() { return m_empty_object_shape; }
-#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
- Object* snake_name##_prototype() { return m_##snake_name##_prototype; }
- JS_ENUMERATE_BUILTIN_TYPES
-#undef __JS_ENUMERATE
-
Exception* exception()
{
return m_exception;
@@ -176,12 +172,6 @@ private:
Vector<CallFrame> m_call_stack;
Shape* m_empty_object_shape { nullptr };
-
-#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
- Object* m_##snake_name##_prototype { nullptr };
- JS_ENUMERATE_BUILTIN_TYPES
-#undef __JS_ENUMERATE
-
Object* m_global_object { nullptr };
Exception* m_exception { nullptr };