1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibJS: Always allocate ExecutionContext objects on the malloc heap

Instead of allocating these in a mixture of ways, we now always put
them on the malloc heap, and keep an intrusive linked list of them
that we can iterate for GC marking purposes.
This commit is contained in:
Andreas Kling 2023-11-27 16:45:45 +01:00
parent 845da3901d
commit 3dc5f467a8
Notes: sideshowbarker 2024-07-17 03:03:37 +09:00
38 changed files with 251 additions and 217 deletions

View file

@ -62,11 +62,11 @@ ThrowCompletionOr<Value> WrappedFunction::internal_call(Value this_argument, Rea
// NOTE: No-op, kept by the VM in its execution context stack.
// 2. Let calleeContext be PrepareForWrappedFunctionCall(F).
ExecutionContext callee_context { vm.heap() };
prepare_for_wrapped_function_call(*this, callee_context);
auto callee_context = ExecutionContext::create(vm.heap());
prepare_for_wrapped_function_call(*this, *callee_context);
// 3. Assert: calleeContext is now the running execution context.
VERIFY(&vm.running_execution_context() == &callee_context);
VERIFY(&vm.running_execution_context() == callee_context);
// 4. Let result be OrdinaryWrappedFunctionCall(F, thisArgument, argumentsList).
auto result = ordinary_wrapped_function_call(*this, this_argument, arguments_list);