LibJS: Shrink MemberExpression by rearranging members slightly

By putting m_computed in the padding hole after our base class,
we shrink MemberExpression by 8 bytes. :^)
This commit is contained in:
Andreas Kling 2022-11-26 19:04:15 +01:00 committed by Linus Groh
parent e70f944e11
commit 1f909d24b6
Notes: sideshowbarker 2024-07-17 03:37:02 +09:00

View file

@ -1782,9 +1782,9 @@ class MemberExpression final : public Expression {
public:
MemberExpression(SourceRange source_range, NonnullRefPtr<Expression> object, NonnullRefPtr<Expression> property, bool computed = false)
: Expression(source_range)
, m_computed(computed)
, m_object(move(object))
, m_property(move(property))
, m_computed(computed)
{
}
@ -1804,9 +1804,9 @@ public:
private:
virtual bool is_member_expression() const override { return true; }
bool m_computed { false };
NonnullRefPtr<Expression> m_object;
NonnullRefPtr<Expression> m_property;
bool m_computed { false };
};
class OptionalChain final : public Expression {