1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09:00

LibJS+LibWeb: Join arguments into vector of registers+constants+locals

This is better because:
- Better data locality
- Allocate vector for registers+constants+locals+arguments in one go
  instead of allocating two vectors separately
This commit is contained in:
Aliaksandr Kalenik 2025-04-23 00:57:07 +02:00 committed by Andreas Kling
parent cd9e491742
commit c6cd03d7ca
Notes: github-actions[bot] 2025-04-24 08:32:31 +00:00
21 changed files with 76 additions and 60 deletions

View file

@ -107,7 +107,7 @@ SourceTextModule::SourceTextModule(Realm& realm, StringView filename, Script::Ho
RefPtr<ExportStatement const> default_export)
: CyclicModule(realm, filename, has_top_level_await, move(requested_modules), host_defined)
, m_ecmascript_code(move(body))
, m_execution_context(ExecutionContext::create(0))
, m_execution_context(ExecutionContext::create(0, 0))
, m_import_entries(move(import_entries))
, m_local_export_entries(move(local_export_entries))
, m_indirect_export_entries(move(indirect_export_entries))
@ -701,7 +701,7 @@ ThrowCompletionOr<void> SourceTextModule::execute_module(VM& vm, GC::Ptr<Promise
}
// 1. Let moduleContext be a new ECMAScript code execution context.
auto module_context = ExecutionContext::create(registers_and_constants_and_locals_count);
auto module_context = ExecutionContext::create(registers_and_constants_and_locals_count, 0);
// Note: This is not in the spec but we require it.
module_context->is_strict_mode = true;