mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 07:22:50 +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
|
@ -374,7 +374,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
|
|||
}
|
||||
|
||||
auto& running_execution_context = this->running_execution_context();
|
||||
auto* arguments = running_execution_context.arguments().data();
|
||||
auto* arguments = running_execution_context.arguments.data();
|
||||
auto& accumulator = this->accumulator();
|
||||
auto& executable = current_executable();
|
||||
auto const* bytecode = executable.bytecode.data();
|
||||
|
@ -2331,7 +2331,7 @@ ThrowCompletionOr<void> CreateVariable::execute_impl(Bytecode::Interpreter& inte
|
|||
|
||||
void CreateRestParams::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
auto const arguments = interpreter.running_execution_context().arguments();
|
||||
auto const arguments = interpreter.running_execution_context().arguments;
|
||||
auto arguments_count = interpreter.running_execution_context().passed_argument_count;
|
||||
auto array = MUST(Array::create(interpreter.realm(), 0));
|
||||
for (size_t rest_index = m_rest_index; rest_index < arguments_count; ++rest_index)
|
||||
|
@ -2342,7 +2342,7 @@ void CreateRestParams::execute_impl(Bytecode::Interpreter& interpreter) const
|
|||
void CreateArguments::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
auto const& function = interpreter.running_execution_context().function;
|
||||
auto const arguments = interpreter.running_execution_context().arguments();
|
||||
auto const arguments = interpreter.running_execution_context().arguments;
|
||||
auto const& environment = interpreter.running_execution_context().lexical_environment;
|
||||
|
||||
auto passed_arguments = ReadonlySpan<Value> { arguments.data(), interpreter.running_execution_context().passed_argument_count };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue