LibJS: Remove unused this value from CallConstruct instruction

There's no `this` value prior in the caller context, and this was never
actually used by CallConstruct.
This commit is contained in:
Andreas Kling 2025-04-06 22:50:55 +02:00 committed by Andreas Kling
commit 5cdbb8b140
Notes: github-actions[bot] 2025-04-08 16:54:36 +00:00
3 changed files with 4 additions and 10 deletions

View file

@ -1900,11 +1900,10 @@ class CallConstruct final : public Instruction {
public:
static constexpr bool IsVariableLength = true;
CallConstruct(Operand dst, Operand callee, Operand this_value, ReadonlySpan<ScopedOperand> arguments, Optional<StringTableIndex> expression_string = {})
CallConstruct(Operand dst, Operand callee, ReadonlySpan<ScopedOperand> arguments, Optional<StringTableIndex> expression_string = {})
: Instruction(Type::CallConstruct)
, m_dst(dst)
, m_callee(callee)
, m_this_value(this_value)
, m_argument_count(arguments.size())
, m_expression_string(expression_string)
{
@ -1919,7 +1918,6 @@ public:
Operand dst() const { return m_dst; }
Operand callee() const { return m_callee; }
Operand this_value() const { return m_this_value; }
Optional<StringTableIndex> const& expression_string() const { return m_expression_string; }
u32 argument_count() const { return m_argument_count; }
@ -1930,7 +1928,6 @@ public:
{
visitor(m_dst);
visitor(m_callee);
visitor(m_this_value);
for (size_t i = 0; i < m_argument_count; i++)
visitor(m_arguments[i]);
}
@ -1938,7 +1935,6 @@ public:
private:
Operand m_dst;
Operand m_callee;
Operand m_this_value;
u32 m_argument_count { 0 };
Optional<StringTableIndex> m_expression_string;
Operand m_arguments[];