mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
LibJS+LibWeb: Reduce use of GlobalObject as an intermediary
- Prefer VM::current_realm() over GlobalObject::associated_realm() - Prefer VM::heap() over GlobalObject::heap() - Prefer Cell::vm() over Cell::global_object() - Prefer Wrapper::vm() over Wrapper::global_object() - Inline Realm::global_object() calls used to access intrinsics as they will later perform a direct lookup without going through the global object
This commit is contained in:
@@ -324,7 +324,7 @@ JS::GlobalObject& current_global_object()
|
||||
JS::Realm& relevant_realm(JS::Object const& object)
|
||||
{
|
||||
// The relevant Realm for a platform object is the value of its [[Realm]] field.
|
||||
return *object.global_object().associated_realm();
|
||||
return object.shape().realm();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object
|
||||
|
||||
Reference in New Issue
Block a user