mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
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:
committed by
Andreas Kling
parent
3a38040c82
commit
b712caf855
Notes:
github-actions[bot]
2025-10-27 20:15:48 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/b712caf8551 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6604
@@ -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]]
|
||||
|
||||
Reference in New Issue
Block a user