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

@ -23,7 +23,7 @@ Shape::~Shape()
NonnullGCPtr<Shape> Shape::create_cacheable_dictionary_transition()
{
auto new_shape = heap().allocate_without_realm<Shape>(m_realm);
auto new_shape = heap().allocate<Shape>(m_realm);
new_shape->m_dictionary = true;
new_shape->m_cacheable = true;
new_shape->m_prototype = m_prototype;
@ -37,7 +37,7 @@ NonnullGCPtr<Shape> Shape::create_cacheable_dictionary_transition()
NonnullGCPtr<Shape> Shape::create_uncacheable_dictionary_transition()
{
auto new_shape = heap().allocate_without_realm<Shape>(m_realm);
auto new_shape = heap().allocate<Shape>(m_realm);
new_shape->m_dictionary = true;
new_shape->m_cacheable = true;
new_shape->m_prototype = m_prototype;
@ -105,7 +105,7 @@ NonnullGCPtr<Shape> Shape::create_put_transition(StringOrSymbol const& property_
TransitionKey key { property_key, attributes };
if (auto existing_shape = get_or_prune_cached_forward_transition(key))
return *existing_shape;
auto new_shape = heap().allocate_without_realm<Shape>(*this, property_key, attributes, TransitionType::Put);
auto new_shape = heap().allocate<Shape>(*this, property_key, attributes, TransitionType::Put);
invalidate_prototype_if_needed_for_new_prototype(new_shape);
if (!m_is_prototype_shape) {
if (!m_forward_transitions)
@ -120,7 +120,7 @@ NonnullGCPtr<Shape> Shape::create_configure_transition(StringOrSymbol const& pro
TransitionKey key { property_key, attributes };
if (auto existing_shape = get_or_prune_cached_forward_transition(key))
return *existing_shape;
auto new_shape = heap().allocate_without_realm<Shape>(*this, property_key, attributes, TransitionType::Configure);
auto new_shape = heap().allocate<Shape>(*this, property_key, attributes, TransitionType::Configure);
invalidate_prototype_if_needed_for_new_prototype(new_shape);
if (!m_is_prototype_shape) {
if (!m_forward_transitions)
@ -136,7 +136,7 @@ NonnullGCPtr<Shape> Shape::create_prototype_transition(Object* new_prototype)
new_prototype->convert_to_prototype_if_needed();
if (auto existing_shape = get_or_prune_cached_prototype_transition(new_prototype))
return *existing_shape;
auto new_shape = heap().allocate_without_realm<Shape>(*this, new_prototype);
auto new_shape = heap().allocate<Shape>(*this, new_prototype);
invalidate_prototype_if_needed_for_new_prototype(new_shape);
if (!m_is_prototype_shape) {
if (!m_prototype_transitions)
@ -274,7 +274,7 @@ NonnullGCPtr<Shape> Shape::create_delete_transition(StringOrSymbol const& proper
{
if (auto existing_shape = get_or_prune_cached_delete_transition(property_key))
return *existing_shape;
auto new_shape = heap().allocate_without_realm<Shape>(*this, property_key, TransitionType::Delete);
auto new_shape = heap().allocate<Shape>(*this, property_key, TransitionType::Delete);
invalidate_prototype_if_needed_for_new_prototype(new_shape);
if (!m_delete_transitions)
m_delete_transitions = make<HashMap<StringOrSymbol, WeakPtr<Shape>>>();
@ -321,11 +321,11 @@ void Shape::remove_property_without_transition(StringOrSymbol const& property_ke
NonnullGCPtr<Shape> Shape::create_for_prototype(NonnullGCPtr<Realm> realm, GCPtr<Object> prototype)
{
auto new_shape = realm->heap().allocate_without_realm<Shape>(realm);
auto new_shape = realm->heap().allocate<Shape>(realm);
s_all_prototype_shapes.set(new_shape);
new_shape->m_is_prototype_shape = true;
new_shape->m_prototype = prototype;
new_shape->m_prototype_chain_validity = realm->heap().allocate_without_realm<PrototypeChainValidity>();
new_shape->m_prototype_chain_validity = realm->heap().allocate<PrototypeChainValidity>();
return new_shape;
}
@ -333,7 +333,7 @@ NonnullGCPtr<Shape> Shape::clone_for_prototype()
{
VERIFY(!m_is_prototype_shape);
VERIFY(!m_prototype_chain_validity);
auto new_shape = heap().allocate_without_realm<Shape>(m_realm);
auto new_shape = heap().allocate<Shape>(m_realm);
s_all_prototype_shapes.set(new_shape);
new_shape->m_is_prototype_shape = true;
new_shape->m_prototype = m_prototype;
@ -341,7 +341,7 @@ NonnullGCPtr<Shape> Shape::clone_for_prototype()
new_shape->ensure_property_table();
(*new_shape->m_property_table) = *m_property_table;
new_shape->m_property_count = new_shape->m_property_table->size();
new_shape->m_prototype_chain_validity = heap().allocate_without_realm<PrototypeChainValidity>();
new_shape->m_prototype_chain_validity = heap().allocate<PrototypeChainValidity>();
return new_shape;
}
@ -357,7 +357,7 @@ void Shape::set_prototype_shape()
VERIFY(!m_is_prototype_shape);
s_all_prototype_shapes.set(this);
m_is_prototype_shape = true;
m_prototype_chain_validity = heap().allocate_without_realm<PrototypeChainValidity>();
m_prototype_chain_validity = heap().allocate<PrototypeChainValidity>();
}
void Shape::invalidate_prototype_if_needed_for_new_prototype(NonnullGCPtr<Shape> new_prototype_shape)
@ -388,7 +388,7 @@ void Shape::invalidate_all_prototype_chains_leading_to_this()
return;
for (auto* shape : shapes_to_invalidate) {
shape->m_prototype_chain_validity->set_valid(false);
shape->m_prototype_chain_validity = heap().allocate_without_realm<PrototypeChainValidity>();
shape->m_prototype_chain_validity = heap().allocate<PrototypeChainValidity>();
}
}