LibJS: Remove derivable fields from ExecutionContext

Remove four fields that are trivially derivable from other fields
already present in the ExecutionContext:

- global_object (from realm)
- global_declarative_environment (from realm)
- identifier_table (from executable)
- property_key_table (from executable)

This shrinks ExecutionContext from 192 to 160 bytes (-17%).

The asmint's GetGlobal/SetGlobal handlers now load through the realm
pointer, taking advantage of the cached declarative environment
pointer added in the previous commit.
This commit is contained in:
Andreas Kling
2026-03-08 11:34:32 +01:00
committed by Andreas Kling
parent e70f580e5c
commit 96d02d5249
Notes: github-actions[bot] 2026-03-11 12:35:42 +00:00
6 changed files with 24 additions and 28 deletions

View File

@@ -27,8 +27,8 @@ public:
~Interpreter();
[[nodiscard]] Realm& realm() { return *m_running_execution_context->realm; }
[[nodiscard]] Object& global_object() { return *m_running_execution_context->global_object; }
[[nodiscard]] DeclarativeEnvironment& global_declarative_environment() { return *m_running_execution_context->global_declarative_environment; }
[[nodiscard]] Object& global_object() { return realm().global_object(); }
[[nodiscard]] DeclarativeEnvironment& global_declarative_environment();
static VM& vm() { return VM::the(); }
ThrowCompletionOr<Value> run(Script&, GC::Ptr<Environment> lexical_environment_override = nullptr);