mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
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:
committed by
Andreas Kling
parent
7cc392551b
commit
d36521a698
Notes:
github-actions[bot]
2026-02-11 23:00:56 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/d36521a6987 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7896
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user