LibJS+LibWeb: Rename Heap::allocate_without_realm to Heap::allocate

Now that the heap has no knowledge about a JavaScript realm and is
purely for managing the memory of the heap, it does not make sense
to name this function to say that it is a non-realm variant.
This commit is contained in:
Shannon Booth 2024-11-14 06:13:46 +13:00 committed by Tim Flynn
commit 1e54003cb1
Notes: github-actions[bot] 2024-11-13 21:52:39 +00:00
115 changed files with 243 additions and 243 deletions

View file

@ -148,7 +148,7 @@ ThrowCompletionOr<NonnullGCPtr<Intrinsics>> Intrinsics::create(Realm& realm)
auto& vm = realm.vm();
// 1. Set realmRec.[[Intrinsics]] to a new Record.
auto intrinsics = vm.heap().allocate_without_realm<Intrinsics>(realm);
auto intrinsics = vm.heap().allocate<Intrinsics>(realm);
realm.set_intrinsics({}, intrinsics);
// 2. Set fields of realmRec.[[Intrinsics]] with the values listed in Table 6.
@ -179,26 +179,26 @@ ThrowCompletionOr<void> Intrinsics::initialize_intrinsics(Realm& realm)
auto& vm = this->vm();
// These are done first since other prototypes depend on their presence.
m_empty_object_shape = heap().allocate_without_realm<Shape>(realm);
m_object_prototype = heap().allocate_without_realm<ObjectPrototype>(realm);
m_empty_object_shape = heap().allocate<Shape>(realm);
m_object_prototype = heap().allocate<ObjectPrototype>(realm);
m_object_prototype->convert_to_prototype_if_needed();
m_function_prototype = heap().allocate_without_realm<FunctionPrototype>(realm);
m_function_prototype = heap().allocate<FunctionPrototype>(realm);
m_function_prototype->convert_to_prototype_if_needed();
m_new_object_shape = heap().allocate_without_realm<Shape>(realm);
m_new_object_shape = heap().allocate<Shape>(realm);
m_new_object_shape->set_prototype_without_transition(m_object_prototype);
// OPTIMIZATION: A lot of runtime algorithms create an "iterator result" object.
// We pre-bake a shape for these objects and remember the property offsets.
// This allows us to construct them very quickly.
m_iterator_result_object_shape = heap().allocate_without_realm<Shape>(realm);
m_iterator_result_object_shape = heap().allocate<Shape>(realm);
m_iterator_result_object_shape->set_prototype_without_transition(m_object_prototype);
m_iterator_result_object_shape->add_property_without_transition(vm.names.value, Attribute::Writable | Attribute::Configurable | Attribute::Enumerable);
m_iterator_result_object_shape->add_property_without_transition(vm.names.done, Attribute::Writable | Attribute::Configurable | Attribute::Enumerable);
m_iterator_result_object_value_offset = m_iterator_result_object_shape->lookup(vm.names.value.to_string_or_symbol()).value().offset;
m_iterator_result_object_done_offset = m_iterator_result_object_shape->lookup(vm.names.done.to_string_or_symbol()).value().offset;
// Normally Realm::create() takes care of this, but these are allocated via Heap::allocate_without_realm().
// Normally Realm::create() takes care of this, but these are allocated via Heap::allocate().
m_function_prototype->initialize(realm);
m_object_prototype->initialize(realm);