1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 11:54:57 +00:00

LibJS: Put Bytecode::CallFrame + register slots in a single allocation

The number of registers in a call frame never changes, so we can
allocate it at the end of the CallFrame object and save ourselves the
cost of allocating separate Vector storage for every call frame.
This commit is contained in:
Andreas Kling 2023-11-27 17:27:51 +01:00
parent 3dc5f467a8
commit 3fc0333ee6
11 changed files with 57 additions and 36 deletions

View file

@ -708,7 +708,7 @@ ThrowCompletionOr<void> SourceTextModule::execute_module(VM& vm, GCPtr<PromiseCa
result = value_and_frame.value.release_error();
} else {
// Resulting value is in the accumulator.
result = value_and_frame.frame->registers.at(0).value_or(js_undefined());
result = value_and_frame.frame->registers()[0].value_or(js_undefined());
}
}