mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +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:
parent
b345a0acca
commit
275dea9d98
10 changed files with 15 additions and 37 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue