diff --git a/Userland/Libraries/LibJS/CMakeLists.txt b/Userland/Libraries/LibJS/CMakeLists.txt index ba2ceb0692..1b02737384 100644 --- a/Userland/Libraries/LibJS/CMakeLists.txt +++ b/Userland/Libraries/LibJS/CMakeLists.txt @@ -34,6 +34,7 @@ set(SOURCES ParserError.cpp Print.cpp Runtime/AbstractOperations.cpp + Runtime/Accessor.cpp Runtime/AggregateError.cpp Runtime/AggregateErrorConstructor.cpp Runtime/AggregateErrorPrototype.cpp diff --git a/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp index d39a277560..eebff484b8 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp @@ -21,6 +21,8 @@ namespace JS::Test262 { +JS_DEFINE_ALLOCATOR($262Object); + $262Object::$262Object(Realm& realm) : Object(Object::ConstructWithoutPrototypeTag::Tag, realm) { diff --git a/Userland/Libraries/LibJS/Contrib/Test262/262Object.h b/Userland/Libraries/LibJS/Contrib/Test262/262Object.h index 9744576bd8..880152b882 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/262Object.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/262Object.h @@ -15,6 +15,7 @@ namespace JS::Test262 { class $262Object final : public Object { JS_OBJECT($262Object, Object); + JS_DECLARE_ALLOCATOR($262Object); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp index 910054e2d5..2cc3a38553 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp @@ -12,6 +12,8 @@ namespace JS::Test262 { +JS_DEFINE_ALLOCATOR(AgentObject); + AgentObject::AgentObject(Realm& realm) : Object(Object::ConstructWithoutPrototypeTag::Tag, realm) { diff --git a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h index 8810b4751c..d70f4f2ca3 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h @@ -13,6 +13,7 @@ namespace JS::Test262 { class AgentObject final : public Object { JS_OBJECT(AgentObject, Object); + JS_DECLARE_ALLOCATOR(AgentObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp index 3741b2671c..843dd8eada 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp @@ -14,6 +14,8 @@ namespace JS::Test262 { +JS_DEFINE_ALLOCATOR(GlobalObject); + void GlobalObject::initialize(Realm& realm) { Base::initialize(realm); diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h index d416548075..075cbfd332 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h @@ -13,6 +13,7 @@ namespace JS::Test262 { class GlobalObject final : public JS::GlobalObject { JS_OBJECT(GlobalObject, JS::GlobalObject); + JS_DECLARE_ALLOCATOR(GlobalObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp b/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp index 06b931182e..2f2567a20c 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp @@ -9,6 +9,8 @@ namespace JS::Test262 { +JS_DEFINE_ALLOCATOR(IsHTMLDDA); + IsHTMLDDA::IsHTMLDDA(Realm& realm) // NativeFunction without prototype is currently not possible (only due to the lack of a ctor that supports it) : NativeFunction("IsHTMLDDA", realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.h b/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.h index f8b1788b0a..e1639bb80d 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.h @@ -12,6 +12,7 @@ namespace JS::Test262 { class IsHTMLDDA final : public NativeFunction { JS_OBJECT(IsHTMLDDA, NativeFunction); + JS_DECLARE_ALLOCATOR(IsHTMLDDA); public: virtual ~IsHTMLDDA() override = default; diff --git a/Userland/Libraries/LibJS/CyclicModule.cpp b/Userland/Libraries/LibJS/CyclicModule.cpp index 59a9663834..59eba5bc4f 100644 --- a/Userland/Libraries/LibJS/CyclicModule.cpp +++ b/Userland/Libraries/LibJS/CyclicModule.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(CyclicModule); + CyclicModule::CyclicModule(Realm& realm, StringView filename, bool has_top_level_await, Vector requested_modules, Script::HostDefined* host_defined) : Module(realm, filename, host_defined) , m_requested_modules(move(requested_modules)) diff --git a/Userland/Libraries/LibJS/CyclicModule.h b/Userland/Libraries/LibJS/CyclicModule.h index f3daaacfa9..fc809ff1a0 100644 --- a/Userland/Libraries/LibJS/CyclicModule.h +++ b/Userland/Libraries/LibJS/CyclicModule.h @@ -42,6 +42,7 @@ struct GraphLoadingState { // 16.2.1.5 Cyclic Module Records, https://tc39.es/ecma262/#cyclic-module-record class CyclicModule : public Module { JS_CELL(CyclicModule, Module); + JS_DECLARE_ALLOCATOR(CyclicModule); public: // Note: Do not call these methods directly unless you are HostResolveImportedModule. diff --git a/Userland/Libraries/LibJS/Heap/CellAllocator.h b/Userland/Libraries/LibJS/Heap/CellAllocator.h index 8e92f08568..2474acf587 100644 --- a/Userland/Libraries/LibJS/Heap/CellAllocator.h +++ b/Userland/Libraries/LibJS/Heap/CellAllocator.h @@ -11,6 +11,12 @@ #include #include +#define JS_DECLARE_ALLOCATOR(ClassName) \ + static JS::TypeIsolatingCellAllocator cell_allocator; + +#define JS_DEFINE_ALLOCATOR(ClassName) \ + JS::TypeIsolatingCellAllocator ClassName::cell_allocator; + namespace JS { class CellAllocator { @@ -40,11 +46,19 @@ public: void block_did_become_usable(Badge, HeapBlock&); private: - const size_t m_cell_size; + size_t const m_cell_size; using BlockList = IntrusiveList<&HeapBlock::m_list_node>; BlockList m_full_blocks; BlockList m_usable_blocks; }; +template +class TypeIsolatingCellAllocator { +public: + using CellType = T; + + CellAllocator allocator { sizeof(T) }; +}; + } diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 2883792d51..3889dd9987 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -70,17 +70,7 @@ Heap::~Heap() collect_garbage(CollectionType::CollectEverything); } -ALWAYS_INLINE CellAllocator& Heap::allocator_for_size(size_t cell_size) -{ - for (auto& allocator : m_allocators) { - if (allocator->cell_size() >= cell_size) - return *allocator; - } - dbgln("Cannot get CellAllocator for cell size {}, largest available is {}!", cell_size, m_allocators.last()->cell_size()); - VERIFY_NOT_REACHED(); -} - -Cell* Heap::allocate_cell(size_t size) +void Heap::will_allocate(size_t size) { if (should_collect_on_every_allocation()) { m_allocated_bytes_since_last_gc = 0; @@ -91,8 +81,6 @@ Cell* Heap::allocate_cell(size_t size) } m_allocated_bytes_since_last_gc += size; - auto& allocator = allocator_for_size(size); - return allocator.allocate_cell(*this); } static void add_possible_value(HashMap& possible_pointers, FlatPtr data, HeapRoot origin, FlatPtr min_block_address, FlatPtr max_block_address) diff --git a/Userland/Libraries/LibJS/Heap/Heap.h b/Userland/Libraries/LibJS/Heap/Heap.h index d70c3d93ff..bb2d3facb0 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.h +++ b/Userland/Libraries/LibJS/Heap/Heap.h @@ -38,7 +38,7 @@ public: template NonnullGCPtr allocate_without_realm(Args&&... args) { - auto* memory = allocate_cell(sizeof(T)); + auto* memory = allocate_cell(); defer_gc(); new (memory) T(forward(args)...); undefer_gc(); @@ -48,7 +48,7 @@ public: template NonnullGCPtr allocate(Realm& realm, Args&&... args) { - auto* memory = allocate_cell(sizeof(T)); + auto* memory = allocate_cell(); defer_gc(); new (memory) T(forward(args)...); undefer_gc(); @@ -91,7 +91,19 @@ private: static bool cell_must_survive_garbage_collection(Cell const&); - Cell* allocate_cell(size_t); + template + Cell* allocate_cell() + { + will_allocate(sizeof(T)); + if constexpr (requires { T::cell_allocator.allocate_cell(*this); }) { + if constexpr (IsSame) { + return T::cell_allocator.allocate_cell(*this); + } + } + return allocator_for_size(sizeof(T)).allocate_cell(*this); + } + + void will_allocate(size_t); void find_min_and_max_block_addresses(FlatPtr& min_address, FlatPtr& max_address); void gather_roots(HashMap&); @@ -101,7 +113,16 @@ private: void finalize_unmarked_cells(); void sweep_dead_cells(bool print_report, Core::ElapsedTimer const&); - CellAllocator& allocator_for_size(size_t); + ALWAYS_INLINE CellAllocator& allocator_for_size(size_t cell_size) + { + // FIXME: Use binary search? + for (auto& allocator : m_allocators) { + if (allocator->cell_size() >= cell_size) + return *allocator; + } + dbgln("Cannot get CellAllocator for cell size {}, largest available is {}!", cell_size, m_allocators.last()->cell_size()); + VERIFY_NOT_REACHED(); + } template void for_each_block(Callback callback) diff --git a/Userland/Libraries/LibJS/Module.cpp b/Userland/Libraries/LibJS/Module.cpp index 7190b961d0..4161cbd234 100644 --- a/Userland/Libraries/LibJS/Module.cpp +++ b/Userland/Libraries/LibJS/Module.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Module); + Module::Module(Realm& realm, DeprecatedString filename, Script::HostDefined* host_defined) : m_realm(realm) , m_host_defined(host_defined) diff --git a/Userland/Libraries/LibJS/Module.h b/Userland/Libraries/LibJS/Module.h index c085eafdc8..671e25771c 100644 --- a/Userland/Libraries/LibJS/Module.h +++ b/Userland/Libraries/LibJS/Module.h @@ -58,6 +58,7 @@ struct ResolvedBinding { // 16.2.1.4 Abstract Module Records, https://tc39.es/ecma262/#sec-abstract-module-records class Module : public Cell { JS_CELL(Module, Cell); + JS_DECLARE_ALLOCATOR(Module); public: virtual ~Module() override; diff --git a/Userland/Libraries/LibJS/Runtime/Accessor.cpp b/Userland/Libraries/LibJS/Runtime/Accessor.cpp new file mode 100644 index 0000000000..d76ebea6b0 --- /dev/null +++ b/Userland/Libraries/LibJS/Runtime/Accessor.cpp @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2023, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +namespace JS { + +JS_DEFINE_ALLOCATOR(Accessor); + +} diff --git a/Userland/Libraries/LibJS/Runtime/Accessor.h b/Userland/Libraries/LibJS/Runtime/Accessor.h index 52fbaf8e51..51a7cacdce 100644 --- a/Userland/Libraries/LibJS/Runtime/Accessor.h +++ b/Userland/Libraries/LibJS/Runtime/Accessor.h @@ -15,6 +15,7 @@ namespace JS { class Accessor final : public Cell { JS_CELL(Accessor, Cell); + JS_DECLARE_ALLOCATOR(Accessor); public: static NonnullGCPtr create(VM& vm, FunctionObject* getter, FunctionObject* setter) diff --git a/Userland/Libraries/LibJS/Runtime/AggregateError.cpp b/Userland/Libraries/LibJS/Runtime/AggregateError.cpp index b1b55bdbf4..1ad94ba7f5 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateError.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateError.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AggregateError); + NonnullGCPtr AggregateError::create(Realm& realm) { return realm.heap().allocate(realm, realm.intrinsics().aggregate_error_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/AggregateError.h b/Userland/Libraries/LibJS/Runtime/AggregateError.h index 6b295287e1..9d68d74813 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateError.h +++ b/Userland/Libraries/LibJS/Runtime/AggregateError.h @@ -13,6 +13,7 @@ namespace JS { class AggregateError : public Error { JS_OBJECT(AggregateError, Error); + JS_DECLARE_ALLOCATOR(AggregateError); public: static NonnullGCPtr create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp index fa13c71cce..3709b3ed17 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AggregateErrorConstructor); + AggregateErrorConstructor::AggregateErrorConstructor(Realm& realm) : NativeFunction(static_cast(*realm.intrinsics().error_constructor())) { diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h index ee146040ab..62229bdd4b 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h @@ -12,6 +12,7 @@ namespace JS { class AggregateErrorConstructor final : public NativeFunction { JS_OBJECT(AggregateErrorConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(AggregateErrorConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp index 488c5b8cc5..f69bfbfa63 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AggregateErrorPrototype); + AggregateErrorPrototype::AggregateErrorPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().error_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h index 420a0864f0..83a307b64e 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h @@ -12,6 +12,7 @@ namespace JS { class AggregateErrorPrototype final : public Object { JS_OBJECT(AggregateErrorPrototype, Object); + JS_DECLARE_ALLOCATOR(AggregateErrorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp index 49eb944a63..8183c3d2d4 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArgumentsObject); + ArgumentsObject::ArgumentsObject(Realm& realm, Environment& environment) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype(), MayInterfereWithIndexedPropertyAccess::Yes) , m_environment(environment) diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h index ebb70e4486..261b5d7c27 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h @@ -14,6 +14,7 @@ namespace JS { class ArgumentsObject final : public Object { JS_OBJECT(ArgumentsObject, Object); + JS_DECLARE_ALLOCATOR(ArgumentsObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Array.cpp b/Userland/Libraries/LibJS/Runtime/Array.cpp index 7fc55f9aed..2222935c4a 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.cpp +++ b/Userland/Libraries/LibJS/Runtime/Array.cpp @@ -17,6 +17,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Array); + // 10.4.2.2 ArrayCreate ( length [ , proto ] ), https://tc39.es/ecma262/#sec-arraycreate ThrowCompletionOr> Array::create(Realm& realm, u64 length, Object* prototype) { diff --git a/Userland/Libraries/LibJS/Runtime/Array.h b/Userland/Libraries/LibJS/Runtime/Array.h index 9da03e401e..8197c489e7 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.h +++ b/Userland/Libraries/LibJS/Runtime/Array.h @@ -21,6 +21,7 @@ namespace JS { class Array : public Object { JS_OBJECT(Array, Object); + JS_DECLARE_ALLOCATOR(Array); public: static ThrowCompletionOr> create(Realm&, u64 length, Object* prototype = nullptr); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp index 3d12c26bd3..f1bced4788 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayBuffer); + ThrowCompletionOr> ArrayBuffer::create(Realm& realm, size_t byte_length) { auto buffer = ByteBuffer::create_zeroed(byte_length); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h index a037660b26..80a7077ea1 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h @@ -48,6 +48,7 @@ struct DataBlock { class ArrayBuffer : public Object { JS_OBJECT(ArrayBuffer, Object); + JS_DECLARE_ALLOCATOR(ArrayBuffer); public: static ThrowCompletionOr> create(Realm&, size_t); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp index ca09ebdbec..1fa1fc3d0d 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayBufferConstructor); + ArrayBufferConstructor::ArrayBufferConstructor(Realm& realm) : NativeFunction(realm.vm().names.ArrayBuffer.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h index 60a4fb82a7..041fb1360c 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h @@ -12,6 +12,7 @@ namespace JS { class ArrayBufferConstructor final : public NativeFunction { JS_OBJECT(ArrayBufferConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ArrayBufferConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp index 567026973f..34d5911076 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayBufferPrototype); + ArrayBufferPrototype::ArrayBufferPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h index d3eb4bf348..d624e894e8 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h @@ -13,6 +13,7 @@ namespace JS { class ArrayBufferPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ArrayBufferPrototype, ArrayBuffer, ArrayBuffer); + JS_DECLARE_ALLOCATOR(ArrayBufferPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp index c86c65c43e..4eeba5b47f 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp @@ -22,6 +22,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayConstructor); + ArrayConstructor::ArrayConstructor(Realm& realm) : NativeFunction(realm.vm().names.Array.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h index 6745773551..e76a7f6399 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h @@ -12,6 +12,7 @@ namespace JS { class ArrayConstructor final : public NativeFunction { JS_OBJECT(ArrayConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ArrayConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp index e2d5ac9980..fa58eef5c5 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayIterator); + NonnullGCPtr ArrayIterator::create(Realm& realm, Value array, Object::PropertyKind iteration_kind) { return realm.heap().allocate(realm, array, iteration_kind, realm.intrinsics().array_iterator_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIterator.h b/Userland/Libraries/LibJS/Runtime/ArrayIterator.h index 7bee8031ad..47575633e2 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIterator.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayIterator.h @@ -12,6 +12,7 @@ namespace JS { class ArrayIterator final : public Object { JS_OBJECT(ArrayIterator, Object); + JS_DECLARE_ALLOCATOR(ArrayIterator); public: static NonnullGCPtr create(Realm&, Value array, Object::PropertyKind iteration_kind); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp index 75efd03c35..3dcc9ada4d 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayIteratorPrototype); + ArrayIteratorPrototype::ArrayIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h index 25c53bdcec..34e2c22e7e 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h @@ -13,6 +13,7 @@ namespace JS { class ArrayIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ArrayIteratorPrototype, ArrayIterator, ArrayIterator); + JS_DECLARE_ALLOCATOR(ArrayIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index 392fa47d3f..86d9a6ae22 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -27,6 +27,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ArrayPrototype); + static HashTable> s_array_join_seen_objects; ArrayPrototype::ArrayPrototype(Realm& realm) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h index 1b29a08b5a..552d99cc5c 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h @@ -13,6 +13,7 @@ namespace JS { class ArrayPrototype final : public Array { JS_OBJECT(ArrayPrototype, Array); + JS_DECLARE_ALLOCATOR(ArrayPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp index ab18c3ce70..d226c2baad 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncFromSyncIterator); + NonnullGCPtr AsyncFromSyncIterator::create(Realm& realm, IteratorRecord sync_iterator_record) { return realm.heap().allocate(realm, realm, sync_iterator_record); diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h index 9b827a976a..4088fd07c7 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h @@ -15,6 +15,7 @@ namespace JS { // 27.1.4.3 Properties of Async-from-Sync Iterator Instances, https://tc39.es/ecma262/#sec-properties-of-async-from-sync-iterator-instances class AsyncFromSyncIterator final : public Object { JS_OBJECT(AsyncFromSyncIterator, Object); + JS_DECLARE_ALLOCATOR(AsyncFromSyncIterator); public: static NonnullGCPtr create(Realm&, IteratorRecord sync_iterator_record); diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp index 569f15c474..0ce3388170 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DECLARE_ALLOCATOR(AsyncFromSyncIteratorPrototype); + AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().async_iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h index aacc5bd8c3..3eb60afe84 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h @@ -17,6 +17,7 @@ namespace JS { // 27.1.4.2 The %AsyncFromSyncIteratorPrototype% Object, https://tc39.es/ecma262/#sec-%asyncfromsynciteratorprototype%-object class AsyncFromSyncIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(AsyncFromSyncIteratorPrototype, AsyncFromSyncIterator, AsyncFromSyncIterator); + JS_DECLARE_ALLOCATOR(AsyncFromSyncIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp index 656d4837aa..5eecb34fa3 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncFunctionConstructor); + AsyncFunctionConstructor::AsyncFunctionConstructor(Realm& realm) : NativeFunction(realm.vm().names.AsyncFunction.as_string(), realm.intrinsics().function_constructor()) { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h index cf11753202..4a3795d029 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h @@ -12,6 +12,7 @@ namespace JS { class AsyncFunctionConstructor final : public NativeFunction { JS_OBJECT(AsyncFunctionConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(AsyncFunctionConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp index fe9b8553a6..5486b94422 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncFunctionDriverWrapper); + NonnullGCPtr AsyncFunctionDriverWrapper::create(Realm& realm, GeneratorObject* generator_object) { auto top_level_promise = Promise::create(realm); diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.h b/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.h index 5ddcd86ec0..fe7a9d7d5b 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionDriverWrapper.h @@ -16,6 +16,7 @@ namespace JS { class AsyncFunctionDriverWrapper final : public Promise { JS_OBJECT(AsyncFunctionDriverWrapper, Promise); + JS_DECLARE_ALLOCATOR(AsyncFunctionDriverWrapper); public: enum class IsInitialExecution { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp index 6ca69d3327..8b98fd144b 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncFunctionPrototype); + AsyncFunctionPrototype::AsyncFunctionPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h index 44a532f8bc..4bec053fbf 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h @@ -12,6 +12,7 @@ namespace JS { class AsyncFunctionPrototype final : public Object { JS_OBJECT(AsyncFunctionPrototype, Object); + JS_DECLARE_ALLOCATOR(AsyncFunctionPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp index 4d1f673ce6..8ee7a38a71 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGenerator.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncGenerator); + ThrowCompletionOr> AsyncGenerator::create(Realm& realm, Value initial_value, ECMAScriptFunctionObject* generating_function, ExecutionContext execution_context, Bytecode::CallFrame frame) { auto& vm = realm.vm(); diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGenerator.h b/Userland/Libraries/LibJS/Runtime/AsyncGenerator.h index 51ed6ab20e..46268d6347 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGenerator.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGenerator.h @@ -17,6 +17,7 @@ namespace JS { // 27.6.2 Properties of AsyncGenerator Instances, https://tc39.es/ecma262/#sec-properties-of-asyncgenerator-intances class AsyncGenerator final : public Object { JS_OBJECT(AsyncGenerator, Object); + JS_DECLARE_ALLOCATOR(AsyncGenerator); public: enum class State { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp index 6e3ba3849b..1051184b65 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncGeneratorFunctionConstructor); + AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor(Realm& realm) : NativeFunction(realm.vm().names.AsyncGeneratorFunction.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h index 0b1a4e26d2..351520ace8 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h @@ -12,6 +12,7 @@ namespace JS { class AsyncGeneratorFunctionConstructor final : public NativeFunction { JS_OBJECT(AsyncGeneratorFunctionConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(AsyncGeneratorFunctionConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp index 83bb2b1981..f56da2e4e3 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncGeneratorFunctionPrototype); + AsyncGeneratorFunctionPrototype::AsyncGeneratorFunctionPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h index 602a947d94..209fd76dff 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h @@ -12,6 +12,7 @@ namespace JS { class AsyncGeneratorFunctionPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(AsyncGeneratorFunctionPrototype, AsyncGeneratorFunction, AsyncGeneratorFunction); + JS_DECLARE_ALLOCATOR(AsyncGeneratorFunctionPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp index 174ff51c91..de1f81c916 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncGeneratorPrototype); + // 27.6.1 Properties of the AsyncGenerator Prototype Object, https://tc39.es/ecma262/#sec-properties-of-asyncgenerator-prototype AsyncGeneratorPrototype::AsyncGeneratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().async_iterator_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h index 03ab34fe35..a231e72358 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h @@ -14,6 +14,7 @@ namespace JS { class AsyncGeneratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(AsyncGeneratorPrototype, AsyncGenerator, AsyncGenerator) + JS_DECLARE_ALLOCATOR(AsyncGeneratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp index f5600a9cf1..ead650764e 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AsyncIteratorPrototype); + AsyncIteratorPrototype::AsyncIteratorPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h index 07f2f962aa..4a08ff249e 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h @@ -12,6 +12,7 @@ namespace JS { class AsyncIteratorPrototype final : public Object { JS_OBJECT(AsyncIteratorPrototype, Object) + JS_DECLARE_ALLOCATOR(AsyncIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp index d8d1682996..80f271065a 100644 --- a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp @@ -23,6 +23,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AtomicsObject); + // 25.4.2.1 ValidateIntegerTypedArray ( typedArray [ , waitable ] ), https://tc39.es/ecma262/#sec-validateintegertypedarray static ThrowCompletionOr validate_integer_typed_array(VM& vm, TypedArrayBase& typed_array, bool waitable = false) { diff --git a/Userland/Libraries/LibJS/Runtime/AtomicsObject.h b/Userland/Libraries/LibJS/Runtime/AtomicsObject.h index 1e245d8590..10d1763b70 100644 --- a/Userland/Libraries/LibJS/Runtime/AtomicsObject.h +++ b/Userland/Libraries/LibJS/Runtime/AtomicsObject.h @@ -12,6 +12,7 @@ namespace JS { class AtomicsObject : public Object { JS_OBJECT(AtomicsObject, Object); + JS_DECLARE_ALLOCATOR(AtomicsObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/BigInt.cpp b/Userland/Libraries/LibJS/Runtime/BigInt.cpp index 6cf4306c6c..9026b0d0a5 100644 --- a/Userland/Libraries/LibJS/Runtime/BigInt.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigInt.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BigInt); + NonnullGCPtr BigInt::create(VM& vm, Crypto::SignedBigInteger big_integer) { return vm.heap().allocate_without_realm(move(big_integer)); diff --git a/Userland/Libraries/LibJS/Runtime/BigInt.h b/Userland/Libraries/LibJS/Runtime/BigInt.h index bb937a71e4..8d1598fcd7 100644 --- a/Userland/Libraries/LibJS/Runtime/BigInt.h +++ b/Userland/Libraries/LibJS/Runtime/BigInt.h @@ -11,11 +11,13 @@ #include #include #include +#include namespace JS { class BigInt final : public Cell { JS_CELL(BigInt, Cell); + JS_DECLARE_ALLOCATOR(BigInt); public: [[nodiscard]] static NonnullGCPtr create(VM&, Crypto::SignedBigInteger); diff --git a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp index 58c83a4002..6284f7a475 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BigIntConstructor); + static const Crypto::SignedBigInteger BIGINT_ONE { 1 }; BigIntConstructor::BigIntConstructor(Realm& realm) diff --git a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h index 59335e3318..0dd08537f5 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h @@ -12,6 +12,7 @@ namespace JS { class BigIntConstructor final : public NativeFunction { JS_OBJECT(BigIntConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(BigIntConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/BigIntObject.cpp b/Userland/Libraries/LibJS/Runtime/BigIntObject.cpp index c0e7b73934..233e0c7329 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntObject.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BigIntObject); + NonnullGCPtr BigIntObject::create(Realm& realm, BigInt& bigint) { return realm.heap().allocate(realm, bigint, realm.intrinsics().bigint_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/BigIntObject.h b/Userland/Libraries/LibJS/Runtime/BigIntObject.h index 3dcf808c63..d0d0b23280 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntObject.h +++ b/Userland/Libraries/LibJS/Runtime/BigIntObject.h @@ -13,6 +13,7 @@ namespace JS { class BigIntObject final : public Object { JS_OBJECT(BigIntObject, Object); + JS_DECLARE_ALLOCATOR(BigIntObject); public: static NonnullGCPtr create(Realm&, BigInt&); diff --git a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp index c96a865f21..32ff899648 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp @@ -17,6 +17,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BigIntPrototype); + BigIntPrototype::BigIntPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h index ca95f9684b..b6f87390ba 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h @@ -12,6 +12,7 @@ namespace JS { class BigIntPrototype final : public Object { JS_OBJECT(BigIntPrototype, Object); + JS_DECLARE_ALLOCATOR(BigIntPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp index 14f32fc237..3ce42d580d 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BooleanConstructor); + BooleanConstructor::BooleanConstructor(Realm& realm) : NativeFunction(realm.vm().names.Boolean.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h index 3520b64a1d..3cd4be965c 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h @@ -12,6 +12,7 @@ namespace JS { class BooleanConstructor final : public NativeFunction { JS_OBJECT(BooleanConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(BooleanConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/BooleanObject.cpp b/Userland/Libraries/LibJS/Runtime/BooleanObject.cpp index 37d9f0ca80..a357c94c06 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanObject.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BooleanObject); + NonnullGCPtr BooleanObject::create(Realm& realm, bool value) { return realm.heap().allocate(realm, value, realm.intrinsics().boolean_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/BooleanObject.h b/Userland/Libraries/LibJS/Runtime/BooleanObject.h index 9fddd976f2..609d3d2c9f 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanObject.h +++ b/Userland/Libraries/LibJS/Runtime/BooleanObject.h @@ -12,6 +12,7 @@ namespace JS { class BooleanObject : public Object { JS_OBJECT(BooleanObject, Object); + JS_DECLARE_ALLOCATOR(BooleanObject); public: static NonnullGCPtr create(Realm&, bool); diff --git a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp index 0d3e1c715e..6729f38e29 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BooleanPrototype); + BooleanPrototype::BooleanPrototype(Realm& realm) : BooleanObject(false, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h index 83af2e841d..0db725dd2c 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h @@ -12,6 +12,7 @@ namespace JS { class BooleanPrototype final : public BooleanObject { JS_OBJECT(BooleanPrototype, BooleanObject); + JS_DECLARE_ALLOCATOR(BooleanPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp b/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp index 82e34d745f..1628b4d0ae 100644 --- a/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(BoundFunction); + // 10.4.1.3 BoundFunctionCreate ( targetFunction, boundThis, boundArgs ), https://tc39.es/ecma262/#sec-boundfunctioncreate ThrowCompletionOr> BoundFunction::create(Realm& realm, FunctionObject& target_function, Value bound_this, Vector bound_arguments) { diff --git a/Userland/Libraries/LibJS/Runtime/BoundFunction.h b/Userland/Libraries/LibJS/Runtime/BoundFunction.h index 0e9fbf3675..c85c6f1876 100644 --- a/Userland/Libraries/LibJS/Runtime/BoundFunction.h +++ b/Userland/Libraries/LibJS/Runtime/BoundFunction.h @@ -13,6 +13,7 @@ namespace JS { class BoundFunction final : public FunctionObject { JS_OBJECT(BoundFunction, FunctionObject); + JS_DECLARE_ALLOCATOR(BoundFunction); public: static ThrowCompletionOr> create(Realm&, FunctionObject& target_function, Value bound_this, Vector bound_arguments); diff --git a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp index 681ded39a1..20806c9aad 100644 --- a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ConsoleObject); + ConsoleObject::ConsoleObject(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) , m_console(make(realm)) diff --git a/Userland/Libraries/LibJS/Runtime/ConsoleObject.h b/Userland/Libraries/LibJS/Runtime/ConsoleObject.h index 29b2cadb36..d970b7c27e 100644 --- a/Userland/Libraries/LibJS/Runtime/ConsoleObject.h +++ b/Userland/Libraries/LibJS/Runtime/ConsoleObject.h @@ -12,6 +12,7 @@ namespace JS { class ConsoleObject final : public Object { JS_OBJECT(ConsoleObject, Object); + JS_DECLARE_ALLOCATOR(ConsoleObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/DataView.cpp b/Userland/Libraries/LibJS/Runtime/DataView.cpp index 905e553772..0535a08cd3 100644 --- a/Userland/Libraries/LibJS/Runtime/DataView.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataView.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DataView); + NonnullGCPtr DataView::create(Realm& realm, ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset) { return realm.heap().allocate(realm, viewed_buffer, byte_length, byte_offset, realm.intrinsics().data_view_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/DataView.h b/Userland/Libraries/LibJS/Runtime/DataView.h index 920cd4be2e..e97ab5eb0c 100644 --- a/Userland/Libraries/LibJS/Runtime/DataView.h +++ b/Userland/Libraries/LibJS/Runtime/DataView.h @@ -14,6 +14,7 @@ namespace JS { class DataView : public Object { JS_OBJECT(DataView, Object); + JS_DECLARE_ALLOCATOR(DataView); public: static NonnullGCPtr create(Realm&, ArrayBuffer*, size_t byte_length, size_t byte_offset); diff --git a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp index 176faf2a58..891f188999 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DataViewConstructor); + DataViewConstructor::DataViewConstructor(Realm& realm) : NativeFunction(realm.vm().names.DataView.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h index 632c4e0e86..81cd43688a 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h @@ -12,6 +12,7 @@ namespace JS { class DataViewConstructor final : public NativeFunction { JS_OBJECT(DataViewConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DataViewConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp index 5a8c0c1609..3d8263d5ed 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DataViewPrototype); + DataViewPrototype::DataViewPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h index 7138918922..3173ab7a80 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h @@ -13,6 +13,7 @@ namespace JS { class DataViewPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DataViewPrototype, DataView, DataView); + JS_DECLARE_ALLOCATOR(DataViewPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Date.cpp b/Userland/Libraries/LibJS/Runtime/Date.cpp index 8d8ddc8824..2836b8ec43 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.cpp +++ b/Userland/Libraries/LibJS/Runtime/Date.cpp @@ -17,6 +17,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Date); + static Crypto::SignedBigInteger const s_one_billion_bigint { 1'000'000'000 }; static Crypto::SignedBigInteger const s_one_million_bigint { 1'000'000 }; static Crypto::SignedBigInteger const s_one_thousand_bigint { 1'000 }; diff --git a/Userland/Libraries/LibJS/Runtime/Date.h b/Userland/Libraries/LibJS/Runtime/Date.h index c25543b3a4..5f7d64e32e 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.h +++ b/Userland/Libraries/LibJS/Runtime/Date.h @@ -14,6 +14,7 @@ namespace JS { class Date final : public Object { JS_OBJECT(Date, Object); + JS_DECLARE_ALLOCATOR(Date); public: static NonnullGCPtr create(Realm&, double date_value); diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index 4fb41013e5..6b7cd9fd59 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -23,6 +23,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DateConstructor); + // 21.4.3.2 Date.parse ( string ), https://tc39.es/ecma262/#sec-date.parse static double parse_simplified_iso8601(DeprecatedString const& iso_8601) { diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.h b/Userland/Libraries/LibJS/Runtime/DateConstructor.h index 7e66408ffa..5b9ef47efd 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.h @@ -12,6 +12,7 @@ namespace JS { class DateConstructor final : public NativeFunction { JS_OBJECT(DateConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DateConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp index b94201894c..19783b9963 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp @@ -30,6 +30,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DatePrototype); + DatePrototype::DatePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.h b/Userland/Libraries/LibJS/Runtime/DatePrototype.h index c54223ccff..8b4bb40599 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.h @@ -13,6 +13,7 @@ namespace JS { class DatePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DatePrototype, Date, Date); + JS_DECLARE_ALLOCATOR(DatePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp index 22cb022e27..b972e9f7de 100644 --- a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DeclarativeEnvironment); + DeclarativeEnvironment* DeclarativeEnvironment::create_for_per_iteration_bindings(Badge, DeclarativeEnvironment& other, size_t bindings_size) { auto bindings = other.m_bindings.span().slice(0, bindings_size); diff --git a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h index a378371ea8..dc89bb11dd 100644 --- a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h @@ -17,6 +17,7 @@ namespace JS { class DeclarativeEnvironment : public Environment { JS_ENVIRONMENT(DeclarativeEnvironment, Environment); + JS_DECLARE_ALLOCATOR(DeclarativeEnvironment); struct Binding { static FlatPtr value_offset() { return OFFSET_OF(Binding, value); } diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStack.cpp b/Userland/Libraries/LibJS/Runtime/DisposableStack.cpp index e54ad354b0..62fe33d165 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStack.cpp +++ b/Userland/Libraries/LibJS/Runtime/DisposableStack.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DisposableStack); + DisposableStack::DisposableStack(Vector stack, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) , m_disposable_resource_stack(move(stack)) diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStack.h b/Userland/Libraries/LibJS/Runtime/DisposableStack.h index 77b846f559..36af8e047d 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStack.h +++ b/Userland/Libraries/LibJS/Runtime/DisposableStack.h @@ -13,6 +13,7 @@ namespace JS { class DisposableStack final : public Object { JS_OBJECT(DisposableStack, Object); + JS_DECLARE_ALLOCATOR(DisposableStack); public: virtual ~DisposableStack() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp index 8e2c4fad0e..7b9b06aaa7 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DisposableStackConstructor); + DisposableStackConstructor::DisposableStackConstructor(Realm& realm) : NativeFunction(realm.vm().names.DisposableStack.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h index b512657a36..6a190c2011 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h @@ -12,6 +12,7 @@ namespace JS { class DisposableStackConstructor final : public NativeFunction { JS_OBJECT(DisposableStackConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DisposableStackConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp index 15e0896926..d6a6ead81d 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(DisposableStackPrototype); + DisposableStackPrototype::DisposableStackPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h index 6b093a12aa..158674f987 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h @@ -13,6 +13,7 @@ namespace JS { class DisposableStackPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DisposableStackPrototype, DisposableStack, DisposableStack); + JS_DECLARE_ALLOCATOR(DisposableStackPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index 808c6b456f..e50d7b9045 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -31,6 +31,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ECMAScriptFunctionObject); + NonnullGCPtr ECMAScriptFunctionObject::create(Realm& realm, DeprecatedFlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant class_field_initializer_name) { Object* prototype = nullptr; diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h index 78ade0b336..21184d8e20 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h @@ -24,6 +24,7 @@ void async_function_start(VM&, PromiseCapability const&, T const& async_function // 10.2 ECMAScript Function Objects, https://tc39.es/ecma262/#sec-ecmascript-function-objects class ECMAScriptFunctionObject final : public FunctionObject { JS_OBJECT(ECMAScriptFunctionObject, FunctionObject); + JS_DECLARE_ALLOCATOR(ECMAScriptFunctionObject); public: enum class ConstructorKind : u8 { diff --git a/Userland/Libraries/LibJS/Runtime/Error.cpp b/Userland/Libraries/LibJS/Runtime/Error.cpp index fb7f6c6bf6..e01cc47d2b 100644 --- a/Userland/Libraries/LibJS/Runtime/Error.cpp +++ b/Userland/Libraries/LibJS/Runtime/Error.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Error); + SourceRange const& TracebackFrame::source_range() const { if (auto* unrealized = source_range_storage.get_pointer()) { @@ -156,6 +158,7 @@ String Error::stack_string(CompactTraceback compact) const } #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ + JS_DEFINE_ALLOCATOR(ClassName); \ NonnullGCPtr ClassName::create(Realm& realm) \ { \ return realm.heap().allocate(realm, realm.intrinsics().snake_name##_prototype()); \ diff --git a/Userland/Libraries/LibJS/Runtime/Error.h b/Userland/Libraries/LibJS/Runtime/Error.h index 54a808c304..fd99bbff13 100644 --- a/Userland/Libraries/LibJS/Runtime/Error.h +++ b/Userland/Libraries/LibJS/Runtime/Error.h @@ -29,6 +29,7 @@ enum CompactTraceback { class Error : public Object { JS_OBJECT(Error, Object); + JS_DECLARE_ALLOCATOR(Error); public: static NonnullGCPtr create(Realm&); @@ -57,6 +58,7 @@ private: #define DECLARE_NATIVE_ERROR(ClassName, snake_name, PrototypeName, ConstructorName) \ class ClassName final : public Error { \ JS_OBJECT(ClassName, Error); \ + JS_DECLARE_ALLOCATOR(ClassName); \ \ public: \ static NonnullGCPtr create(Realm&); \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp index 43c0bf50e3..8b7786720a 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ErrorConstructor); + ErrorConstructor::ErrorConstructor(Realm& realm) : NativeFunction(realm.vm().names.Error.as_string(), realm.intrinsics().function_prototype()) { @@ -62,6 +64,7 @@ ThrowCompletionOr> ErrorConstructor::construct(FunctionObje } #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ + JS_DEFINE_ALLOCATOR(ConstructorName); \ ConstructorName::ConstructorName(Realm& realm) \ : NativeFunction(realm.vm().names.ClassName.as_string(), realm.intrinsics().error_constructor()) \ { \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h index 2bc6996308..29fbf37bc2 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h @@ -13,6 +13,7 @@ namespace JS { class ErrorConstructor final : public NativeFunction { JS_OBJECT(ErrorConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ErrorConstructor); public: virtual void initialize(Realm&) override; @@ -30,6 +31,7 @@ private: #define DECLARE_NATIVE_ERROR_CONSTRUCTOR(ClassName, snake_name, PrototypeName, ConstructorName) \ class ConstructorName final : public NativeFunction { \ JS_OBJECT(ConstructorName, NativeFunction); \ + JS_DECLARE_ALLOCATOR(ConstructorName); \ \ public: \ virtual void initialize(Realm&) override; \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp index fd5828c3b3..9d5d4d7ce7 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ErrorPrototype); + ErrorPrototype::ErrorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h index 7be8d62fa4..aa8a06c9aa 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h @@ -14,6 +14,7 @@ namespace JS { class ErrorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ErrorPrototype, Error, Error); + JS_DECLARE_ALLOCATOR(ErrorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp index ef7fda2010..fb17233017 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(FinalizationRegistry); + FinalizationRegistry::FinalizationRegistry(Realm& realm, JobCallback cleanup_callback, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) , WeakContainer(heap()) diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h index 53fc1c1638..fa02702739 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h @@ -21,6 +21,7 @@ class FinalizationRegistry final : public Object , public WeakContainer { JS_OBJECT(FinalizationRegistry, Object); + JS_DECLARE_ALLOCATOR(FinalizationRegistry); public: virtual ~FinalizationRegistry() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp index f3beec5b00..c679a78ec5 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(FinalizationRegistryConstructor); + FinalizationRegistryConstructor::FinalizationRegistryConstructor(Realm& realm) : NativeFunction(realm.vm().names.FinalizationRegistry.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h index a93a1c2315..7ec4a3a22c 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h @@ -12,6 +12,7 @@ namespace JS { class FinalizationRegistryConstructor final : public NativeFunction { JS_OBJECT(FinalizationRegistryConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(FinalizationRegistryConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp index 5b78571f20..792a5856ed 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(FinalizationRegistryPrototype); + FinalizationRegistryPrototype::FinalizationRegistryPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h index a63e759ca7..ba6dd01e65 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h @@ -13,6 +13,7 @@ namespace JS { class FinalizationRegistryPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(FinalizationRegistryPrototype, FinalizationRegistry, FinalizationRegistry); + JS_DECLARE_ALLOCATOR(FinalizationRegistryPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp index 05fef5bf3a..506bc5798e 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp @@ -18,6 +18,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(FunctionConstructor); + FunctionConstructor::FunctionConstructor(Realm& realm) : NativeFunction(realm.vm().names.Function.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h index 1cf6ad0613..9d3ce488af 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h @@ -13,6 +13,7 @@ namespace JS { class FunctionConstructor final : public NativeFunction { JS_OBJECT(FunctionConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(FunctionConstructor); public: static ThrowCompletionOr create_dynamic_function(VM&, FunctionObject& constructor, FunctionObject* new_target, FunctionKind kind, MarkedVector const& args); diff --git a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp index 8bd49a791e..756e293189 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(FunctionEnvironment); + FunctionEnvironment::FunctionEnvironment(Environment* parent_environment) : DeclarativeEnvironment(parent_environment) { diff --git a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.h b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.h index 4baab41344..5bf51f166a 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.h @@ -13,6 +13,7 @@ namespace JS { class FunctionEnvironment final : public DeclarativeEnvironment { JS_ENVIRONMENT(FunctionEnvironment, DeclarativeEnvironment); + JS_DECLARE_ALLOCATOR(FunctionEnvironment); public: enum class ThisBindingStatus : u8 { diff --git a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp index f8d35f69ff..f5d17a883e 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp @@ -19,6 +19,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(FunctionPrototype); + FunctionPrototype::FunctionPrototype(Realm& realm) : FunctionObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h index 77919d5abc..ea1378b706 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h @@ -12,6 +12,7 @@ namespace JS { class FunctionPrototype final : public FunctionObject { JS_OBJECT(FunctionPrototype, FunctionObject); + JS_DECLARE_ALLOCATOR(FunctionPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp index 289b90e527..a66f8b5c78 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(GeneratorFunctionConstructor); + GeneratorFunctionConstructor::GeneratorFunctionConstructor(Realm& realm) : NativeFunction(static_cast(realm.intrinsics().function_constructor())) { diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h index f73ef9e0d8..69afe6ebc8 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h @@ -13,6 +13,7 @@ namespace JS { // 27.3.1 %GeneratorFunction%, https://tc39.es/ecma262/#sec-generatorfunction-constructor class GeneratorFunctionConstructor final : public NativeFunction { JS_OBJECT(GeneratorFunctionConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(GeneratorFunctionConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp index b8a64c79ce..c85d4154f6 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(GeneratorFunctionPrototype); + GeneratorFunctionPrototype::GeneratorFunctionPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h index 84c3483458..ecff00d209 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h @@ -14,6 +14,7 @@ namespace JS { // 27.3.3 %GeneratorFunction.prototype%, https://tc39.es/ecma262/#sec-properties-of-the-generatorfunction-prototype-object class GeneratorFunctionPrototype final : public Object { JS_OBJECT(GeneratorFunctionPrototype, Object); + JS_DECLARE_ALLOCATOR(GeneratorFunctionPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp index 1d5022fe71..3f1cd97653 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(GeneratorObject); + ThrowCompletionOr> GeneratorObject::create(Realm& realm, Value initial_value, ECMAScriptFunctionObject* generating_function, ExecutionContext execution_context, Bytecode::CallFrame frame) { auto& vm = realm.vm(); diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorObject.h b/Userland/Libraries/LibJS/Runtime/GeneratorObject.h index bfbadddec0..722b3c4c87 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorObject.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorObject.h @@ -14,6 +14,7 @@ namespace JS { class GeneratorObject : public Object { JS_OBJECT(GeneratorObject, Object); + JS_DECLARE_ALLOCATOR(GeneratorObject); public: static ThrowCompletionOr> create(Realm&, Value, ECMAScriptFunctionObject*, ExecutionContext, Bytecode::CallFrame); diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp index 835d46c380..7637469b97 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(GeneratorPrototype); + GeneratorPrototype::GeneratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h index 079e76c5ca..fd72f2243d 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h @@ -14,6 +14,7 @@ namespace JS { // 27.5.1 Properties of the Generator Prototype Object, https://tc39.es/ecma262/#sec-properties-of-generator-prototype class GeneratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(GeneratorPrototype, GeneratorObject, Generator); + JS_DECLARE_ALLOCATOR(GeneratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp index 08e6a2edcf..c0d5512bc6 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(GlobalEnvironment); + // 9.1.2.5 NewGlobalEnvironment ( G, thisValue ), https://tc39.es/ecma262/#sec-newglobalenvironment GlobalEnvironment::GlobalEnvironment(Object& global_object, Object& this_value) : Environment(nullptr) diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h index ea0b770702..634f8a2f48 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h @@ -12,6 +12,7 @@ namespace JS { class GlobalEnvironment final : public Environment { JS_ENVIRONMENT(GlobalEnvironment, Environment); + JS_DECLARE_ALLOCATOR(GlobalEnvironment); public: virtual bool has_this_binding() const final { return true; } diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 476d19165e..8a51164cb2 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -87,6 +87,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(GlobalObject); + GlobalObject::GlobalObject(Realm& realm) : Object(GlobalObjectTag::Tag, realm) { diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index c40a1f8296..00c499ae5d 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -15,6 +15,7 @@ namespace JS { class GlobalObject : public Object { JS_OBJECT(GlobalObject, Object); + JS_DECLARE_ALLOCATOR(GlobalObject); friend class Intrinsics; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Collator.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Collator.cpp index fa2355888d..175e629b5b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Collator.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Collator.cpp @@ -8,6 +8,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(Collator); + // 10 Collator Objects, https://tc39.es/ecma402/#collator-objects Collator::Collator(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Collator.h b/Userland/Libraries/LibJS/Runtime/Intl/Collator.h index 1a1d090e21..207f883054 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Collator.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Collator.h @@ -16,6 +16,7 @@ namespace JS::Intl { class Collator final : public Object { JS_OBJECT(Collator, Object); + JS_DECLARE_ALLOCATOR(Collator); public: enum class Usage { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp index 52ed7123a6..faae88b4b6 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp @@ -11,6 +11,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(CollatorCompareFunction); + NonnullGCPtr CollatorCompareFunction::create(Realm& realm, Collator& collator) { return realm.heap().allocate(realm, realm, collator); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h index d01d9ae1c3..8997584228 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h @@ -12,6 +12,7 @@ namespace JS::Intl { class CollatorCompareFunction : public NativeFunction { JS_OBJECT(CollatorCompareFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(CollatorCompareFunction); public: static NonnullGCPtr create(Realm&, Collator&); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp index fa289491f0..bf0f6b625b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(CollatorConstructor); + // 10.1.2 InitializeCollator ( collator, locales, options ), https://tc39.es/ecma402/#sec-initializecollator static ThrowCompletionOr> initialize_collator(VM& vm, Collator& collator, Value locales_value, Value options_value) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h index 19ade8f457..0c0e91ce03 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class CollatorConstructor final : public NativeFunction { JS_OBJECT(CollatorConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(CollatorConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp index 59eb176d31..22116ffdee 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp @@ -11,6 +11,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(CollatorPrototype); + // 10.3 Properties of the Intl.Collator Prototype Object, https://tc39.es/ecma402/#sec-properties-of-the-intl-collator-prototype-object CollatorPrototype::CollatorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h index f65e6d2f77..8f8a6a3dcd 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class CollatorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(CollatorPrototype, Collator, Collator); + JS_DECLARE_ALLOCATOR(CollatorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp index d3719a3cd8..d163caa96d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp @@ -24,6 +24,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DateTimeFormat); + static Crypto::SignedBigInteger const s_one_million_bigint { 1'000'000 }; // 11 DateTimeFormat Objects, https://tc39.es/ecma402/#datetimeformat-objects diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.h index 44721d0f80..395cab19db 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.h @@ -23,6 +23,7 @@ class DateTimeFormat final : public Object , public ::Locale::CalendarPattern { JS_OBJECT(DateTimeFormat, Object); + JS_DECLARE_ALLOCATOR(DateTimeFormat); using Patterns = ::Locale::CalendarPattern; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp index 11dc78d27b..9f39c05425 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp @@ -17,6 +17,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DateTimeFormatConstructor); + // 11.1 The Intl.DateTimeFormat Constructor, https://tc39.es/ecma402/#sec-intl-datetimeformat-constructor DateTimeFormatConstructor::DateTimeFormatConstructor(Realm& realm) : NativeFunction(realm.vm().names.DateTimeFormat.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h index dd8f380323..46893524a2 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class DateTimeFormatConstructor final : public NativeFunction { JS_OBJECT(DateTimeFormatConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DateTimeFormatConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp index 57b3688f9a..ffc12808b9 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp @@ -14,6 +14,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DateTimeFormatFunction); + // 11.5.4 DateTime Format Functions, https://tc39.es/ecma402/#sec-datetime-format-functions NonnullGCPtr DateTimeFormatFunction::create(Realm& realm, DateTimeFormat& date_time_format) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h index fa15af8cdb..ba0d60b2c1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h @@ -14,6 +14,7 @@ namespace JS::Intl { class DateTimeFormatFunction final : public NativeFunction { JS_OBJECT(DateTimeFormatFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(DateTimeFormatFunction); public: static NonnullGCPtr create(Realm&, DateTimeFormat&); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp index d895c57e68..92d4157240 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp @@ -14,6 +14,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DateTimeFormatPrototype); + // 11.3 Properties of the Intl.DateTimeFormat Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-datetimeformat-prototype-object DateTimeFormatPrototype::DateTimeFormatPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h index c72a7bcae3..563d7c91b2 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class DateTimeFormatPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DateTimeFormatPrototype, DateTimeFormat, Intl.DateTimeFormat); + JS_DECLARE_ALLOCATOR(DateTimeFormatPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp index f928d527ae..37ed147a7b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp @@ -10,6 +10,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DisplayNames); + // 12 DisplayNames Objects, https://tc39.es/ecma402/#intl-displaynames-objects DisplayNames::DisplayNames(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.h b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.h index ebe0a55f9c..b10056ccfc 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.h @@ -16,6 +16,7 @@ namespace JS::Intl { class DisplayNames final : public Object { JS_OBJECT(DisplayNames, Object); + JS_DECLARE_ALLOCATOR(DisplayNames); enum class Type { Invalid, diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp index db76370da8..f356eeb381 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp @@ -15,6 +15,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DisplayNamesConstructor); + // 12.1 The Intl.DisplayNames Constructor, https://tc39.es/ecma402/#sec-intl-displaynames-constructor DisplayNamesConstructor::DisplayNamesConstructor(Realm& realm) : NativeFunction(realm.vm().names.DisplayNames.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h index 68827b3807..c1dcf1a4f2 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class DisplayNamesConstructor final : public NativeFunction { JS_OBJECT(DisplayNamesConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DisplayNamesConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp index ab77ea0587..c30f3982f1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp @@ -13,6 +13,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DisplayNamesPrototype); + // 12.3 Properties of the Intl.DisplayNames Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-displaynames-prototype-object DisplayNamesPrototype::DisplayNamesPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h index 57bb97f0c3..8c543bb0f3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class DisplayNamesPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DisplayNamesPrototype, DisplayNames, Intl.DisplayNames); + JS_DECLARE_ALLOCATOR(DisplayNamesPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index 11310092c1..0b596956bc 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -20,6 +20,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DurationFormat); + // 1 DurationFormat Objects, https://tc39.es/proposal-intl-duration-format/#durationformat-objects DurationFormat::DurationFormat(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h index fa3245b251..2eb5df9dbb 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.h @@ -17,6 +17,7 @@ namespace JS::Intl { class DurationFormat final : public Object { JS_OBJECT(DurationFormat, Object); + JS_DECLARE_ALLOCATOR(DurationFormat); public: enum class Style { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp index d2bf5df116..4aa2e7c719 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DurationFormatConstructor); + // 1.2 The Intl.DurationFormat Constructor, https://tc39.es/proposal-intl-duration-format/#sec-intl-durationformat-constructor DurationFormatConstructor::DurationFormatConstructor(Realm& realm) : NativeFunction(realm.vm().names.DurationFormat.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h index 81e7f99801..35018a41c8 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class DurationFormatConstructor final : public NativeFunction { JS_OBJECT(DurationFormatConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DurationFormatConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp index 89e28f548e..4eb560b345 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp @@ -12,6 +12,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(DurationFormatPrototype); + // 1.4 Properties of the Intl.DurationFormat Prototype Object, https://tc39.es/proposal-intl-duration-format/#sec-properties-of-intl-durationformat-prototype-object DurationFormatPrototype::DurationFormatPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h index d10942cddf..364bd370d1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class DurationFormatPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DurationFormatPrototype, DurationFormat, Intl.DurationFormat); + JS_DECLARE_ALLOCATOR(DurationFormatPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp index 3204030827..3b12bf94e3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp @@ -26,6 +26,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(Intl); + // 8 The Intl Object, https://tc39.es/ecma402/#intl-object Intl::Intl(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.h b/Userland/Libraries/LibJS/Runtime/Intl/Intl.h index 0a9f262f5c..87660f44fa 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.h @@ -12,6 +12,7 @@ namespace JS::Intl { class Intl final : public Object { JS_OBJECT(Intl, Object); + JS_DECLARE_ALLOCATOR(Intl); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp index d71fbd1851..86594bdfb4 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp @@ -12,6 +12,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(ListFormat); + // 13 ListFormat Objects, https://tc39.es/ecma402/#listformat-objects ListFormat::ListFormat(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.h index 7313781050..3dce50ceb7 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.h @@ -19,6 +19,7 @@ namespace JS::Intl { class ListFormat final : public Object { JS_OBJECT(ListFormat, Object); + JS_DECLARE_ALLOCATOR(ListFormat); public: enum class Type { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index 04548407d6..1b8adf1ec4 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(ListFormatConstructor); + // 13.1 The Intl.ListFormat Constructor, https://tc39.es/ecma402/#sec-intl-listformat-constructor ListFormatConstructor::ListFormatConstructor(Realm& realm) : NativeFunction(realm.vm().names.ListFormat.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h index 466b623908..1c1171119b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class ListFormatConstructor final : public NativeFunction { JS_OBJECT(ListFormatConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ListFormatConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp index 6dcd248cb4..7d6df56082 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp @@ -12,6 +12,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(ListFormatPrototype); + // 13.3 Properties of the Intl.ListFormat Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-listformat-prototype-object ListFormatPrototype::ListFormatPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h index 74d5fe3714..7c1c9de356 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class ListFormatPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ListFormatPrototype, ListFormat, Intl.ListFormat); + JS_DECLARE_ALLOCATOR(ListFormatPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp index 21dc3c6c92..4399c8dcde 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp @@ -14,6 +14,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(Locale); + NonnullGCPtr Locale::create(Realm& realm, ::Locale::LocaleID locale_id) { auto locale = realm.heap().allocate(realm, realm.intrinsics().intl_locale_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.h b/Userland/Libraries/LibJS/Runtime/Intl/Locale.h index 5095cca540..5d3384d2ad 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.h @@ -20,6 +20,7 @@ namespace JS::Intl { class Locale final : public Object { JS_OBJECT(Locale, Object); + JS_DECLARE_ALLOCATOR(Locale); public: static NonnullGCPtr create(Realm&, ::Locale::LocaleID); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index a903f5a1de..3f8a042d4f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -16,6 +16,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(LocaleConstructor); + struct LocaleAndKeys { String locale; Optional ca; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h index 645f966805..d91176dda4 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class LocaleConstructor final : public NativeFunction { JS_OBJECT(LocaleConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(LocaleConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp index e4ed275486..fd5b5f896b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp @@ -13,6 +13,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(LocalePrototype); + // 14.3 Properties of the Intl.Locale Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-locale-prototype-object LocalePrototype::LocalePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h index 52500ded6e..cc81a3d251 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class LocalePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(LocalePrototype, Locale, Intl.Locale); + JS_DECLARE_ALLOCATOR(LocalePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp index 7557dc35af..dc3b79a4b3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp @@ -22,6 +22,9 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(NumberFormatBase); +JS_DEFINE_ALLOCATOR(NumberFormat); + NumberFormatBase::NumberFormatBase(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h index b4ae5f93a7..700dcbdd78 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h @@ -19,6 +19,7 @@ namespace JS::Intl { class NumberFormatBase : public Object { JS_OBJECT(NumberFormatBase, Object); + JS_DECLARE_ALLOCATOR(NumberFormatBase); public: enum class RoundingType { @@ -129,6 +130,7 @@ private: class NumberFormat final : public NumberFormatBase { JS_OBJECT(NumberFormat, NumberFormatBase); + JS_DECLARE_ALLOCATOR(NumberFormat); public: enum class Style { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index f773b5da0f..0ef735c9a1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -13,6 +13,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(NumberFormatConstructor); + // 15.1 The Intl.NumberFormat Constructor, https://tc39.es/ecma402/#sec-intl-numberformat-constructor NumberFormatConstructor::NumberFormatConstructor(Realm& realm) : NativeFunction(realm.vm().names.NumberFormat.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h index 0bb929b211..a3cd15b8f3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h @@ -13,6 +13,7 @@ namespace JS::Intl { class NumberFormatConstructor final : public NativeFunction { JS_OBJECT(NumberFormatConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(NumberFormatConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp index a5a7b1d0ae..294eb0b5d7 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp @@ -13,6 +13,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(NumberFormatPrototype); + // 15.3 Properties of the Intl.NumberFormat Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-numberformat-prototype-object NumberFormatPrototype::NumberFormatPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h index 4f5740662a..6f892cf8a5 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class NumberFormatPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(NumberFormatPrototype, NumberFormat, Intl.NumberFormat); + JS_DECLARE_ALLOCATOR(NumberFormatPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp index 06311ab6a1..8462991437 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp @@ -11,6 +11,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(PluralRules); + // 16 PluralRules Objects, https://tc39.es/ecma402/#pluralrules-objects PluralRules::PluralRules(Object& prototype) : NumberFormatBase(prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.h b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.h index 5e376285c8..e9ec20e590 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.h @@ -17,6 +17,7 @@ namespace JS::Intl { class PluralRules final : public NumberFormatBase { JS_OBJECT(PluralRules, NumberFormatBase); + JS_DECLARE_ALLOCATOR(PluralRules); public: virtual ~PluralRules() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp index 3fd2d0dc45..d9d1e8bb19 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp @@ -15,6 +15,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(PluralRulesConstructor); + // 16.1 The Intl.PluralRules Constructor, https://tc39.es/ecma402/#sec-intl-pluralrules-constructor PluralRulesConstructor::PluralRulesConstructor(Realm& realm) : NativeFunction(realm.vm().names.PluralRules.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h index c2ae486b64..dcfe99d5ee 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class PluralRulesConstructor final : public NativeFunction { JS_OBJECT(PluralRulesConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PluralRulesConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp index 9e42e8362e..1ba9866a79 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp @@ -13,6 +13,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(PluralRulesPrototype); + // 16.3 Properties of the Intl.PluralRules Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-pluralrules-prototype-object PluralRulesPrototype::PluralRulesPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h index 5c48fa106e..42254554df 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class PluralRulesPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PluralRulesPrototype, PluralRules, Intl.PluralRules); + JS_DECLARE_ALLOCATOR(PluralRulesPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp index 0d1f8ed8b4..90bd73ccc9 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp @@ -15,6 +15,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(RelativeTimeFormat); + // 17 RelativeTimeFormat Objects, https://tc39.es/ecma402/#relativetimeformat-objects RelativeTimeFormat::RelativeTimeFormat(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.h index ece4937a96..568c9e43d3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.h @@ -19,6 +19,7 @@ namespace JS::Intl { class RelativeTimeFormat final : public Object { JS_OBJECT(RelativeTimeFormat, Object); + JS_DECLARE_ALLOCATOR(RelativeTimeFormat); public: enum class Numeric { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp index 86f723ffe4..8a0a2a269d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp @@ -18,6 +18,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(RelativeTimeFormatConstructor); + // 17.1 The Intl.RelativeTimeFormat Constructor, https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor RelativeTimeFormatConstructor::RelativeTimeFormatConstructor(Realm& realm) : NativeFunction(realm.vm().names.RelativeTimeFormat.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h index 9ef3f38904..305971c8a8 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class RelativeTimeFormatConstructor final : public NativeFunction { JS_OBJECT(RelativeTimeFormatConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(RelativeTimeFormatConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp index 5edbdea67f..8e434dc598 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp @@ -11,6 +11,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(RelativeTimeFormatPrototype); + // 17.3 Properties of the Intl.RelativeTimeFormat Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-relativetimeformat-prototype-object RelativeTimeFormatPrototype::RelativeTimeFormatPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h index 4012ed2184..51ce13ee08 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class RelativeTimeFormatPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(RelativeTimeFormatPrototype, RelativeTimeFormat, Intl.RelativeTimeFormat); + JS_DECLARE_ALLOCATOR(RelativeTimeFormatPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.cpp index 9fd403db5d..3a1a19c1fa 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.cpp @@ -10,6 +10,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(SegmentIterator); + // 18.6.1 CreateSegmentIterator ( segmenter, string ), https://tc39.es/ecma402/#sec-createsegmentsobject NonnullGCPtr SegmentIterator::create(Realm& realm, Segmenter& segmenter, Utf16View const& string, Segments const& segments) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.h index 011d6de1e2..c284875b48 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIterator.h @@ -14,6 +14,7 @@ namespace JS::Intl { class SegmentIterator final : public Object { JS_OBJECT(SegmentIterator, Object); + JS_DECLARE_ALLOCATOR(SegmentIterator); public: static NonnullGCPtr create(Realm&, Segmenter&, Utf16View const&, Segments const&); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp index fe20bc770d..8017390e76 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp @@ -12,6 +12,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(SegmentIteratorPrototype); + // 18.6.2 The %SegmentIteratorPrototype% Object, https://tc39.es/ecma402/#sec-%segmentiteratorprototype%-object SegmentIteratorPrototype::SegmentIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h index 6be503d84f..c8c318adba 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class SegmentIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SegmentIteratorPrototype, SegmentIterator, SegmentIterator); + JS_DECLARE_ALLOCATOR(SegmentIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp index 3317135b94..859fdedc40 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp @@ -12,6 +12,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(Segmenter); + // 18 Segmenter Objects, https://tc39.es/ecma402/#segmenter-objects Segmenter::Segmenter(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.h b/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.h index 5cd541cf99..a11813dc8a 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.h @@ -14,6 +14,7 @@ namespace JS::Intl { class Segmenter final : public Object { JS_OBJECT(Segmenter, Object); + JS_DECLARE_ALLOCATOR(Segmenter); public: enum class SegmenterGranularity { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp index 5320274e87..0001b3fbf1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp @@ -15,6 +15,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(SegmenterConstructor); + // 18.1 The Intl.Segmenter Constructor, https://tc39.es/ecma402/#sec-intl-segmenter-constructor SegmenterConstructor::SegmenterConstructor(Realm& realm) : NativeFunction(realm.vm().names.Segmenter.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h index 6cd08b38c9..76c4d17d85 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h @@ -12,6 +12,7 @@ namespace JS::Intl { class SegmenterConstructor final : public NativeFunction { JS_OBJECT(SegmenterConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(SegmenterConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp index 5b2421fe03..dad141a582 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp @@ -11,6 +11,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(SegmenterPrototype); + // 18.3 Properties of the Intl.Segmenter Prototype Object, https://tc39.es/ecma402/#sec-properties-of-intl-segmenter-prototype-object SegmenterPrototype::SegmenterPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h index 672318f1cf..b47bcd796d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class SegmenterPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SegmenterPrototype, Segmenter, Segmenter); + JS_DECLARE_ALLOCATOR(SegmenterPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Segments.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Segments.cpp index b62e99f094..a4f7a68537 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Segments.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Segments.cpp @@ -10,6 +10,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(Segments); + // 18.5.1 CreateSegmentsObject ( segmenter, string ), https://tc39.es/ecma402/#sec-createsegmentsobject NonnullGCPtr Segments::create(Realm& realm, Segmenter& segmenter, Utf16String string) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Segments.h b/Userland/Libraries/LibJS/Runtime/Intl/Segments.h index 5c3749aba4..5fcb435e55 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Segments.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Segments.h @@ -14,6 +14,7 @@ namespace JS::Intl { class Segments final : public Object { JS_OBJECT(Segments, Object); + JS_DECLARE_ALLOCATOR(Segments); public: static NonnullGCPtr create(Realm&, Segmenter&, Utf16String); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp index d3b9b07d4f..f1ed1eef9f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp @@ -11,6 +11,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(SegmentsPrototype); + // 18.5.2 The %SegmentsPrototype% Object, https://tc39.es/ecma402/#sec-%segmentsprototype%-object SegmentsPrototype::SegmentsPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h index 24ca244130..a7a8beae4a 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h @@ -13,6 +13,7 @@ namespace JS::Intl { class SegmentsPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SegmentsPrototype, Segments, Segments); + JS_DECLARE_ALLOCATOR(SegmentsPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp b/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp index 40502e234c..a988c84cf0 100644 --- a/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp @@ -133,6 +133,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Intrinsics); + static void initialize_constructor(VM& vm, PropertyKey const& property_key, Object& constructor, Object* prototype, PropertyAttributes constructor_property_attributes = Attribute::Writable | Attribute::Configurable) { constructor.define_direct_property(vm.names.name, PrimitiveString::create(vm, property_key.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/Intrinsics.h b/Userland/Libraries/LibJS/Runtime/Intrinsics.h index be8d7bf516..36d03e8923 100644 --- a/Userland/Libraries/LibJS/Runtime/Intrinsics.h +++ b/Userland/Libraries/LibJS/Runtime/Intrinsics.h @@ -13,6 +13,7 @@ namespace JS { class Intrinsics final : public Cell { JS_CELL(Intrinsics, Cell); + JS_DECLARE_ALLOCATOR(Intrinsics); public: static ThrowCompletionOr> create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/Iterator.cpp b/Userland/Libraries/LibJS/Runtime/Iterator.cpp index f8b2a35e48..4eaf3d41a5 100644 --- a/Userland/Libraries/LibJS/Runtime/Iterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/Iterator.cpp @@ -16,6 +16,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Iterator); + NonnullGCPtr Iterator::create(Realm& realm, Object& prototype, IteratorRecord iterated) { return realm.heap().allocate(realm, prototype, move(iterated)); diff --git a/Userland/Libraries/LibJS/Runtime/Iterator.h b/Userland/Libraries/LibJS/Runtime/Iterator.h index fefa8fc57e..56b7afe974 100644 --- a/Userland/Libraries/LibJS/Runtime/Iterator.h +++ b/Userland/Libraries/LibJS/Runtime/Iterator.h @@ -25,6 +25,7 @@ struct IteratorRecord { class Iterator : public Object { JS_OBJECT(Iterator, Object); + JS_DECLARE_ALLOCATOR(Iterator); public: static NonnullGCPtr create(Realm&, Object& prototype, IteratorRecord iterated); diff --git a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp index 1b104e84a9..4fbda56e13 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(IteratorConstructor); + // 3.1.1.1 The Iterator Constructor, https://tc39.es/proposal-iterator-helpers/#sec-iterator-constructor IteratorConstructor::IteratorConstructor(Realm& realm) : Base(realm.vm().names.Iterator.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h index 44c324b9a0..f798405a2a 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h @@ -13,6 +13,7 @@ namespace JS { class IteratorConstructor : public NativeFunction { JS_OBJECT(IteratorConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(IteratorConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/IteratorHelper.cpp b/Userland/Libraries/LibJS/Runtime/IteratorHelper.cpp index 345ec4ca15..194c591909 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorHelper.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorHelper.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(IteratorHelper); + ThrowCompletionOr> IteratorHelper::create(Realm& realm, IteratorRecord underlying_iterator, Closure closure, Optional abrupt_closure) { return realm.heap().allocate(realm, realm, realm.intrinsics().iterator_helper_prototype(), move(underlying_iterator), move(closure), move(abrupt_closure)); diff --git a/Userland/Libraries/LibJS/Runtime/IteratorHelper.h b/Userland/Libraries/LibJS/Runtime/IteratorHelper.h index 2d4ed3de1b..b474fd0c1d 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorHelper.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorHelper.h @@ -16,6 +16,7 @@ namespace JS { class IteratorHelper final : public GeneratorObject { JS_OBJECT(IteratorHelper, GeneratorObject); + JS_DECLARE_ALLOCATOR(IteratorHelper); public: using Closure = JS::SafeFunction(VM&, IteratorHelper&)>; diff --git a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp index 1a40356418..dcb515ea11 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(IteratorHelperPrototype); + IteratorHelperPrototype::IteratorHelperPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h index 8ec696f180..ad27504c21 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h @@ -13,6 +13,7 @@ namespace JS { class IteratorHelperPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(IteratorHelperPrototype, IteratorHelper, IteratorHelper); + JS_DECLARE_ALLOCATOR(IteratorHelperPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp index 87940d4c40..243c311929 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp @@ -16,6 +16,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(IteratorPrototype); + // 27.1.2 The %IteratorPrototype% Object, https://tc39.es/ecma262/#sec-%iteratorprototype%-object IteratorPrototype::IteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) @@ -311,6 +313,7 @@ JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::drop) class FlatMapIterator : public Cell { JS_CELL(FlatMapIterator, Cell); + JS_DECLARE_ALLOCATOR(FlatMapIterator); public: ThrowCompletionOr next(VM& vm, IteratorRecord const& iterated, IteratorHelper& iterator, FunctionObject& mapper) @@ -422,6 +425,8 @@ private: Optional m_inner_iterator; }; +JS_DEFINE_ALLOCATOR(FlatMapIterator); + // 3.1.3.6 Iterator.prototype.flatMap ( mapper ), https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype.flatmap JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::flat_map) { diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h index 87ca187d30..bef72b17f0 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h @@ -13,6 +13,7 @@ namespace JS { class IteratorPrototype : public PrototypeObject { JS_PROTOTYPE_OBJECT(IteratorPrototype, Iterator, Iterator); + JS_DECLARE_ALLOCATOR(IteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 6c0e1690a2..c01952a75e 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -27,6 +27,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(JSONObject); + JSONObject::JSONObject(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.h b/Userland/Libraries/LibJS/Runtime/JSONObject.h index 9a87b520aa..0306b66c32 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.h +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.h @@ -12,6 +12,7 @@ namespace JS { class JSONObject final : public Object { JS_OBJECT(JSONObject, Object); + JS_DECLARE_ALLOCATOR(JSONObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Map.cpp b/Userland/Libraries/LibJS/Runtime/Map.cpp index 7ec3ec8966..b601d71ce3 100644 --- a/Userland/Libraries/LibJS/Runtime/Map.cpp +++ b/Userland/Libraries/LibJS/Runtime/Map.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Map); + NonnullGCPtr Map::create(Realm& realm) { return realm.heap().allocate(realm, realm.intrinsics().map_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/Map.h b/Userland/Libraries/LibJS/Runtime/Map.h index 073d43aca1..af01a1fd2b 100644 --- a/Userland/Libraries/LibJS/Runtime/Map.h +++ b/Userland/Libraries/LibJS/Runtime/Map.h @@ -17,6 +17,7 @@ namespace JS { class Map : public Object { JS_OBJECT(Map, Object); + JS_DECLARE_ALLOCATOR(Map); public: static NonnullGCPtr create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp index ec2f6e6984..70ac205202 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(MapConstructor); + MapConstructor::MapConstructor(Realm& realm) : NativeFunction(realm.vm().names.Map.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.h b/Userland/Libraries/LibJS/Runtime/MapConstructor.h index ff0bbaea92..4b1707bdcd 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.h @@ -12,6 +12,7 @@ namespace JS { class MapConstructor final : public NativeFunction { JS_OBJECT(MapConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(MapConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/MapIterator.cpp b/Userland/Libraries/LibJS/Runtime/MapIterator.cpp index 99c17b52a3..b81748ab59 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIterator.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(MapIterator); + NonnullGCPtr MapIterator::create(Realm& realm, Map& map, Object::PropertyKind iteration_kind) { return realm.heap().allocate(realm, map, iteration_kind, realm.intrinsics().map_iterator_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/MapIterator.h b/Userland/Libraries/LibJS/Runtime/MapIterator.h index c6595699ee..ac31c06c0b 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIterator.h +++ b/Userland/Libraries/LibJS/Runtime/MapIterator.h @@ -14,6 +14,7 @@ namespace JS { class MapIterator final : public Object { JS_OBJECT(MapIterator, Object); + JS_DECLARE_ALLOCATOR(MapIterator); public: static NonnullGCPtr create(Realm&, Map& map, Object::PropertyKind iteration_kind); diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp index a8fe9607cd..0aff979af4 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(MapIteratorPrototype); + MapIteratorPrototype::MapIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h index 5f1e1db3c7..e585f9e454 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h @@ -13,6 +13,7 @@ namespace JS { class MapIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(MapIteratorPrototype, MapIterator, MapIterator); + JS_DECLARE_ALLOCATOR(MapIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp index 96c9d5f5fa..43a6fbc1a8 100644 --- a/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(MapPrototype); + MapPrototype::MapPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/MapPrototype.h b/Userland/Libraries/LibJS/Runtime/MapPrototype.h index 53a32640dc..6cd6cfce65 100644 --- a/Userland/Libraries/LibJS/Runtime/MapPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/MapPrototype.h @@ -13,6 +13,7 @@ namespace JS { class MapPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(MapPrototype, Map, Map); + JS_DECLARE_ALLOCATOR(MapPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/MathObject.cpp b/Userland/Libraries/LibJS/Runtime/MathObject.cpp index 5337f5c93a..8225b5bc6e 100644 --- a/Userland/Libraries/LibJS/Runtime/MathObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/MathObject.cpp @@ -17,6 +17,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(MathObject); + MathObject::MathObject(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/MathObject.h b/Userland/Libraries/LibJS/Runtime/MathObject.h index a7253a5ba9..81ba320efc 100644 --- a/Userland/Libraries/LibJS/Runtime/MathObject.h +++ b/Userland/Libraries/LibJS/Runtime/MathObject.h @@ -12,6 +12,7 @@ namespace JS { class MathObject final : public Object { JS_OBJECT(MathObject, Object); + JS_DECLARE_ALLOCATOR(MathObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp index ba2a2fa38b..43d6b13522 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ModuleEnvironment); + // 9.1.2.6 NewModuleEnvironment ( E ), https://tc39.es/ecma262/#sec-newmoduleenvironment ModuleEnvironment::ModuleEnvironment(Environment* outer_environment) : DeclarativeEnvironment(outer_environment) diff --git a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h index 372dc016a5..398080798e 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleEnvironment.h @@ -15,6 +15,7 @@ namespace JS { // 9.1.1.5 Module Environment Records, https://tc39.es/ecma262/#sec-module-environment-records class ModuleEnvironment final : public DeclarativeEnvironment { JS_ENVIRONMENT(ModuleEnvironment, DeclarativeEnvironment); + JS_DECLARE_ALLOCATOR(ModuleEnvironment); public: // Note: Module Environment Records support all of the declarative Environment Record methods listed diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp index f8d3d7185d..b301d398d1 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ModuleNamespaceObject); + ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector exports) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype(), MayInterfereWithIndexedPropertyAccess::Yes) , m_module(module) diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h index 86288d4d4b..397d24edfb 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h @@ -14,6 +14,7 @@ namespace JS { class ModuleNamespaceObject final : public Object { JS_OBJECT(ModuleNamespaceObject, Object); + JS_DECLARE_ALLOCATOR(ModuleNamespaceObject); public: // 10.4.6 Module Namespace Exotic Objects, https://tc39.es/ecma262/#sec-module-namespace-exotic-objects diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp index fe89e713de..d43b1d57e8 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(NativeFunction); + // 10.3.3 CreateBuiltinFunction ( behaviour, length, name, additionalInternalSlotsList [ , realm [ , prototype [ , prefix ] ] ] ), https://tc39.es/ecma262/#sec-createbuiltinfunction // NOTE: This doesn't consider additionalInternalSlotsList, which is rarely used, and can either be implemented using only the `function` lambda, or needs a NativeFunction subclass. NonnullGCPtr NativeFunction::create(Realm& allocating_realm, Function(VM&)> behaviour, i32 length, PropertyKey const& name, Optional realm, Optional prototype, Optional const& prefix) diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.h b/Userland/Libraries/LibJS/Runtime/NativeFunction.h index a402a63857..08073904c7 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.h +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.h @@ -18,6 +18,7 @@ namespace JS { class NativeFunction : public FunctionObject { JS_OBJECT(NativeFunction, FunctionObject); + JS_DECLARE_ALLOCATOR(NativeFunction); public: static NonnullGCPtr create(Realm&, Function(VM&)> behaviour, i32 length, PropertyKey const& name, Optional = {}, Optional prototype = {}, Optional const& prefix = {}); diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp index da3f2ceb51..3890dc6707 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp @@ -24,6 +24,8 @@ constexpr double const MIN_SAFE_INTEGER_VALUE { -(__builtin_exp2(53) - 1) }; namespace JS { +JS_DEFINE_ALLOCATOR(NumberConstructor); + NumberConstructor::NumberConstructor(Realm& realm) : NativeFunction(realm.vm().names.Number.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.h b/Userland/Libraries/LibJS/Runtime/NumberConstructor.h index 45d32f1e21..1aa4c174c6 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.h @@ -12,6 +12,7 @@ namespace JS { class NumberConstructor final : public NativeFunction { JS_OBJECT(NumberConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(NumberConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/NumberObject.cpp b/Userland/Libraries/LibJS/Runtime/NumberObject.cpp index 632d0b99d7..175f8e26f6 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberObject.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(NumberObject); + NonnullGCPtr NumberObject::create(Realm& realm, double value) { return realm.heap().allocate(realm, value, realm.intrinsics().number_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/NumberObject.h b/Userland/Libraries/LibJS/Runtime/NumberObject.h index f6bc0df4d1..cd150c04d0 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberObject.h +++ b/Userland/Libraries/LibJS/Runtime/NumberObject.h @@ -12,6 +12,7 @@ namespace JS { class NumberObject : public Object { JS_OBJECT(NumberObject, Object); + JS_DECLARE_ALLOCATOR(NumberObject); public: static NonnullGCPtr create(Realm&, double); diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp index 75628bebda..b216c02ca5 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -22,6 +22,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(NumberPrototype); + static constexpr AK::Array max_precision_for_radix = { // clang-format off 0, 0, 52, 32, 26, 22, 20, 18, 17, 16, diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.h b/Userland/Libraries/LibJS/Runtime/NumberPrototype.h index 22139df606..9ed57061d9 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.h @@ -12,6 +12,7 @@ namespace JS { class NumberPrototype final : public NumberObject { JS_OBJECT(NumberPrototype, NumberObject); + JS_DECLARE_ALLOCATOR(NumberPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index e8edf0c770..657d7ce29c 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -23,6 +23,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Object); + static HashMap, HashMap> s_intrinsics; // 10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] ), https://tc39.es/ecma262/#sec-ordinaryobjectcreate diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index ee31cda5e4..26212f4da2 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ struct CacheablePropertyMetadata { class Object : public Cell { JS_CELL(Object, Cell); + JS_DECLARE_ALLOCATOR(Object); public: static NonnullGCPtr create(Realm&, Object* prototype); diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index c2cae1e24a..4479b7273b 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -17,6 +17,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ObjectConstructor); + ObjectConstructor::ObjectConstructor(Realm& realm) : NativeFunction(realm.vm().names.Object.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h index 10ff73ff3c..7d372475c6 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h @@ -13,6 +13,7 @@ namespace JS { class ObjectConstructor final : public NativeFunction { JS_OBJECT(ObjectConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ObjectConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp index 5939b2ca29..64a335776d 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ObjectEnvironment); + ObjectEnvironment::ObjectEnvironment(Object& binding_object, IsWithEnvironment is_with_environment, Environment* outer_environment) : Environment(outer_environment) , m_binding_object(binding_object) diff --git a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h index 64f552df7e..f126a1d1fd 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectEnvironment.h @@ -12,6 +12,7 @@ namespace JS { class ObjectEnvironment final : public Environment { JS_ENVIRONMENT(ObjectEnvironment, Environment); + JS_DECLARE_ALLOCATOR(ObjectEnvironment); public: enum class IsWithEnvironment { diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp index 6031539d8e..ffa394a06c 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -21,6 +21,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ObjectPrototype); + ObjectPrototype::ObjectPrototype(Realm& realm) : Object(Object::ConstructWithoutPrototypeTag::Tag, realm) { diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h index abb3a4976c..08d68a5fee 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h @@ -13,6 +13,7 @@ namespace JS { class ObjectPrototype final : public Object { JS_OBJECT(ObjectPrototype, Object); + JS_DECLARE_ALLOCATOR(ObjectPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp b/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp index cb0131347a..ea9c84ca6e 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp @@ -19,6 +19,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(PrimitiveString); + PrimitiveString::PrimitiveString(PrimitiveString& lhs, PrimitiveString& rhs) : m_is_rope(true) , m_lhs(&lhs) diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h index da1b564c02..88f3c175d3 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,7 @@ namespace JS { class PrimitiveString final : public Cell { JS_CELL(PrimitiveString, Cell); + JS_DECLARE_ALLOCATOR(PrimitiveString); public: [[nodiscard]] static NonnullGCPtr create(VM&, Utf16String); diff --git a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp index df212d2803..4258354f51 100644 --- a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(PrivateEnvironment); + PrivateEnvironment::PrivateEnvironment(PrivateEnvironment* parent) : m_outer_environment(parent) , m_unique_id(s_next_id++) diff --git a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h index fa195c5e52..b450c24555 100644 --- a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace JS { @@ -29,6 +30,7 @@ struct PrivateName { class PrivateEnvironment : public Cell { JS_CELL(PrivateEnvironment, Cell); + JS_DECLARE_ALLOCATOR(PrivateEnvironment); public: PrivateName resolve_private_identifier(DeprecatedFlyString const& identifier) const; diff --git a/Userland/Libraries/LibJS/Runtime/Promise.cpp b/Userland/Libraries/LibJS/Runtime/Promise.cpp index c2809a0122..78d03f9361 100644 --- a/Userland/Libraries/LibJS/Runtime/Promise.cpp +++ b/Userland/Libraries/LibJS/Runtime/Promise.cpp @@ -19,6 +19,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Promise); + // 27.2.4.7.1 PromiseResolve ( C, x ), https://tc39.es/ecma262/#sec-promise-resolve ThrowCompletionOr promise_resolve(VM& vm, Object& constructor, Value value) { diff --git a/Userland/Libraries/LibJS/Runtime/Promise.h b/Userland/Libraries/LibJS/Runtime/Promise.h index 627ea78686..e97d9daaec 100644 --- a/Userland/Libraries/LibJS/Runtime/Promise.h +++ b/Userland/Libraries/LibJS/Runtime/Promise.h @@ -15,6 +15,7 @@ ThrowCompletionOr promise_resolve(VM&, Object& constructor, Value); class Promise : public Object { JS_OBJECT(Promise, Object); + JS_DECLARE_ALLOCATOR(Promise); public: enum class State { diff --git a/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp b/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp index 4fa80c7d7a..e87241e6d8 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseCapability.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(PromiseCapability); + NonnullGCPtr PromiseCapability::create(VM& vm, NonnullGCPtr promise, NonnullGCPtr resolve, NonnullGCPtr reject) { return vm.heap().allocate_without_realm(promise, resolve, reject); @@ -34,6 +36,7 @@ void PromiseCapability::visit_edges(Cell::Visitor& visitor) namespace { struct ResolvingFunctions final : public Cell { JS_CELL(ResolvingFunctions, Cell); + JS_DECLARE_ALLOCATOR(ResolvingFunctions); Value resolve { js_undefined() }; Value reject { js_undefined() }; @@ -45,6 +48,7 @@ struct ResolvingFunctions final : public Cell { visitor.visit(reject); } }; +JS_DEFINE_ALLOCATOR(ResolvingFunctions); } // 27.2.1.5 NewPromiseCapability ( C ), https://tc39.es/ecma262/#sec-newpromisecapability diff --git a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h index 741626247b..4280b0d090 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h @@ -15,6 +15,7 @@ namespace JS { // 27.2.1.1 PromiseCapability Records, https://tc39.es/ecma262/#sec-promisecapability-records class PromiseCapability final : public Cell { JS_CELL(PromiseCapability, Cell); + JS_DECLARE_ALLOCATOR(PromiseCapability); public: static NonnullGCPtr create(VM& vm, NonnullGCPtr promise, NonnullGCPtr resolve, NonnullGCPtr reject); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 0dda6cec31..7039c2457a 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -19,6 +19,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(PromiseConstructor); + // 27.2.4.1.1 GetPromiseResolve ( promiseConstructor ), https://tc39.es/ecma262/#sec-getpromiseresolve static ThrowCompletionOr get_promise_resolve(VM& vm, Value constructor) { diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h index 01158d2582..ca151325af 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h @@ -12,6 +12,7 @@ namespace JS { class PromiseConstructor final : public NativeFunction { JS_OBJECT(PromiseConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PromiseConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp index 6d8359cbfd..9ff1815d14 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(PromisePrototype); + PromisePrototype::PromisePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.h b/Userland/Libraries/LibJS/Runtime/PromisePrototype.h index 9fc359d8cf..2edef6e262 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.h @@ -12,6 +12,7 @@ namespace JS { class PromisePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PromisePrototype, Promise, Promise); + JS_DECLARE_ALLOCATOR(PromisePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp b/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp index 3582eed136..96c14876f9 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(PromiseReaction); + NonnullGCPtr PromiseReaction::create(VM& vm, Type type, GCPtr capability, Optional handler) { return vm.heap().allocate_without_realm(type, capability, move(handler)); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseReaction.h b/Userland/Libraries/LibJS/Runtime/PromiseReaction.h index def9197637..04000a798f 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseReaction.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseReaction.h @@ -16,6 +16,7 @@ namespace JS { // 27.2.1.2 PromiseReaction Records, https://tc39.es/ecma262/#sec-promisereaction-records class PromiseReaction final : public Cell { JS_CELL(PromiseReaction, Cell); + JS_DECLARE_ALLOCATOR(PromiseReaction); public: enum class Type { diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp index c62f8f955c..817ee1e78a 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp @@ -13,6 +13,13 @@ namespace JS { +JS_DEFINE_ALLOCATOR(RemainingElements); +JS_DEFINE_ALLOCATOR(PromiseValueList); +JS_DEFINE_ALLOCATOR(PromiseResolvingElementFunction); +JS_DEFINE_ALLOCATOR(PromiseAllResolveElementFunction); +JS_DEFINE_ALLOCATOR(PromiseAllSettledRejectElementFunction); +JS_DEFINE_ALLOCATOR(PromiseAnyRejectElementFunction); + void PromiseValueList::visit_edges(Visitor& visitor) { Base::visit_edges(visitor); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h index 40b2f0cf07..60958c43c9 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h @@ -14,6 +14,7 @@ namespace JS { struct RemainingElements final : public Cell { JS_CELL(RemainingElements, Cell); + JS_DECLARE_ALLOCATOR(RemainingElements); u64 value { 0 }; @@ -28,6 +29,7 @@ private: class PromiseValueList final : public Cell { JS_CELL(PromiseValueList, Cell); + JS_DECLARE_ALLOCATOR(PromiseValueList); public: Vector& values() { return m_values; } @@ -42,7 +44,8 @@ private: }; class PromiseResolvingElementFunction : public NativeFunction { - JS_OBJECT(PromiseResolvingFunction, NativeFunction); + JS_OBJECT(PromiseResolvingElementFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(PromiseResolvingElementFunction); public: virtual void initialize(Realm&) override; @@ -68,7 +71,8 @@ private: // 27.2.4.1.3 Promise.all Resolve Element Functions, https://tc39.es/ecma262/#sec-promise.all-resolve-element-functions class PromiseAllResolveElementFunction final : public PromiseResolvingElementFunction { - JS_OBJECT(PromiseResolvingFunction, NativeFunction); + JS_OBJECT(PromiseAllResolveElementFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(PromiseAllResolveElementFunction); public: static NonnullGCPtr create(Realm&, size_t, PromiseValueList&, NonnullGCPtr, RemainingElements&); @@ -98,7 +102,8 @@ private: // 27.2.4.2.3 Promise.allSettled Reject Element Functions, https://tc39.es/ecma262/#sec-promise.allsettled-reject-element-functions class PromiseAllSettledRejectElementFunction final : public PromiseResolvingElementFunction { - JS_OBJECT(PromiseResolvingFunction, PromiseResolvingElementFunction); + JS_OBJECT(PromiseAllSettledRejectElementFunction, PromiseResolvingElementFunction); + JS_DECLARE_ALLOCATOR(PromiseAllSettledRejectElementFunction); public: static NonnullGCPtr create(Realm&, size_t, PromiseValueList&, NonnullGCPtr, RemainingElements&); @@ -113,7 +118,8 @@ private: // 27.2.4.3.2 Promise.any Reject Element Functions, https://tc39.es/ecma262/#sec-promise.any-reject-element-functions class PromiseAnyRejectElementFunction final : public PromiseResolvingElementFunction { - JS_OBJECT(PromiseResolvingFunction, PromiseResolvingElementFunction); + JS_OBJECT(PromiseAnyRejectElementFunction, PromiseResolvingElementFunction); + JS_DECLARE_ALLOCATOR(PromiseAnyRejectElementFunction); public: static NonnullGCPtr create(Realm&, size_t, PromiseValueList&, NonnullGCPtr, RemainingElements&); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp index d4d178d963..50e61b6086 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp @@ -11,6 +11,9 @@ namespace JS { +JS_DEFINE_ALLOCATOR(AlreadyResolved); +JS_DEFINE_ALLOCATOR(PromiseResolvingFunction); + NonnullGCPtr PromiseResolvingFunction::create(Realm& realm, Promise& promise, AlreadyResolved& already_resolved, FunctionType function) { return realm.heap().allocate(realm, promise, already_resolved, move(function), realm.intrinsics().function_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h index 245d5baaa0..951d18ab8b 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h @@ -13,6 +13,7 @@ namespace JS { struct AlreadyResolved final : public Cell { JS_CELL(AlreadyResolved, Cell); + JS_DECLARE_ALLOCATOR(AlreadyResolved); bool value { false }; @@ -24,6 +25,7 @@ protected: class PromiseResolvingFunction final : public NativeFunction { JS_OBJECT(PromiseResolvingFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(PromiseResolvingFunction); public: using FunctionType = Function; diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp index b24335bfb1..9e0416ab72 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ProxyConstructor); + // 10.5.14 ProxyCreate ( target, handler ), https://tc39.es/ecma262/#sec-proxycreate static ThrowCompletionOr proxy_create(VM& vm, Value target, Value handler) { diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h index 46414bee0f..e46fd7a478 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h @@ -13,6 +13,7 @@ namespace JS { class ProxyConstructor final : public NativeFunction { JS_OBJECT(ProxyConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ProxyConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp index 6d537b93da..3edfdbae38 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -16,6 +16,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ProxyObject); + NonnullGCPtr ProxyObject::create(Realm& realm, Object& target, Object& handler) { return realm.heap().allocate(realm, target, handler, realm.intrinsics().object_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.h b/Userland/Libraries/LibJS/Runtime/ProxyObject.h index 2669b74ee6..c11b318a0d 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.h @@ -14,6 +14,7 @@ namespace JS { class ProxyObject final : public FunctionObject { JS_OBJECT(ProxyObject, FunctionObject); + JS_DECLARE_ALLOCATOR(ProxyObject); public: static NonnullGCPtr create(Realm&, Object& target, Object& handler); diff --git a/Userland/Libraries/LibJS/Runtime/Realm.cpp b/Userland/Libraries/LibJS/Runtime/Realm.cpp index 3d92c25b59..f803aaa834 100644 --- a/Userland/Libraries/LibJS/Runtime/Realm.cpp +++ b/Userland/Libraries/LibJS/Runtime/Realm.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Realm); + // 9.3.1 CreateRealm ( ), https://tc39.es/ecma262/#sec-createrealm ThrowCompletionOr> Realm::create(VM& vm) { diff --git a/Userland/Libraries/LibJS/Runtime/Realm.h b/Userland/Libraries/LibJS/Runtime/Realm.h index 7d1d746cec..5a42d6a649 100644 --- a/Userland/Libraries/LibJS/Runtime/Realm.h +++ b/Userland/Libraries/LibJS/Runtime/Realm.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,7 @@ class Realm final : public Cell , public Weakable { JS_CELL(Realm, Cell); + JS_DECLARE_ALLOCATOR(Realm); public: struct HostDefined { diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index fa8222d504..32a5b9d12e 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ReflectObject); + ReflectObject::ReflectObject(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.h b/Userland/Libraries/LibJS/Runtime/ReflectObject.h index 4f0058e930..5937626d7b 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.h +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.h @@ -12,6 +12,7 @@ namespace JS { class ReflectObject final : public Object { JS_OBJECT(ReflectObject, Object); + JS_DECLARE_ALLOCATOR(ReflectObject); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp index a6c0b0964a..363722861f 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(RegExpConstructor); + RegExpConstructor::RegExpConstructor(Realm& realm) : NativeFunction(realm.vm().names.RegExp.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h index a754513739..06b9c213a3 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h @@ -13,6 +13,7 @@ namespace JS { class RegExpConstructor final : public NativeFunction { JS_OBJECT(RegExpConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(RegExpConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index 1ff6fc087e..e86f9a1e27 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -16,6 +16,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(RegExpObject); + Result, DeprecatedString> regex_flags_from_string(StringView flags) { bool d = false, g = false, i = false, m = false, s = false, u = false, y = false, v = false; diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.h b/Userland/Libraries/LibJS/Runtime/RegExpObject.h index eadb108e53..3dacd0b68e 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.h @@ -25,6 +25,7 @@ ThrowCompletionOr parse_regex_pattern(VM& vm, StringView patte class RegExpObject : public Object { JS_OBJECT(RegExpObject, Object); + JS_DECLARE_ALLOCATOR(RegExpObject); public: // JS regexps are all 'global' by default as per our definition, but the "global" flag enables "stateful". diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 02e6386302..2101453784 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -23,6 +23,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(RegExpPrototype); + RegExpPrototype::RegExpPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h index 69bbb6b14e..2b6ee4c2eb 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h @@ -17,6 +17,7 @@ size_t advance_string_index(Utf16View const& string, size_t index, bool unicode) class RegExpPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(RegExpPrototype, RegExpObject, RegExp); + JS_DECLARE_ALLOCATOR(RegExpPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.cpp b/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.cpp index 1c90485934..cdaa65a113 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(RegExpStringIterator); + // 22.2.9.1 CreateRegExpStringIterator ( R, S, global, fullUnicode ), https://tc39.es/ecma262/#sec-createregexpstringiterator NonnullGCPtr RegExpStringIterator::create(Realm& realm, Object& regexp_object, Utf16String string, bool global, bool unicode) { diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h b/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h index 818f5931a1..dfaae69a2b 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h @@ -14,6 +14,7 @@ namespace JS { class RegExpStringIterator final : public Object { JS_OBJECT(RegExpStringIterator, Object); + JS_DECLARE_ALLOCATOR(RegExpStringIterator); public: static NonnullGCPtr create(Realm&, Object& regexp_object, Utf16String string, bool global, bool unicode); diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp index 48764a8974..58bb744a07 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(RegExpStringIteratorPrototype); + RegExpStringIteratorPrototype::RegExpStringIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h index 77ac5f678d..96818aaee8 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h @@ -13,6 +13,7 @@ namespace JS { class RegExpStringIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(RegExpStringIteratorPrototype, RegExpStringIterator, RegExpStringIterator); + JS_DECLARE_ALLOCATOR(RegExpStringIteratorPrototype); public: virtual ~RegExpStringIteratorPrototype() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Set.cpp b/Userland/Libraries/LibJS/Runtime/Set.cpp index c603ba3749..39b45af240 100644 --- a/Userland/Libraries/LibJS/Runtime/Set.cpp +++ b/Userland/Libraries/LibJS/Runtime/Set.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Set); + NonnullGCPtr Set::create(Realm& realm) { return realm.heap().allocate(realm, realm.intrinsics().set_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/Set.h b/Userland/Libraries/LibJS/Runtime/Set.h index fc00ad687e..d570fa8256 100644 --- a/Userland/Libraries/LibJS/Runtime/Set.h +++ b/Userland/Libraries/LibJS/Runtime/Set.h @@ -15,6 +15,7 @@ namespace JS { class Set : public Object { JS_OBJECT(Set, Object); + JS_DECLARE_ALLOCATOR(Set); public: static NonnullGCPtr create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp index d71728af2f..59a0c0c2d6 100644 --- a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SetConstructor); + SetConstructor::SetConstructor(Realm& realm) : NativeFunction(realm.vm().names.Set.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SetConstructor.h b/Userland/Libraries/LibJS/Runtime/SetConstructor.h index b11a2cf90d..a36a8152cf 100644 --- a/Userland/Libraries/LibJS/Runtime/SetConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SetConstructor.h @@ -12,6 +12,7 @@ namespace JS { class SetConstructor final : public NativeFunction { JS_OBJECT(SetConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(SetConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/SetIterator.cpp b/Userland/Libraries/LibJS/Runtime/SetIterator.cpp index cdef48b2d8..500b6b98da 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIterator.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SetIterator); + NonnullGCPtr SetIterator::create(Realm& realm, Set& set, Object::PropertyKind iteration_kind) { return realm.heap().allocate(realm, set, iteration_kind, realm.intrinsics().set_iterator_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/SetIterator.h b/Userland/Libraries/LibJS/Runtime/SetIterator.h index 0b1c353255..2cdb828ce5 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIterator.h +++ b/Userland/Libraries/LibJS/Runtime/SetIterator.h @@ -14,6 +14,7 @@ namespace JS { class SetIterator final : public Object { JS_OBJECT(SetIterator, Object); + JS_DECLARE_ALLOCATOR(SetIterator); public: static NonnullGCPtr create(Realm&, Set& set, Object::PropertyKind iteration_kind); diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp index 4078e0c2fe..8c148b8f47 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SetIteratorPrototype); + SetIteratorPrototype::SetIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h index 4bf9e6b85b..6f8a7504cb 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h @@ -13,6 +13,7 @@ namespace JS { class SetIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SetIteratorPrototype, SetIterator, SetIterator); + JS_DECLARE_ALLOCATOR(SetIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp index b3e9cfa627..6709225f8a 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp @@ -20,6 +20,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ShadowRealm); + ShadowRealm::ShadowRealm(Realm& shadow_realm, ExecutionContext execution_context, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) , m_shadow_realm(shadow_realm) diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealm.h b/Userland/Libraries/LibJS/Runtime/ShadowRealm.h index 8c19bc8e60..2653c61359 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealm.h +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealm.h @@ -15,6 +15,7 @@ namespace JS { class ShadowRealm final : public Object { JS_OBJECT(ShadowRealm, Object); + JS_DECLARE_ALLOCATOR(ShadowRealm); public: virtual ~ShadowRealm() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp index 8458fa34d9..06a1f439f3 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ShadowRealmConstructor); + // 3.2 The ShadowRealm Constructor, https://tc39.es/proposal-shadowrealm/#sec-shadowrealm-constructor ShadowRealmConstructor::ShadowRealmConstructor(Realm& realm) : NativeFunction(realm.vm().names.ShadowRealm.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h index 16fae21238..1a56658cf2 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h @@ -12,6 +12,7 @@ namespace JS { class ShadowRealmConstructor final : public NativeFunction { JS_OBJECT(ShadowRealmConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ShadowRealmConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp index c62a2d2b13..de7285c02e 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(ShadowRealmPrototype); + // 3.4 Properties of the ShadowRealm Prototype Object, https://tc39.es/proposal-shadowrealm/#sec-properties-of-the-shadowrealm-prototype-object ShadowRealmPrototype::ShadowRealmPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h index 6e85ad4089..219b942ae6 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h @@ -13,6 +13,7 @@ namespace JS { class ShadowRealmPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ShadowRealmPrototype, ShadowRealm, ShadowRealm); + JS_DECLARE_ALLOCATOR(ShadowRealmPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Shape.cpp b/Userland/Libraries/LibJS/Runtime/Shape.cpp index 1bf5c18388..be6af28432 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.cpp +++ b/Userland/Libraries/LibJS/Runtime/Shape.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Shape); + Shape* Shape::create_unique_clone() const { auto new_shape = heap().allocate_without_realm(m_realm); diff --git a/Userland/Libraries/LibJS/Runtime/Shape.h b/Userland/Libraries/LibJS/Runtime/Shape.h index be591f3563..6b393b7edc 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.h +++ b/Userland/Libraries/LibJS/Runtime/Shape.h @@ -38,6 +38,7 @@ class Shape final : public Cell , public Weakable { JS_CELL(Shape, Cell); + JS_DECLARE_ALLOCATOR(Shape); public: virtual ~Shape() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp index 23ce827e4d..b5c9f98d0f 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SharedArrayBufferConstructor); + SharedArrayBufferConstructor::SharedArrayBufferConstructor(Realm& realm) : NativeFunction(realm.vm().names.SharedArrayBuffer.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h index 9f3a932892..767cb5ee6a 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h @@ -12,6 +12,7 @@ namespace JS { class SharedArrayBufferConstructor final : public NativeFunction { JS_OBJECT(SharedArrayBufferConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(SharedArrayBufferConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp index 0556e22bae..f49812e50d 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SharedArrayBufferPrototype); + SharedArrayBufferPrototype::SharedArrayBufferPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h index f6327d0a21..cf18484a6b 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h @@ -13,6 +13,7 @@ namespace JS { class SharedArrayBufferPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SharedArrayBufferPrototype, ArrayBuffer, SharedArrayBuffer); + JS_DECLARE_ALLOCATOR(SharedArrayBufferPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index 79c7d916db..af5b2cec10 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -18,6 +18,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(StringConstructor); + StringConstructor::StringConstructor(Realm& realm) : NativeFunction(realm.vm().names.String.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.h b/Userland/Libraries/LibJS/Runtime/StringConstructor.h index f05574d541..2b7576bf61 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.h @@ -12,6 +12,7 @@ namespace JS { class StringConstructor final : public NativeFunction { JS_OBJECT(StringConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(StringConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/StringIterator.cpp b/Userland/Libraries/LibJS/Runtime/StringIterator.cpp index e7b790cea2..86c111a8d6 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIterator.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(StringIterator); + NonnullGCPtr StringIterator::create(Realm& realm, String string) { return realm.heap().allocate(realm, move(string), realm.intrinsics().string_iterator_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/StringIterator.h b/Userland/Libraries/LibJS/Runtime/StringIterator.h index 262a3e1c0f..1aa833c503 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIterator.h +++ b/Userland/Libraries/LibJS/Runtime/StringIterator.h @@ -14,6 +14,7 @@ namespace JS { class StringIterator final : public Object { JS_OBJECT(StringIterator, Object); + JS_DECLARE_ALLOCATOR(StringIterator); public: static NonnullGCPtr create(Realm&, String string); diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp index 49d1eda43f..3691aa8091 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(StringIteratorPrototype); + StringIteratorPrototype::StringIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h index 3c7720786b..3f865ee96b 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h @@ -14,6 +14,7 @@ namespace JS { class StringIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(StringIteratorPrototype, StringIterator, StringIterator); + JS_DECLARE_ALLOCATOR(StringIteratorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.cpp b/Userland/Libraries/LibJS/Runtime/StringObject.cpp index f74fb19067..edb27ef0a6 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringObject.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(StringObject); + // 10.4.3.4 StringCreate ( value, prototype ), https://tc39.es/ecma262/#sec-stringcreate NonnullGCPtr StringObject::create(Realm& realm, PrimitiveString& primitive_string, Object& prototype) { diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.h b/Userland/Libraries/LibJS/Runtime/StringObject.h index 9be24bcea0..1280e187ce 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.h +++ b/Userland/Libraries/LibJS/Runtime/StringObject.h @@ -12,6 +12,7 @@ namespace JS { class StringObject : public Object { JS_OBJECT(StringObject, Object); + JS_DECLARE_ALLOCATOR(StringObject); public: [[nodiscard]] static NonnullGCPtr create(Realm&, PrimitiveString&, Object& prototype); diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index ae7f4913c5..da3bb9c8db 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -34,6 +34,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(StringPrototype); + static ThrowCompletionOr utf8_string_from(VM& vm) { auto this_value = TRY(require_object_coercible(vm, vm.this_value())); diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.h b/Userland/Libraries/LibJS/Runtime/StringPrototype.h index 76670eb3a8..5c20ca164b 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.h @@ -23,6 +23,7 @@ ThrowCompletionOr trim_string(VM&, Value string, TrimMode where); class StringPrototype final : public StringObject { JS_OBJECT(StringPrototype, StringObject); + JS_DECLARE_ALLOCATOR(StringPrototype); public: explicit StringPrototype(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedError.cpp b/Userland/Libraries/LibJS/Runtime/SuppressedError.cpp index 92f463bce6..fab9310af7 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedError.cpp +++ b/Userland/Libraries/LibJS/Runtime/SuppressedError.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SuppressedError); + NonnullGCPtr SuppressedError::create(Realm& realm) { return realm.heap().allocate(realm, realm.intrinsics().suppressed_error_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedError.h b/Userland/Libraries/LibJS/Runtime/SuppressedError.h index 9839cd2a9f..ca52ba9798 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedError.h +++ b/Userland/Libraries/LibJS/Runtime/SuppressedError.h @@ -12,6 +12,7 @@ namespace JS { class SuppressedError : public Error { JS_OBJECT(SuppressedError, Error); + JS_DECLARE_ALLOCATOR(SuppressedError); public: static NonnullGCPtr create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp index 4ed600dbcd..baf180925f 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp @@ -14,6 +14,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SuppressedErrorConstructor); + SuppressedErrorConstructor::SuppressedErrorConstructor(Realm& realm) : NativeFunction(static_cast(realm.intrinsics().error_constructor())) { diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h index f27672ed20..591a5d3acb 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h @@ -12,6 +12,7 @@ namespace JS { class SuppressedErrorConstructor final : public NativeFunction { JS_OBJECT(SuppressedErrorConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(SuppressedErrorConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp index 0ad46734ef..5de8c16279 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SuppressedErrorPrototype); + SuppressedErrorPrototype::SuppressedErrorPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().error_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h index 27791d6d7d..7f949c2e24 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h @@ -12,6 +12,7 @@ namespace JS { class SuppressedErrorPrototype final : public Object { JS_OBJECT(SuppressedErrorPrototype, Object); + JS_DECLARE_ALLOCATOR(SuppressedErrorPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Symbol.h b/Userland/Libraries/LibJS/Runtime/Symbol.h index c75bd9f97f..440d75169d 100644 --- a/Userland/Libraries/LibJS/Runtime/Symbol.h +++ b/Userland/Libraries/LibJS/Runtime/Symbol.h @@ -14,6 +14,7 @@ namespace JS { class Symbol final : public Cell { JS_CELL(Symbol, Cell); + JS_DECLARE_ALLOCATOR(Symbol); public: [[nodiscard]] static NonnullGCPtr create(VM&, Optional description, bool is_global); diff --git a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp index 8dd63702cd..8b6a3ebf84 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SymbolConstructor); + SymbolConstructor::SymbolConstructor(Realm& realm) : NativeFunction(realm.vm().names.Symbol.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h index 01fee91c62..c9943c3ea6 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h @@ -12,6 +12,7 @@ namespace JS { class SymbolConstructor final : public NativeFunction { JS_OBJECT(SymbolConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(SymbolConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/SymbolObject.cpp b/Userland/Libraries/LibJS/Runtime/SymbolObject.cpp index a727bb43b9..430d3e1469 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolObject.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SymbolObject); + NonnullGCPtr SymbolObject::create(Realm& realm, Symbol& primitive_symbol) { return realm.heap().allocate(realm, primitive_symbol, realm.intrinsics().symbol_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/SymbolObject.h b/Userland/Libraries/LibJS/Runtime/SymbolObject.h index 6f7e24792e..dfe5b4fcce 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolObject.h +++ b/Userland/Libraries/LibJS/Runtime/SymbolObject.h @@ -13,6 +13,7 @@ namespace JS { class SymbolObject : public Object { JS_OBJECT(SymbolObject, Object); + JS_DECLARE_ALLOCATOR(SymbolObject); public: static NonnullGCPtr create(Realm&, Symbol&); diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp index c0b0977af5..9b9042dd1b 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp @@ -18,6 +18,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SymbolPrototype); + SymbolPrototype::SymbolPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h index 9f0bd4e8eb..707a6c76e4 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h @@ -12,6 +12,7 @@ namespace JS { class SymbolPrototype final : public Object { JS_OBJECT(SymbolPrototype, Object); + JS_DECLARE_ALLOCATOR(SymbolPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index 7f7e85f19c..a517b02b7b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -27,6 +27,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(Calendar); + // 12 Temporal.Calendar Objects, https://tc39.es/proposal-temporal/#sec-temporal-calendar-objects Calendar::Calendar(String identifier, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.h b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.h index 0af58b2059..b346b4fe73 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.h @@ -18,6 +18,7 @@ namespace JS::Temporal { class Calendar final : public Object { JS_OBJECT(Calendar, Object); + JS_DECLARE_ALLOCATOR(Calendar); public: virtual ~Calendar() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp index 267d4148c7..0dfd873477 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp @@ -10,6 +10,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(CalendarConstructor); + // 12.2 The Temporal.Calendar Constructor, https://tc39.es/proposal-temporal/#sec-temporal-calendar-constructor CalendarConstructor::CalendarConstructor(Realm& realm) : NativeFunction(realm.vm().names.Calendar.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h index 67476a8238..c37e1f088d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class CalendarConstructor final : public NativeFunction { JS_OBJECT(CalendarConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(CalendarConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp index fe8ab34f61..043140aeeb 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp @@ -19,6 +19,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(CalendarPrototype); + [[nodiscard]] static i32 iso_year(Object& temporal_object); [[nodiscard]] static u8 iso_month(Object& temporal_object); [[nodiscard]] static u8 iso_day(Object& temporal_object); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h index 38cc71dab1..1390b94eac 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class CalendarPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(CalendarPrototype, Calendar, Temporal.Calendar); + JS_DECLARE_ALLOCATOR(CalendarPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp index 515be61880..f3a0112d97 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp @@ -23,6 +23,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(Duration); + // 7 Temporal.Duration Objects, https://tc39.es/proposal-temporal/#sec-temporal-duration-objects Duration::Duration(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h index decc5885b3..dfdeccfe0e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h @@ -19,6 +19,7 @@ namespace JS::Temporal { class Duration final : public Object { JS_OBJECT(Duration, Object); + JS_DECLARE_ALLOCATOR(Duration); public: virtual ~Duration() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h index ffe4d78245..1b012dd90a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class DurationConstructor final : public NativeFunction { JS_OBJECT(DurationConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(DurationConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp index 2386061580..afd5315444 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp @@ -14,6 +14,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(DurationPrototype); + // 7.3 Properties of the Temporal.Duration Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-duration-prototype-object DurationPrototype::DurationPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h index 07996aa841..4d4fb7932f 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class DurationPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DurationPrototype, Duration, Temporal.Duration); + JS_DECLARE_ALLOCATOR(DurationPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp index 180f8e630f..58773d2f14 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp @@ -22,6 +22,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(Instant); + // 8 Temporal.Instant Objects, https://tc39.es/proposal-temporal/#sec-temporal-instant-objects Instant::Instant(BigInt const& nanoseconds, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h index 96ba6918fc..7249837ebd 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h @@ -18,6 +18,7 @@ namespace JS::Temporal { class Instant final : public Object { JS_OBJECT(Instant, Object); + JS_DECLARE_ALLOCATOR(Instant); public: virtual ~Instant() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp index 3fed60a7c7..36706d3aa9 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp @@ -13,6 +13,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(InstantConstructor); + // 8.1 The Temporal.Instant Constructor, https://tc39.es/proposal-temporal/#sec-temporal-instant-constructor InstantConstructor::InstantConstructor(Realm& realm) : NativeFunction(realm.vm().names.Instant.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h index f6a1844040..80014a3713 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class InstantConstructor final : public NativeFunction { JS_OBJECT(InstantConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(InstantConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp index 67b7f3be0a..ac07dcaf83 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp @@ -18,6 +18,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(InstantPrototype); + // 8.3 Properties of the Temporal.Instant Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-instant-prototype-object InstantPrototype::InstantPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h index 80899bd45d..a5bd989648 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class InstantPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(InstantPrototype, Instant, Temporal.Instant); + JS_DECLARE_ALLOCATOR(InstantPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp index b2886dc012..5eaa163811 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp @@ -20,6 +20,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(Now); + // 2 The Temporal.Now Object, https://tc39.es/proposal-temporal/#sec-temporal-now-object Now::Now(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Now.h b/Userland/Libraries/LibJS/Runtime/Temporal/Now.h index c6821b5c43..c420d748bc 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Now.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Now.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class Now final : public Object { JS_OBJECT(Now, Object); + JS_DECLARE_ALLOCATOR(Now); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 5e2ac52611..ea8c0272c3 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -22,6 +22,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainDate); + // 3 Temporal.PlainDate Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-objects PlainDate::PlainDate(i32 year, u8 month, u8 day, Object& calendar, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h index 8e9cd8c73d..ee545c662f 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.h @@ -16,6 +16,7 @@ namespace JS::Temporal { class PlainDate final : public Object { JS_OBJECT(PlainDate, Object); + JS_DECLARE_ALLOCATOR(PlainDate); public: virtual ~PlainDate() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp index eb430982e7..00f7a71513 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainDateConstructor); + // 3.1 The Temporal.PlainDate Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-constructor PlainDateConstructor::PlainDateConstructor(Realm& realm) : NativeFunction(realm.vm().names.PlainDate.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h index e6f13118a7..bc51a6a6e6 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class PlainDateConstructor final : public NativeFunction { JS_OBJECT(PlainDateConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PlainDateConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp index 12d6d45d24..66db9348a0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp @@ -19,6 +19,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainDatePrototype); + // 3.3 Properties of the Temporal.PlainDate Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plaindate-prototype-object PlainDatePrototype::PlainDatePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h index dd3d45c837..9a909ed423 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class PlainDatePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PlainDatePrototype, PlainDate, Temporal.PlainDate); + JS_DECLARE_ALLOCATOR(PlainDatePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp index 537345ca30..67d3e34369 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp @@ -23,6 +23,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainDateTime); + // 5 Temporal.PlainDateTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-objects PlainDateTime::PlainDateTime(i32 iso_year, u8 iso_month, u8 iso_day, u8 iso_hour, u8 iso_minute, u8 iso_second, u16 iso_millisecond, u16 iso_microsecond, u16 iso_nanosecond, Object& calendar, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.h index fa4c776a77..3da7dd5a1c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.h @@ -17,6 +17,7 @@ namespace JS::Temporal { class PlainDateTime final : public Object { JS_OBJECT(PlainDateTime, Object); + JS_DECLARE_ALLOCATOR(PlainDateTime); public: virtual ~PlainDateTime() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp index 4151718c9d..405084b2f0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainDateTimeConstructor); + // 5.1 The Temporal.PlainDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-constructor PlainDateTimeConstructor::PlainDateTimeConstructor(Realm& realm) : NativeFunction(realm.vm().names.PlainDateTime.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h index d1f5bd67e5..321ca75a14 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class PlainDateTimeConstructor final : public NativeFunction { JS_OBJECT(PlainDateTimeConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PlainDateTimeConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp index 91078543b8..deda86885c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp @@ -20,6 +20,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainDateTimePrototype); + // 5.3 Properties of the Temporal.PlainDateTime Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plaindatetime-prototype-object PlainDateTimePrototype::PlainDateTimePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h index b657fa55e4..7d3ef1721e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class PlainDateTimePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PlainDateTimePrototype, PlainDateTime, Temporal.PlainDateTime); + JS_DECLARE_ALLOCATOR(PlainDateTimePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp index 4315e03997..7ac70e7d95 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp @@ -18,6 +18,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainMonthDay); + // 10 Temporal.PlainMonthDay Objects, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-objects PlainMonthDay::PlainMonthDay(u8 iso_month, u8 iso_day, i32 iso_year, Object& calendar, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.h index 57c4fba339..ea2d59f00b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class PlainMonthDay final : public Object { JS_OBJECT(PlainMonthDay, Object); + JS_DECLARE_ALLOCATOR(PlainMonthDay); public: virtual ~PlainMonthDay() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp index c4c4c952f2..2eae0df4cd 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp @@ -13,6 +13,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainMonthDayConstructor); + // 10.1 The Temporal.PlainMonthDay Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-constructor PlainMonthDayConstructor::PlainMonthDayConstructor(Realm& realm) : NativeFunction(realm.vm().names.PlainMonthDay.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h index 136c7d1526..3a8a3098ea 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class PlainMonthDayConstructor final : public NativeFunction { JS_OBJECT(PlainMonthDayConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PlainMonthDayConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp index f748b4e58d..9e5350ab3e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp @@ -14,6 +14,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainMonthDayPrototype); + // 10.3 Properties of the Temporal.PlainMonthDay Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plainmonthday-prototype-object PlainMonthDayPrototype::PlainMonthDayPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h index c20cf81468..fdc7ea9412 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class PlainMonthDayPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PlainMonthDayPrototype, PlainMonthDay, Temporal.PlainMonthDay); + JS_DECLARE_ALLOCATOR(PlainMonthDayPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp index e31da74d04..cc50e328a3 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp @@ -22,6 +22,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainTime); + // 4 Temporal.PlainTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-objects PlainTime::PlainTime(u8 iso_hour, u8 iso_minute, u8 iso_second, u16 iso_millisecond, u16 iso_microsecond, u16 iso_nanosecond, Calendar& calendar, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h index 1c44ee5b02..1f4d2e1dca 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h @@ -17,6 +17,7 @@ namespace JS::Temporal { class PlainTime final : public Object { JS_OBJECT(PlainDateTime, Object); + JS_DECLARE_ALLOCATOR(PlainTime); public: virtual ~PlainTime() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp index 1505bb9adc..0b4237246b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp @@ -12,6 +12,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainTimeConstructor); + // 4.1 The Temporal.PlainTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-constructor PlainTimeConstructor::PlainTimeConstructor(Realm& realm) : NativeFunction(realm.vm().names.PlainTime.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h index 0f03dec2db..05788273c0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class PlainTimeConstructor final : public NativeFunction { JS_OBJECT(PlainTimeConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PlainTimeConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp index 9ac4fbdb89..6709e3b788 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp @@ -19,6 +19,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainTimePrototype); + // 4.3 Properties of the Temporal.PlainTime Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plaintime-prototype-object PlainTimePrototype::PlainTimePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h index 00bdbf5423..b20bdb5099 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class PlainTimePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PlainTimePrototype, PlainTime, Temporal.PlainTime); + JS_DECLARE_ALLOCATOR(PlainTimePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index e333ce1ae0..4eb3d84c18 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -17,6 +17,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainYearMonth); + // 9 Temporal.PlainYearMonth Objects, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-objects PlainYearMonth::PlainYearMonth(i32 iso_year, u8 iso_month, u8 iso_day, Object& calendar, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.h index db7d66f5f7..8245037bd7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class PlainYearMonth final : public Object { JS_OBJECT(PlainYearMonth, Object); + JS_DECLARE_ALLOCATOR(PlainYearMonth); public: virtual ~PlainYearMonth() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp index b200b6f970..1889b4e737 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainYearMonthConstructor); + // 9.1 The Temporal.PlainYearMonth Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-constructor PlainYearMonthConstructor::PlainYearMonthConstructor(Realm& realm) : NativeFunction(realm.vm().names.PlainYearMonth.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h index 1f51297e27..95966b24dd 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class PlainYearMonthConstructor final : public NativeFunction { JS_OBJECT(PlainYearMonthConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(PlainYearMonthConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp index 851725db12..a34cfa4cf0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp @@ -16,6 +16,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(PlainYearMonthPrototype); + // 9.3 Properties of the Temporal.PlainYearMonth Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-plainyearmonth-prototype-object PlainYearMonthPrototype::PlainYearMonthPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h index 3e987a077d..f5e1cbfd3a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class PlainYearMonthPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(PlainYearMonthPrototype, PlainYearMonth, Temporal.PlainYearMonth); + JS_DECLARE_ALLOCATOR(PlainYearMonthPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp index dd69f8a5df..2d6b7ab520 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp @@ -20,6 +20,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(Temporal); + // 1 The Temporal Object, https://tc39.es/proposal-temporal/#sec-temporal-objects Temporal::Temporal(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h index 90c6a45251..ed083f3788 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class Temporal final : public Object { JS_OBJECT(Temporal, Object); + JS_DECLARE_ALLOCATOR(Temporal); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp index 7f8c3ef1a6..6baf24745d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp @@ -22,6 +22,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(TimeZone); + // 11 Temporal.TimeZone Objects, https://tc39.es/proposal-temporal/#sec-temporal-timezone-objects TimeZone::TimeZone(Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.h b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.h index 89327ef1c4..f2c6056cdd 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.h @@ -15,6 +15,7 @@ namespace JS::Temporal { class TimeZone final : public Object { JS_OBJECT(TimeZone, Object); + JS_DECLARE_ALLOCATOR(TimeZone); public: // Needs to store values in the range -8.64 * 10^13 to 8.64 * 10^13 diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp index c5071d7ee0..8e27e2e6e6 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp @@ -11,6 +11,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(TimeZoneConstructor); + // 11.2 The Temporal.TimeZone Constructor, https://tc39.es/proposal-temporal/#sec-temporal-timezone-constructor TimeZoneConstructor::TimeZoneConstructor(Realm& realm) : NativeFunction(realm.vm().names.TimeZone.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h index 5de3ea1e26..163ce8dae7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class TimeZoneConstructor final : public NativeFunction { JS_OBJECT(TimeZoneConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(TimeZoneConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp index c5747aa7cf..ae4ba2592b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp @@ -17,6 +17,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(TimeZonePrototype); + // 11.4 Properties of the Temporal.TimeZone Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-timezone-prototype-object TimeZonePrototype::TimeZonePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h index a1fb7f9103..8a9c79cac3 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class TimeZonePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(TimeZonePrototype, TimeZone, Temporal.TimeZone); + JS_DECLARE_ALLOCATOR(TimeZonePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp index 6a79a604a4..e882d31794 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp @@ -20,6 +20,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(ZonedDateTime); + // 6 Temporal.ZonedDateTime Objects, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-objects ZonedDateTime::ZonedDateTime(BigInt const& nanoseconds, Object& time_zone, Object& calendar, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h index 50d95b80a7..42c5f07185 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.h @@ -14,6 +14,7 @@ namespace JS::Temporal { class ZonedDateTime final : public Object { JS_OBJECT(ZonedDateTime, Object); + JS_DECLARE_ALLOCATOR(ZonedDateTime); public: virtual ~ZonedDateTime() override = default; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp index 551d97fb8e..18ece4731b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp @@ -15,6 +15,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(ZonedDateTimeConstructor); + // 6.1 The Temporal.ZonedDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-constructor ZonedDateTimeConstructor::ZonedDateTimeConstructor(Realm& realm) : NativeFunction(realm.vm().names.ZonedDateTime.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h index b1779d8206..423cb61658 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h @@ -12,6 +12,7 @@ namespace JS::Temporal { class ZonedDateTimeConstructor final : public NativeFunction { JS_OBJECT(ZonedDateTimeConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(ZonedDateTimeConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index 6c12387de3..c1a5657c11 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -20,6 +20,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(ZonedDateTimePrototype); + // 6.3 Properties of the Temporal.ZonedDateTime Prototype Object, https://tc39.es/proposal-temporal/#sec-properties-of-the-temporal-zoneddatetime-prototype-object ZonedDateTimePrototype::ZonedDateTimePrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h index 4e92877448..4ac0170f77 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h @@ -13,6 +13,7 @@ namespace JS::Temporal { class ZonedDateTimePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ZonedDateTimePrototype, ZonedDateTime, Temporal.ZonedDateTime); + JS_DECLARE_ALLOCATOR(ZonedDateTimePrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 76bb15398a..2d10af0715 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -421,6 +421,9 @@ void TypedArrayBase::visit_edges(Visitor& visitor) } #define JS_DEFINE_TYPED_ARRAY(ClassName, snake_name, PrototypeName, ConstructorName, Type) \ + JS_DEFINE_ALLOCATOR(ClassName); \ + JS_DEFINE_ALLOCATOR(PrototypeName); \ + JS_DEFINE_ALLOCATOR(ConstructorName); \ ThrowCompletionOr> ClassName::create(Realm& realm, u32 length, FunctionObject& new_target) \ { \ auto* prototype = TRY(get_prototype_from_constructor(realm.vm(), new_target, &Intrinsics::snake_name##_prototype)); \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h index 50c1a5e3eb..6a7a2d6e3c 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h @@ -464,6 +464,7 @@ ThrowCompletionOr compare_typed_array_elements(VM&, Value x, Value y, Fu #define JS_DECLARE_TYPED_ARRAY(ClassName, snake_name, PrototypeName, ConstructorName, Type) \ class ClassName : public TypedArray { \ JS_OBJECT(ClassName, TypedArray); \ + JS_DECLARE_ALLOCATOR(ClassName); \ \ public: \ virtual ~ClassName(); \ @@ -477,6 +478,7 @@ ThrowCompletionOr compare_typed_array_elements(VM&, Value x, Value y, Fu }; \ class PrototypeName final : public Object { \ JS_OBJECT(PrototypeName, Object); \ + JS_DECLARE_ALLOCATOR(PrototypeName); \ \ public: \ virtual void initialize(Realm&) override; \ @@ -487,6 +489,7 @@ ThrowCompletionOr compare_typed_array_elements(VM&, Value x, Value y, Fu }; \ class ConstructorName final : public TypedArrayConstructor { \ JS_OBJECT(ConstructorName, TypedArrayConstructor); \ + JS_DECLARE_ALLOCATOR(ConstructorName); \ \ public: \ virtual void initialize(Realm&) override; \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp index 47b7b1c97b..8ebe1ed3a5 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(TypedArrayConstructor); + TypedArrayConstructor::TypedArrayConstructor(DeprecatedFlyString const& name, Object& prototype) : NativeFunction(name, prototype) { diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h index 3d9ae5a08e..686ebdef48 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h @@ -12,6 +12,7 @@ namespace JS { class TypedArrayConstructor : public NativeFunction { JS_OBJECT(TypedArrayConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(TypedArrayConstructor); public: explicit TypedArrayConstructor(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index 167b9e7229..9e177edd20 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -17,6 +17,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(TypedArrayPrototype); + TypedArrayPrototype::TypedArrayPrototype(Realm& realm) : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h index cb73efd9eb..684c8e246b 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h @@ -13,6 +13,7 @@ namespace JS { class TypedArrayPrototype final : public Object { JS_OBJECT(TypedArrayPrototype, Object); + JS_DECLARE_ALLOCATOR(TypedArrayPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakMap.cpp b/Userland/Libraries/LibJS/Runtime/WeakMap.cpp index e8ea40a0a9..b7c3678a92 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMap.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMap.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakMap); + NonnullGCPtr WeakMap::create(Realm& realm) { return realm.heap().allocate(realm, realm.intrinsics().weak_map_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/WeakMap.h b/Userland/Libraries/LibJS/Runtime/WeakMap.h index e99ca29c3a..3f1a79a4c4 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMap.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMap.h @@ -17,6 +17,7 @@ class WeakMap final : public Object , public WeakContainer { JS_OBJECT(WeakMap, Object); + JS_DECLARE_ALLOCATOR(WeakMap); public: static NonnullGCPtr create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp index 47d8561399..eff6e31194 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakMapConstructor); + WeakMapConstructor::WeakMapConstructor(Realm& realm) : NativeFunction(realm.vm().names.WeakMap.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h index 57810ad481..10d31f4687 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h @@ -12,6 +12,7 @@ namespace JS { class WeakMapConstructor final : public NativeFunction { JS_OBJECT(WeakMapConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(WeakMapConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp index 2a3396be3e..9b56f51b67 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakMapPrototype); + WeakMapPrototype::WeakMapPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h index 32aec28120..4526d90296 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h @@ -13,6 +13,7 @@ namespace JS { class WeakMapPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(WeakMapPrototype, WeakMap, WeakMap); + JS_DECLARE_ALLOCATOR(WeakMapPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp index 05a745878d..7ce7d23c54 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakRef); + NonnullGCPtr WeakRef::create(Realm& realm, Object& value) { return realm.heap().allocate(realm, value, realm.intrinsics().weak_ref_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.h b/Userland/Libraries/LibJS/Runtime/WeakRef.h index a4e3704104..9b054e5bac 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.h @@ -16,6 +16,7 @@ class WeakRef final : public Object , public WeakContainer { JS_OBJECT(WeakRef, Object); + JS_DECLARE_ALLOCATOR(WeakRef); public: static NonnullGCPtr create(Realm&, Object&); diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp index c5d951da9f..d77ab2a8a2 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakRefConstructor); + WeakRefConstructor::WeakRefConstructor(Realm& realm) : NativeFunction(realm.vm().names.WeakRef.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h index a3afbf755f..9e8d66031f 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h @@ -12,6 +12,7 @@ namespace JS { class WeakRefConstructor final : public NativeFunction { JS_OBJECT(WeakRefConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(WeakRefConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp index 9c1d19f169..3f2a1dd304 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp @@ -9,6 +9,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakRefPrototype); + WeakRefPrototype::WeakRefPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h index 3dbe323a7d..a2e4fcfb6f 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h @@ -13,6 +13,7 @@ namespace JS { class WeakRefPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(WeakRefPrototype, WeakRef, WeakRef); + JS_DECLARE_ALLOCATOR(WeakRefPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakSet.cpp b/Userland/Libraries/LibJS/Runtime/WeakSet.cpp index be911056bd..a340c35cea 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSet.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSet.cpp @@ -8,6 +8,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakSet); + NonnullGCPtr WeakSet::create(Realm& realm) { return realm.heap().allocate(realm, realm.intrinsics().weak_set_prototype()); diff --git a/Userland/Libraries/LibJS/Runtime/WeakSet.h b/Userland/Libraries/LibJS/Runtime/WeakSet.h index d58defbba0..a562b6a3a5 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSet.h +++ b/Userland/Libraries/LibJS/Runtime/WeakSet.h @@ -17,6 +17,7 @@ class WeakSet final : public Object , public WeakContainer { JS_OBJECT(WeakSet, Object); + JS_DECLARE_ALLOCATOR(WeakSet); public: static NonnullGCPtr create(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp index d61d3816ad..bc21497416 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakSetConstructor); + WeakSetConstructor::WeakSetConstructor(Realm& realm) : NativeFunction(realm.vm().names.WeakSet.as_string(), realm.intrinsics().function_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h index 7e423630d0..650439713f 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h @@ -12,6 +12,7 @@ namespace JS { class WeakSetConstructor final : public NativeFunction { JS_OBJECT(WeakSetConstructor, NativeFunction); + JS_DECLARE_ALLOCATOR(WeakSetConstructor); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp index a361a95573..956ba88ede 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WeakSetPrototype); + WeakSetPrototype::WeakSetPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h index 2a01447bef..6121578b7d 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h @@ -13,6 +13,7 @@ namespace JS { class WeakSetPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(WeakSetPrototype, WeakSet, WeakSet); + JS_DECLARE_ALLOCATOR(WeakSetPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp b/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp index 4234568663..3a2ec747bc 100644 --- a/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WrappedFunction); + // 3.1.1 WrappedFunctionCreate ( callerRealm: a Realm Record, Target: a function object, ), https://tc39.es/proposal-shadowrealm/#sec-wrappedfunctioncreate ThrowCompletionOr> WrappedFunction::create(Realm& realm, Realm& caller_realm, FunctionObject& target) { diff --git a/Userland/Libraries/LibJS/Runtime/WrappedFunction.h b/Userland/Libraries/LibJS/Runtime/WrappedFunction.h index a0696163df..c7deb252f2 100644 --- a/Userland/Libraries/LibJS/Runtime/WrappedFunction.h +++ b/Userland/Libraries/LibJS/Runtime/WrappedFunction.h @@ -13,6 +13,7 @@ namespace JS { class WrappedFunction final : public FunctionObject { JS_OBJECT(WrappedFunction, FunctionObject); + JS_DECLARE_ALLOCATOR(WrappedFunction); public: static ThrowCompletionOr> create(Realm&, Realm& caller_realm, FunctionObject& target_function); diff --git a/Userland/Libraries/LibJS/Script.cpp b/Userland/Libraries/LibJS/Script.cpp index 9373c0d113..80fbc4efea 100644 --- a/Userland/Libraries/LibJS/Script.cpp +++ b/Userland/Libraries/LibJS/Script.cpp @@ -12,6 +12,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Script); + // 16.1.5 ParseScript ( sourceText, realm, hostDefined ), https://tc39.es/ecma262/#sec-parse-script Result, Vector> Script::parse(StringView source_text, Realm& realm, StringView filename, HostDefined* host_defined, size_t line_number_offset) { diff --git a/Userland/Libraries/LibJS/Script.h b/Userland/Libraries/LibJS/Script.h index c3921ae5c0..4b8af18324 100644 --- a/Userland/Libraries/LibJS/Script.h +++ b/Userland/Libraries/LibJS/Script.h @@ -17,6 +17,7 @@ namespace JS { // 16.1.4 Script Records, https://tc39.es/ecma262/#sec-script-records class Script final : public Cell { JS_CELL(Script, Cell); + JS_DECLARE_ALLOCATOR(Script); public: struct HostDefined { diff --git a/Userland/Libraries/LibJS/SourceTextModule.cpp b/Userland/Libraries/LibJS/SourceTextModule.cpp index 501915697a..2fb34a780b 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.cpp +++ b/Userland/Libraries/LibJS/SourceTextModule.cpp @@ -16,6 +16,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SourceTextModule); + // 2.7 Static Semantics: AssertClauseToAssertions, https://tc39.es/proposal-import-assertions/#sec-assert-clause-to-assertions static Vector assert_clause_to_assertions(Vector const& source_assertions, Vector const& supported_import_assertions) { diff --git a/Userland/Libraries/LibJS/SourceTextModule.h b/Userland/Libraries/LibJS/SourceTextModule.h index 5bef17696d..8466f89af9 100644 --- a/Userland/Libraries/LibJS/SourceTextModule.h +++ b/Userland/Libraries/LibJS/SourceTextModule.h @@ -16,6 +16,7 @@ namespace JS { // 16.2.1.6 Source Text Module Records, https://tc39.es/ecma262/#sec-source-text-module-records class SourceTextModule final : public CyclicModule { JS_CELL(SourceTextModule, CyclicModule); + JS_DECLARE_ALLOCATOR(SourceTextModule); public: static Result, Vector> parse(StringView source_text, Realm&, StringView filename = {}, Script::HostDefined* host_defined = nullptr); diff --git a/Userland/Libraries/LibJS/SyntheticModule.cpp b/Userland/Libraries/LibJS/SyntheticModule.cpp index 5a1411ff89..69fc78ec24 100644 --- a/Userland/Libraries/LibJS/SyntheticModule.cpp +++ b/Userland/Libraries/LibJS/SyntheticModule.cpp @@ -13,6 +13,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SyntheticModule); + // 1.2.1 CreateSyntheticModule ( exportNames, evaluationSteps, realm, hostDefined ), https://tc39.es/proposal-json-modules/#sec-createsyntheticmodule SyntheticModule::SyntheticModule(Vector export_names, SyntheticModule::EvaluationFunction evaluation_steps, Realm& realm, StringView filename) : Module(realm, filename) diff --git a/Userland/Libraries/LibJS/SyntheticModule.h b/Userland/Libraries/LibJS/SyntheticModule.h index 18f4ea2084..bc428fdd9c 100644 --- a/Userland/Libraries/LibJS/SyntheticModule.h +++ b/Userland/Libraries/LibJS/SyntheticModule.h @@ -13,6 +13,7 @@ namespace JS { // 1.2 Synthetic Module Records, https://tc39.es/proposal-json-modules/#sec-synthetic-module-records class SyntheticModule final : public Module { JS_CELL(SyntheticModule, Module); + JS_DECLARE_ALLOCATOR(SyntheticModule); public: using EvaluationFunction = Function(SyntheticModule&)>;