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
commit 3dc5f467a8
Notes: sideshowbarker 2024-07-17 03:03:37 +09:00
38 changed files with 251 additions and 217 deletions

View file

@ -44,7 +44,9 @@ ThrowCompletionOr<NonnullGCPtr<Object>> GeneratorFunctionConstructor::construct(
auto* constructor = vm.active_function_object();
// 2. Let args be the argumentsList that was passed to this function by [[Call]] or [[Construct]].
auto& args = vm.running_execution_context().arguments;
MarkedVector<Value> args(heap());
for (auto argument : vm.running_execution_context().arguments)
args.append(argument);
// 3. Return ? CreateDynamicFunction(C, NewTarget, generator, args).
return *TRY(FunctionConstructor::create_dynamic_function(vm, *constructor, &new_target, FunctionKind::Generator, args));