LibJS: Inline ExecutionContextRareData fields into ExecutionContext

After removing the unwind context stack, ExecutionContextRareData only
held two GC::Ptr fields — both trivially destructible. The indirection
cost more than it saved: a GC cell allocation per EC, an extra pointer
chase on every source range lookup, and unnecessary complexity.

Replace the rare data cell with two inline fields on ExecutionContext:
cached_source_range and context_owner.
This commit is contained in:
Andreas Kling
2026-02-09 11:41:22 +01:00
committed by Andreas Kling
parent 4e1d6faf0e
commit 4fa4ecf31b
Notes: github-actions[bot] 2026-02-09 15:37:21 +00:00
4 changed files with 13 additions and 45 deletions

View File

@@ -40,7 +40,7 @@ void Environment::visit_edges(Cell::Visitor& visitor)
EnvironmentSettingsObject::EnvironmentSettingsObject(NonnullOwnPtr<JS::ExecutionContext> realm_execution_context)
: m_realm_execution_context(move(realm_execution_context))
{
m_realm_execution_context->ensure_rare_data()->context_owner = this;
m_realm_execution_context->context_owner = this;
// Register with the responsible event loop so we can perform step 4 of "perform a microtask checkpoint".
responsible_event_loop().register_environment_settings_object({}, *this);