mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibJS+LibWeb: Use InterpreterStack for all execution context allocation
Replace alloca-based execution context allocation with InterpreterStack bump allocation across all call sites: bytecode call instructions, AbstractOperations call/construct, script evaluation, module evaluation, and LibWeb module script evaluation. Also replace the native stack space check with an InterpreterStack exhaustion check, and remove the now-unused alloca macros from ExecutionContext.h.
This commit is contained in:
parent
0c5e4ebc18
commit
4e0e16e510
Notes:
github-actions[bot]
2026-03-04 17:54:33 +00:00
Author: https://github.com/awesomekling
Commit: 4e0e16e510
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8270
7 changed files with 88 additions and 52 deletions
|
|
@ -765,8 +765,12 @@ ThrowCompletionOr<void> SourceTextModule::execute_module(VM& vm, GC::Ptr<Promise
|
|||
}
|
||||
|
||||
// 1. Let moduleContext be a new ECMAScript code execution context.
|
||||
ExecutionContext* module_context = nullptr;
|
||||
ALLOCATE_EXECUTION_CONTEXT_ON_NATIVE_STACK(module_context, registers_and_locals_count, constants_count, 0);
|
||||
auto& stack = vm.interpreter_stack();
|
||||
auto* stack_mark = stack.top();
|
||||
auto* module_context = stack.allocate(registers_and_locals_count, constants_count, 0);
|
||||
if (!module_context) [[unlikely]]
|
||||
return vm.throw_completion<InternalError>(ErrorType::CallStackSizeExceeded);
|
||||
ScopeGuard deallocate_guard = [&stack, stack_mark] { stack.deallocate(stack_mark); };
|
||||
|
||||
// 2. Set the Function of moduleContext to null.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue