Revert "LibJS: Shrink ExecutionContext by replacing ScriptOrModule …"

… with Cell*.

This reverts commit d3495c62a7.
This commit is contained in:
Tim Ledbetter
2026-03-11 20:35:43 +00:00
committed by Tim Ledbetter
parent ba8d63556f
commit 36f74ba96c
Notes: github-actions[bot] 2026-03-11 23:14:19 +00:00
16 changed files with 50 additions and 60 deletions

View File

@@ -192,7 +192,7 @@ static JS::ExecutionContext* top_most_script_having_execution_context(JS::VM& vm
// Here, the topmost script-having execution context is the topmost entry of the JavaScript execution context stack that has a non-null ScriptOrModule component,
// or null if there is no such entry in the JavaScript execution context stack.
auto execution_context = vm.execution_context_stack().last_matching([&](JS::ExecutionContext* context) {
return context->script_or_module != nullptr;
return !context->script_or_module.has<Empty>();
});
if (!execution_context.has_value())

View File

@@ -128,7 +128,7 @@ JS::Promise* JavaScriptModuleScript::run(PreventErrorReporting)
auto* module_execution_context = stack.allocate(0, 0, 0);
VERIFY(module_execution_context);
module_execution_context->realm = &realm;
module_execution_context->script_or_module = record;
module_execution_context->script_or_module = GC::Ref<JS::Module> { *record };
vm().push_execution_context(*module_execution_context);
// 2. Set evaluationPromise to record.Evaluate().