summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-10-22 17:03:40 +0200
committerAndreas Kling <kling@serenityos.org>2020-10-22 17:03:40 +0200
commit07f76cd980c364ec106d8183ebadd196751810f4 (patch)
tree906611d342026b60c5724542abc1139138b205d7
parent4e8cb4558b11bd9ed00b9c27ee80d42f426ef15c (diff)
downloadserenity-07f76cd980c364ec106d8183ebadd196751810f4.zip
LibJS: Shrink sizeof(LexicalEnvironment) by reorganizing members
-rw-r--r--Libraries/LibJS/Runtime/LexicalEnvironment.cpp4
-rw-r--r--Libraries/LibJS/Runtime/LexicalEnvironment.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibJS/Runtime/LexicalEnvironment.cpp b/Libraries/LibJS/Runtime/LexicalEnvironment.cpp
index c60b444aca..87d504ae1a 100644
--- a/Libraries/LibJS/Runtime/LexicalEnvironment.cpp
+++ b/Libraries/LibJS/Runtime/LexicalEnvironment.cpp
@@ -49,9 +49,9 @@ LexicalEnvironment::LexicalEnvironment(HashMap<FlyString, Variable> variables, L
}
LexicalEnvironment::LexicalEnvironment(HashMap<FlyString, Variable> variables, LexicalEnvironment* parent, EnvironmentRecordType environment_record_type)
- : m_parent(parent)
+ : m_environment_record_type(environment_record_type)
+ , m_parent(parent)
, m_variables(move(variables))
- , m_environment_record_type(environment_record_type)
{
}
diff --git a/Libraries/LibJS/Runtime/LexicalEnvironment.h b/Libraries/LibJS/Runtime/LexicalEnvironment.h
index 8607e02917..e939cb5d2a 100644
--- a/Libraries/LibJS/Runtime/LexicalEnvironment.h
+++ b/Libraries/LibJS/Runtime/LexicalEnvironment.h
@@ -93,10 +93,10 @@ private:
virtual const char* class_name() const override { return "LexicalEnvironment"; }
virtual void visit_children(Visitor&) override;
+ EnvironmentRecordType m_environment_record_type : 8 { EnvironmentRecordType::Declarative };
+ ThisBindingStatus m_this_binding_status : 8 { ThisBindingStatus::Uninitialized };
LexicalEnvironment* m_parent { nullptr };
HashMap<FlyString, Variable> m_variables;
- EnvironmentRecordType m_environment_record_type = EnvironmentRecordType::Declarative;
- ThisBindingStatus m_this_binding_status = ThisBindingStatus::Uninitialized;
Value m_home_object;
Value m_this_value;
Value m_new_target;