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:
Andreas Kling
2026-03-04 10:32:01 +01:00
committed by Andreas Kling
parent 0c5e4ebc18
commit 4e0e16e510
Notes: github-actions[bot] 2026-03-04 17:54:33 +00:00
7 changed files with 88 additions and 52 deletions

View File

@@ -140,29 +140,6 @@ private:
static_assert(IsTriviallyDestructible<ExecutionContext>);
#define ALLOCATE_EXECUTION_CONTEXT_ON_NATIVE_STACK_WITHOUT_CLEARING_ARGS(execution_context, \
registers_and_locals_count, \
constants_count, \
arguments_count) \
auto execution_context_size = sizeof(JS::ExecutionContext) \
+ (((registers_and_locals_count) + (constants_count) + (arguments_count)) \
* sizeof(JS::Value)); \
\
void* execution_context_memory = alloca(execution_context_size); \
\
execution_context = new (execution_context_memory) \
JS::ExecutionContext((registers_and_locals_count), (constants_count), (arguments_count));
#define ALLOCATE_EXECUTION_CONTEXT_ON_NATIVE_STACK(execution_context, registers_and_locals_count, \
constants_count, arguments_count) \
ALLOCATE_EXECUTION_CONTEXT_ON_NATIVE_STACK_WITHOUT_CLEARING_ARGS(execution_context, \
registers_and_locals_count, constants_count, arguments_count); \
do { \
for (size_t i = 0; i < execution_context->arguments.size(); i++) { \
execution_context->arguments[i] = JS::js_undefined(); \
} \
} while (0)
struct StackTraceElement {
ExecutionContext* execution_context { nullptr };
GC::Ptr<CachedSourceRange> source_range;