mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibJS: Remove {Bytecode::,}Interpreter::global_object()
The basic idea is that a global object cannot just come out of nowhere, it must be associated to a realm - so get it from there, if needed. This is to enforce the changes from all the previous commits by not handing out global objects unless you actually have an initialized realm (either stored somewhere, or the VM's current realm).
This commit is contained in:
@@ -26,13 +26,12 @@ struct RegisterWindow {
|
||||
|
||||
class Interpreter {
|
||||
public:
|
||||
Interpreter(GlobalObject&, Realm&);
|
||||
explicit Interpreter(Realm&);
|
||||
~Interpreter();
|
||||
|
||||
// FIXME: Remove this thing once we don't need it anymore!
|
||||
static Interpreter* current();
|
||||
|
||||
GlobalObject& global_object() { return m_global_object; }
|
||||
Realm& realm() { return m_realm; }
|
||||
VM& vm() { return m_vm; }
|
||||
|
||||
@@ -90,7 +89,6 @@ private:
|
||||
static AK::Array<OwnPtr<PassManager>, static_cast<UnderlyingType<Interpreter::OptimizationLevel>>(Interpreter::OptimizationLevel::__Count)> s_optimization_pipelines;
|
||||
|
||||
VM& m_vm;
|
||||
GlobalObject& m_global_object;
|
||||
Realm& m_realm;
|
||||
Vector<Variant<NonnullOwnPtr<RegisterWindow>, RegisterWindow*>> m_register_windows;
|
||||
Optional<BasicBlock const*> m_pending_jump;
|
||||
|
||||
Reference in New Issue
Block a user