1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

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
parent 6b883c5ccb
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

@ -2630,7 +2630,7 @@ ThrowCompletionOr<void> CallConstruct::execute_impl(Bytecode::Interpreter& inter
auto argument_values = interpreter.allocate_argument_values(m_argument_count);
for (size_t i = 0; i < m_argument_count; ++i)
argument_values[i] = interpreter.get(m_arguments[i]);
interpreter.set(dst(), TRY(perform_call(interpreter, interpreter.get(m_this_value), CallType::Construct, callee, argument_values)));
interpreter.set(dst(), TRY(perform_call(interpreter, Value(), CallType::Construct, callee, argument_values)));
return {};
}
@ -3424,10 +3424,9 @@ ByteString Call::to_byte_string_impl(Bytecode::Executable const& executable) con
ByteString CallConstruct::to_byte_string_impl(Bytecode::Executable const& executable) const
{
StringBuilder builder;
builder.appendff("CallConstruct {}, {}, {}, "sv,
builder.appendff("CallConstruct {}, {}, "sv,
format_operand("dst"sv, m_dst, executable),
format_operand("callee"sv, m_callee, executable),
format_operand("this"sv, m_this_value, executable));
format_operand("callee"sv, m_callee, executable));
builder.append(format_operand_list("args"sv, { m_arguments, m_argument_count }, executable));