mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibJS: Shrink ExecutionContext by replacing ScriptOrModule with Cell*
Replace the 16-byte Variant<Empty, GC::Ref<Script>, GC::Ref<Module>> with a simple 8-byte GC::Ptr<Cell> that points to either a Script or Module (or is null for Empty). A helper function script_or_module_from_cell() converts back to the full ScriptOrModule variant when needed (e.g. in VM::get_active_script_or_module).
This commit is contained in:
parent
c8ad07dece
commit
d3495c62a7
Notes:
github-actions[bot]
2026-03-11 12:35:02 +00:00
Author: https://github.com/awesomekling
Commit: d3495c62a7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8360
Reviewed-by: https://github.com/shannonbooth
16 changed files with 60 additions and 50 deletions
|
|
@ -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 = GC::Ref<JS::Module> { *record };
|
||||
module_execution_context->script_or_module = record;
|
||||
vm().push_execution_context(*module_execution_context);
|
||||
|
||||
// 2. Set evaluationPromise to record.Evaluate().
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue