LibJS: Move bytecode executable cache to SharedFunctionInstanceData

This shrinks every Statement and ECMAScriptFunctionObject by one
pointer, and puts the bytecode cache in the only place that actually
makes use of it anyway: functions.
This commit is contained in:
Andreas Kling 2025-10-26 11:23:28 +01:00 committed by Andreas Kling
parent 3a38040c82
commit b712caf855
Notes: github-actions[bot] 2025-10-27 20:15:48 +00:00
3 changed files with 14 additions and 22 deletions

View file

@ -54,6 +54,8 @@ public:
FunctionParsingInsights const&,
Vector<LocalVariable> local_variables_names);
mutable GC::Ptr<Bytecode::Executable> m_executable;
RefPtr<FunctionParameters const> m_formal_parameters; // [[FormalParameters]]
RefPtr<Statement const> m_ecmascript_code; // [[ECMAScriptCode]]
@ -142,7 +144,7 @@ public:
void set_is_class_constructor() { const_cast<SharedFunctionInstanceData&>(shared_data()).m_is_class_constructor = true; }
auto& bytecode_executable() const { return m_bytecode_executable; }
auto& bytecode_executable() const { return shared_data().m_executable; }
Environment* environment() { return m_environment; }
virtual Realm* realm() const override { return &shape().realm(); }
@ -214,8 +216,6 @@ private:
GC::Ptr<PrimitiveString> m_name_string;
GC::Ptr<Bytecode::Executable> m_bytecode_executable;
// Internal Slots of ECMAScript Function Objects, https://tc39.es/ecma262/#table-internal-slots-of-ecmascript-function-objects
GC::Ptr<Environment> m_environment; // [[Environment]]
GC::Ptr<PrivateEnvironment> m_private_environment; // [[PrivateEnvironment]]