diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-14 17:40:33 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-12-15 06:56:37 -0500 |
commit | 22089436edec780e03960ecaa74bfc4930126534 (patch) | |
tree | f60662c28d36e8fcce4b734e09af396c68ed1aaf /Userland/Libraries/LibJS/Runtime/Shape.cpp | |
parent | 2a66fc6cae8ef09e780cd795bf0b1d7f8844f4ec (diff) | |
download | serenity-22089436edec780e03960ecaa74bfc4930126534.zip |
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Shape.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Shape.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Shape.cpp b/Userland/Libraries/LibJS/Runtime/Shape.cpp index a4243d4a29..11423b931d 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.cpp +++ b/Userland/Libraries/LibJS/Runtime/Shape.cpp @@ -12,7 +12,7 @@ namespace JS { Shape* Shape::create_unique_clone() const { - auto* new_shape = heap().allocate_without_realm<Shape>(m_realm); + auto new_shape = heap().allocate_without_realm<Shape>(m_realm); new_shape->m_unique = true; new_shape->m_prototype = m_prototype; ensure_property_table(); @@ -57,10 +57,10 @@ Shape* Shape::create_put_transition(StringOrSymbol const& property_key, 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_without_realm<Shape>(*this, property_key, attributes, TransitionType::Put); if (!m_forward_transitions) m_forward_transitions = make<HashMap<TransitionKey, WeakPtr<Shape>>>(); - m_forward_transitions->set(key, new_shape); + m_forward_transitions->set(key, new_shape.ptr()); return new_shape; } @@ -69,10 +69,10 @@ Shape* Shape::create_configure_transition(StringOrSymbol const& property_key, Pr 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_without_realm<Shape>(*this, property_key, attributes, TransitionType::Configure); if (!m_forward_transitions) m_forward_transitions = make<HashMap<TransitionKey, WeakPtr<Shape>>>(); - m_forward_transitions->set(key, new_shape); + m_forward_transitions->set(key, new_shape.ptr()); return new_shape; } @@ -80,10 +80,10 @@ Shape* Shape::create_prototype_transition(Object* new_prototype) { 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_without_realm<Shape>(*this, new_prototype); if (!m_prototype_transitions) m_prototype_transitions = make<HashMap<Object*, WeakPtr<Shape>>>(); - m_prototype_transitions->set(new_prototype, new_shape); + m_prototype_transitions->set(new_prototype, new_shape.ptr()); return new_shape; } |