mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +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:
parent
e3895e6c80
commit
b345a0acca
58 changed files with 157 additions and 231 deletions
|
@ -500,7 +500,6 @@ VM& ConsoleClient::vm()
|
|||
// 2.1. Logger(logLevel, args), https://console.spec.whatwg.org/#logger
|
||||
ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, MarkedVector<Value> const& args)
|
||||
{
|
||||
auto& global_object = this->global_object();
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1. If args is empty, return.
|
||||
|
@ -515,7 +514,7 @@ ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, Mark
|
|||
|
||||
// 4. If rest is empty, perform Printer(logLevel, « first ») and return.
|
||||
if (rest_size == 0) {
|
||||
MarkedVector<Value> first_as_vector { global_object.heap() };
|
||||
MarkedVector<Value> first_as_vector { vm.heap() };
|
||||
first_as_vector.append(first);
|
||||
return printer(log_level, move(first_as_vector));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue