LibJS: Replace VariableNameToInitialize with value-type VarBinding

Replace VariableNameToInitialize (which holds Identifier const&) with a
VarBinding struct that stores pre-extracted values: name, local index,
parameter_binding, and function_name. This removes a reference to AST
Identifier nodes from SharedFunctionInstanceData, allowing the AST to
be freed after compilation.
This commit is contained in:
Andreas Kling
2026-02-11 01:06:58 +01:00
committed by Andreas Kling
parent 0e0818a232
commit 7cc392551b
Notes: github-actions[bot] 2026-02-11 23:01:04 +00:00
3 changed files with 25 additions and 25 deletions

View File

@@ -70,8 +70,9 @@ public:
bool m_has_simple_parameter_list { false };
bool m_is_module_wrapper { false };
struct VariableNameToInitialize {
Identifier const& identifier;
struct VarBinding {
Utf16FlyString name;
Identifier::Local local {};
bool parameter_binding { false };
bool function_name { false };
};
@@ -87,7 +88,7 @@ public:
bool m_arguments_object_needed { false };
bool m_function_environment_needed { false };
bool m_uses_this { false };
Vector<VariableNameToInitialize> m_var_names_to_initialize_binding;
Vector<VarBinding> m_var_names_to_initialize_binding;
Vector<Utf16FlyString> m_function_names_to_initialize_binding;
size_t m_function_environment_bindings_count { 0 };