LibJS: Cache arguments span in ExecutionContext

Allows us to avoid doing math in ExecutionContext::argument()
This commit is contained in:
Aliaksandr Kalenik 2025-04-24 01:37:30 +02:00 committed by Andreas Kling
parent ff751173ac
commit e48645c83f
Notes: github-actions[bot] 2025-04-24 08:31:57 +00:00
13 changed files with 24 additions and 31 deletions

View file

@ -506,7 +506,7 @@ ThrowCompletionOr<Value> ECMAScriptFunctionObject::internal_call(Value this_argu
ALLOCATE_EXECUTION_CONTEXT_ON_NATIVE_STACK(callee_context, registers_and_constants_and_locals_count, arguments_count);
// Non-standard
auto arguments = callee_context->arguments();
auto arguments = callee_context->arguments;
if (!arguments_list.is_empty())
arguments.overwrite(0, arguments_list.data(), arguments_list.size() * sizeof(Value));
callee_context->passed_argument_count = arguments_list.size();
@ -578,7 +578,7 @@ ThrowCompletionOr<GC::Ref<Object>> ECMAScriptFunctionObject::internal_construct(
ALLOCATE_EXECUTION_CONTEXT_ON_NATIVE_STACK(callee_context, registers_and_constants_and_locals_count, arguments_count);
// Non-standard
auto arguments = callee_context->arguments();
auto arguments = callee_context->arguments;
if (!arguments_list.is_empty())
arguments.overwrite(0, arguments_list.data(), arguments_list.size() * sizeof(Value));
callee_context->passed_argument_count = arguments_list.size();