1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibJS: Don't add uncaptured parameter bindings to environment

For parameters that exist strictly as "locals", we can save time and
space by not adding them to the function environment.

This is a speed-up across the board on basically every test.
For example, ~11% on Octane/typescript.js :^)
This commit is contained in:
Andreas Kling 2024-01-21 16:06:18 +01:00
parent 7e2308d290
commit bed78eb3cc
2 changed files with 19 additions and 11 deletions

View file

@ -153,7 +153,11 @@ private:
bool m_has_parameter_expressions { false };
bool m_has_duplicates { false };
HashTable<DeprecatedFlyString> m_parameter_names;
enum class ParameterIsLocal {
No,
Yes,
};
HashMap<DeprecatedFlyString, ParameterIsLocal> m_parameter_names;
Vector<FunctionDeclaration const&> m_functions_to_initialize;
bool m_arguments_object_needed { false };
bool m_is_module_wrapper { false };