mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 20:52:54 +00:00
LibJS: Cache arguments span in ExecutionContext
Allows us to avoid doing math in ExecutionContext::argument()
This commit is contained in:
parent
ff751173ac
commit
e48645c83f
Notes:
github-actions[bot]
2025-04-24 08:31:57 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: e48645c83f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4434
Reviewed-by: https://github.com/alimpfard
13 changed files with 24 additions and 31 deletions
|
@ -146,7 +146,7 @@ ThrowCompletionOr<Value> NativeFunction::internal_call(Value this_argument, Read
|
|||
// 8. Perform any necessary implementation-defined initialization of calleeContext.
|
||||
callee_context->this_value = this_argument;
|
||||
if (!arguments_list.is_empty())
|
||||
callee_context->arguments().overwrite(0, arguments_list.data(), arguments_list.size() * sizeof(Value));
|
||||
callee_context->arguments.overwrite(0, arguments_list.data(), arguments_list.size() * sizeof(Value));
|
||||
|
||||
callee_context->lexical_environment = caller_context.lexical_environment;
|
||||
callee_context->variable_environment = caller_context.variable_environment;
|
||||
|
@ -208,7 +208,7 @@ ThrowCompletionOr<GC::Ref<Object>> NativeFunction::internal_construct(ReadonlySp
|
|||
|
||||
// 8. Perform any necessary implementation-defined initialization of calleeContext.
|
||||
if (!arguments_list.is_empty())
|
||||
callee_context->arguments().overwrite(0, arguments_list.data(), arguments_list.size() * sizeof(Value));
|
||||
callee_context->arguments.overwrite(0, arguments_list.data(), arguments_list.size() * sizeof(Value));
|
||||
|
||||
callee_context->lexical_environment = caller_context.lexical_environment;
|
||||
callee_context->variable_environment = caller_context.variable_environment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue