1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00: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
38 changed files with 251 additions and 217 deletions

View file

@ -47,13 +47,13 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ShadowRealmConstructor::construct(Functi
auto realm = MUST_OR_THROW_OOM(Realm::create(vm));
// 5. Let context be a new execution context.
auto context = ExecutionContext { vm.heap() };
auto context = ExecutionContext::create(vm.heap());
// 6. Set the Function of context to null.
context.function = nullptr;
context->function = nullptr;
// 7. Set the Realm of context to realmRec.
context.realm = realm;
context->realm = realm;
// 8. Set the ScriptOrModule of context to null.
// Note: This is already the default value.