mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 17:28:11 +00:00
LibJS/Bytecode: Cache realm, global object, and more in interpreter
Instead of looking these up in the VM execution context stack whenever we need them, we now just cache them in the interpreter when entering a new call frame.
This commit is contained in:
parent
01e9eee7dd
commit
953573565c
3 changed files with 11 additions and 10 deletions
|
@ -51,7 +51,9 @@ public:
|
|||
explicit Interpreter(VM&);
|
||||
~Interpreter();
|
||||
|
||||
Realm& realm();
|
||||
[[nodiscard]] Realm& realm() { return *m_realm; }
|
||||
[[nodiscard]] Object& global_object() { return *m_global_object; }
|
||||
[[nodiscard]] DeclarativeEnvironment& global_declarative_environment() { return *m_global_declarative_environment; }
|
||||
VM& vm() { return m_vm; }
|
||||
VM const& vm() const { return m_vm; }
|
||||
|
||||
|
@ -125,6 +127,9 @@ private:
|
|||
BasicBlock const* m_scheduled_jump { nullptr };
|
||||
Executable* m_current_executable { nullptr };
|
||||
BasicBlock const* m_current_block { nullptr };
|
||||
Realm* m_realm { nullptr };
|
||||
Object* m_global_object { nullptr };
|
||||
DeclarativeEnvironment* m_global_declarative_environment { nullptr };
|
||||
Optional<InstructionStreamIterator&> m_pc {};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue