mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibJS: Remove unused "lexical argument index" metadata from Identifier
This shrinks Identifier by 16 bytes. :^)
This commit is contained in:
parent
b0b022507b
commit
76f438eb3e
2 changed files with 0 additions and 17 deletions
|
@ -1212,7 +1212,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
FlyString const& string() const { return m_string; }
|
FlyString const& string() const { return m_string; }
|
||||||
void set_lexically_bound_function_argument_index(size_t index) { m_lexically_bound_function_argument = index; }
|
|
||||||
|
|
||||||
virtual Completion execute(Interpreter&) const override;
|
virtual Completion execute(Interpreter&) const override;
|
||||||
virtual void dump(int indent) const override;
|
virtual void dump(int indent) const override;
|
||||||
|
@ -1223,7 +1222,6 @@ private:
|
||||||
virtual bool is_identifier() const override { return true; }
|
virtual bool is_identifier() const override { return true; }
|
||||||
|
|
||||||
FlyString m_string;
|
FlyString m_string;
|
||||||
Optional<size_t> m_lexically_bound_function_argument;
|
|
||||||
mutable Optional<EnvironmentCoordinate> m_cached_environment_coordinate;
|
mutable Optional<EnvironmentCoordinate> m_cached_environment_coordinate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -222,15 +222,6 @@ public:
|
||||||
{
|
{
|
||||||
VERIFY(is_top_level() || m_parent_scope);
|
VERIFY(is_top_level() || m_parent_scope);
|
||||||
|
|
||||||
if (!m_contains_access_to_arguments_object) {
|
|
||||||
for (auto& it : m_identifier_and_argument_index_associations) {
|
|
||||||
for (auto& identifier : it.value) {
|
|
||||||
if (!has_declaration(identifier.string()))
|
|
||||||
identifier.set_lexically_bound_function_argument_index(it.key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < m_functions_to_hoist.size(); i++) {
|
for (size_t i = 0; i < m_functions_to_hoist.size(); i++) {
|
||||||
auto const& function_declaration = m_functions_to_hoist[i];
|
auto const& function_declaration = m_functions_to_hoist[i];
|
||||||
if (m_lexical_names.contains(function_declaration.name()) || m_forbidden_var_names.contains(function_declaration.name()))
|
if (m_lexical_names.contains(function_declaration.name()) || m_forbidden_var_names.contains(function_declaration.name()))
|
||||||
|
@ -252,11 +243,6 @@ public:
|
||||||
m_parser.m_state.current_scope_pusher = m_parent_scope;
|
m_parser.m_state.current_scope_pusher = m_parent_scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
void associate_identifier_with_argument_index(NonnullRefPtr<Identifier> identifier, size_t index)
|
|
||||||
{
|
|
||||||
m_identifier_and_argument_index_associations.ensure(index).append(move(identifier));
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_contains_await_expression()
|
void set_contains_await_expression()
|
||||||
{
|
{
|
||||||
m_contains_await_expression = true;
|
m_contains_await_expression = true;
|
||||||
|
@ -289,7 +275,6 @@ private:
|
||||||
NonnullRefPtrVector<FunctionDeclaration> m_functions_to_hoist;
|
NonnullRefPtrVector<FunctionDeclaration> m_functions_to_hoist;
|
||||||
|
|
||||||
Optional<Vector<FunctionDeclaration::Parameter>> m_function_parameters;
|
Optional<Vector<FunctionDeclaration::Parameter>> m_function_parameters;
|
||||||
HashMap<size_t, NonnullRefPtrVector<Identifier>> m_identifier_and_argument_index_associations;
|
|
||||||
|
|
||||||
bool m_contains_access_to_arguments_object { false };
|
bool m_contains_access_to_arguments_object { false };
|
||||||
bool m_contains_direct_call_to_eval { false };
|
bool m_contains_direct_call_to_eval { false };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue