|
@@ -43,15 +43,13 @@ public:
|
|
|
auto interpreter = adopt_own(*new Interpreter(vm));
|
|
|
VM::InterpreterExecutionScope scope(*interpreter);
|
|
|
|
|
|
- GlobalObject* global_object { nullptr };
|
|
|
Realm* realm { nullptr };
|
|
|
|
|
|
interpreter->m_global_execution_context = MUST(Realm::initialize_host_defined_realm(
|
|
|
vm,
|
|
|
[&](Realm& realm_) -> GlobalObject* {
|
|
|
- global_object = interpreter->heap().allocate_without_realm<GlobalObjectType>(realm_, forward<Args>(args)...);
|
|
|
realm = &realm_;
|
|
|
- return global_object;
|
|
|
+ return interpreter->heap().allocate_without_realm<GlobalObjectType>(realm_, forward<Args>(args)...);
|
|
|
},
|
|
|
nullptr));
|
|
|
|
|
@@ -59,7 +57,6 @@ public:
|
|
|
static FlyString global_execution_context_name = "(global execution context)";
|
|
|
interpreter->m_global_execution_context->function_name = global_execution_context_name;
|
|
|
|
|
|
- interpreter->m_global_object = make_handle(global_object);
|
|
|
interpreter->m_realm = make_handle(realm);
|
|
|
|
|
|
return interpreter;
|
|
@@ -72,9 +69,6 @@ public:
|
|
|
ThrowCompletionOr<Value> run(Script&);
|
|
|
ThrowCompletionOr<Value> run(SourceTextModule&);
|
|
|
|
|
|
- GlobalObject& global_object();
|
|
|
- GlobalObject const& global_object() const;
|
|
|
-
|
|
|
Realm& realm();
|
|
|
Realm const& realm() const;
|
|
|
|
|
@@ -104,8 +98,6 @@ private:
|
|
|
ExecutingASTNodeChain* m_ast_node_chain { nullptr };
|
|
|
|
|
|
NonnullRefPtr<VM> m_vm;
|
|
|
-
|
|
|
- Handle<GlobalObject> m_global_object;
|
|
|
Handle<Realm> m_realm;
|
|
|
|
|
|
// This is here to keep the global execution context alive for the entire lifespan of the Interpreter.
|