LibJS: Replace m_functions_to_initialize with pre-created data

Replace Vector<FunctionDeclaration const&> with a FunctionToInitialize
struct that stores a pre-created SharedFunctionInstanceData, function
name, and local index. The SharedFunctionInstanceData for each hoisted
function is created eagerly during the parent's construction, removing
the need to reference FunctionDeclaration AST nodes after construction.
This commit is contained in:
Andreas Kling
2026-02-11 01:08:21 +01:00
committed by Andreas Kling
parent 7cc392551b
commit d36521a698
Notes: github-actions[bot] 2026-02-11 23:00:56 +00:00
3 changed files with 23 additions and 12 deletions

View File

@@ -84,7 +84,12 @@ public:
Yes,
};
HashMap<Utf16FlyString, ParameterIsLocal> m_parameter_names;
Vector<FunctionDeclaration const&> m_functions_to_initialize;
struct FunctionToInitialize {
GC::Ref<SharedFunctionInstanceData> shared_data;
Utf16FlyString name;
Identifier::Local local {};
};
Vector<FunctionToInitialize> m_functions_to_initialize;
bool m_arguments_object_needed { false };
bool m_function_environment_needed { false };
bool m_uses_this { false };