mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
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:
committed by
Andreas Kling
parent
4e1d6faf0e
commit
4fa4ecf31b
Notes:
github-actions[bot]
2026-02-09 15:37:21 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/4fa4ecf31b9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7846
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user