From 4a51165f5f96f5f948d7630a3976436557767c13 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 31 Jan 2022 12:49:52 +0100 Subject: [PATCH] LibJS: Reorganize JS::Shape members a little bit Now that AK::Weakable doesn't have a bunch of padding at the end, let's move the smaller members of JS::Shape to the end, since there's nothing to fold into at the start. --- Userland/Libraries/LibJS/Runtime/Shape.cpp | 10 +++++----- Userland/Libraries/LibJS/Runtime/Shape.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Shape.cpp b/Userland/Libraries/LibJS/Runtime/Shape.cpp index 25434f3851..e07cfd01fa 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.cpp +++ b/Userland/Libraries/LibJS/Runtime/Shape.cpp @@ -98,22 +98,22 @@ Shape::Shape(Object& global_object) } Shape::Shape(Shape& previous_shape, const StringOrSymbol& property_name, PropertyAttributes attributes, TransitionType transition_type) - : m_attributes(attributes) - , m_transition_type(transition_type) - , m_global_object(previous_shape.m_global_object) + : m_global_object(previous_shape.m_global_object) , m_previous(&previous_shape) , m_property_name(property_name) , m_prototype(previous_shape.m_prototype) , m_property_count(transition_type == TransitionType::Put ? previous_shape.m_property_count + 1 : previous_shape.m_property_count) + , m_attributes(attributes) + , m_transition_type(transition_type) { } Shape::Shape(Shape& previous_shape, Object* new_prototype) - : m_transition_type(TransitionType::Prototype) - , m_global_object(previous_shape.m_global_object) + : m_global_object(previous_shape.m_global_object) , m_previous(&previous_shape) , m_prototype(new_prototype) , m_property_count(previous_shape.m_property_count) + , m_transition_type(TransitionType::Prototype) { } diff --git a/Userland/Libraries/LibJS/Runtime/Shape.h b/Userland/Libraries/LibJS/Runtime/Shape.h index 39afa6a1ce..55247bed2d 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.h +++ b/Userland/Libraries/LibJS/Runtime/Shape.h @@ -98,10 +98,6 @@ private: void ensure_property_table() const; - PropertyAttributes m_attributes { 0 }; - TransitionType m_transition_type : 6 { TransitionType::Invalid }; - bool m_unique : 1 { false }; - Object* m_global_object { nullptr }; mutable OwnPtr> m_property_table; @@ -112,6 +108,10 @@ private: StringOrSymbol m_property_name; Object* m_prototype { nullptr }; size_t m_property_count { 0 }; + + PropertyAttributes m_attributes { 0 }; + TransitionType m_transition_type : 6 { TransitionType::Invalid }; + bool m_unique : 1 { false }; }; }