1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibJS: Use allocate_without_global_object for allocating Shapes

This commit is contained in:
Andreas Kling 2020-10-17 23:47:07 +02:00
parent d8269c343c
commit 77c1957961
3 changed files with 9 additions and 9 deletions

View file

@ -32,7 +32,7 @@ namespace JS {
Shape* Shape::create_unique_clone() const
{
auto* new_shape = heap().allocate<Shape>(m_global_object, m_global_object);
auto* new_shape = heap().allocate_without_global_object<Shape>(m_global_object);
new_shape->m_unique = true;
new_shape->m_prototype = m_prototype;
ensure_property_table();
@ -47,7 +47,7 @@ Shape* Shape::create_put_transition(const StringOrSymbol& property_name, Propert
TransitionKey key { property_name, attributes };
if (auto* existing_shape = m_forward_transitions.get(key).value_or(nullptr))
return existing_shape;
auto* new_shape = heap().allocate<Shape>(m_global_object, *this, property_name, attributes, TransitionType::Put);
auto* new_shape = heap().allocate_without_global_object<Shape>(*this, property_name, attributes, TransitionType::Put);
m_forward_transitions.set(key, new_shape);
return new_shape;
}
@ -57,14 +57,14 @@ Shape* Shape::create_configure_transition(const StringOrSymbol& property_name, P
TransitionKey key { property_name, attributes };
if (auto* existing_shape = m_forward_transitions.get(key).value_or(nullptr))
return existing_shape;
auto* new_shape = heap().allocate<Shape>(m_global_object, *this, property_name, attributes, TransitionType::Configure);
auto* new_shape = heap().allocate_without_global_object<Shape>(*this, property_name, attributes, TransitionType::Configure);
m_forward_transitions.set(key, new_shape);
return new_shape;
}
Shape* Shape::create_prototype_transition(Object* new_prototype)
{
return heap().allocate<Shape>(m_global_object, *this, new_prototype);
return heap().allocate_without_global_object<Shape>(*this, new_prototype);
}
Shape::Shape(GlobalObject& global_object)