LibJS: Reorganize computing of |this| for CallExpressions

This avoids executing the LHS of the object expression twice when doing
a call on the result of an object expression.
This commit is contained in:
Andreas Kling 2020-04-01 18:51:27 +02:00
commit cd9379dca9
Notes: sideshowbarker 2024-07-19 08:01:00 +09:00
2 changed files with 29 additions and 11 deletions

View file

@ -484,6 +484,12 @@ public:
private:
virtual const char* class_name() const override { return "CallExpression"; }
struct ThisAndCallee {
Value this_value;
Value callee;
};
ThisAndCallee compute_this_and_callee(Interpreter&) const;
NonnullRefPtr<Expression> m_callee;
const NonnullRefPtrVector<Expression> m_arguments;
};