diff --git a/Userland/Libraries/LibJS/CMakeLists.txt b/Userland/Libraries/LibJS/CMakeLists.txt index ba2ceb06927..1b02737384a 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 d39a277560a..eebff484b82 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 9744576bd84..880152b8823 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 910054e2d52..2cc3a385534 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 8810b4751cd..d70f4f2ca3e 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 3741b2671c2..843dd8eadac 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 d4165480752..075cbfd3327 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 06b931182ea..2f2567a20c8 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 f8b1788b0ab..e1639bb80da 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 59a9663834d..59eba5bc4f3 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 f3daaacfa93..fc809ff1a09 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 8e92f08568b..2474acf587e 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 2883792d511..3889dd99871 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 d70c3d93ff7..bb2d3facb06 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 7190b961d09..4161cbd2343 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 c085eafdc81..671e25771cb 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 00000000000..d76ebea6b0b --- /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 52fbaf8e516..51a7cacdcec 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 b1b55bdbf43..1ad94ba7f50 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 6b295287e18..9d68d748134 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 fa13c71cce3..3709b3ed176 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 ee146040aba..62229bdd4b8 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 488c5b8cc5c..f69bfbfa638 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 420a0864f0b..83a307b64eb 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 49eb944a633..8183c3d2d44 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 ebb70e44861..261b5d7c273 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 7fc55f9aed4..2222935c4ad 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 9da03e401e2..8197c489e77 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 3d12c26bd30..f1bced47884 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 a037660b26b..80a7077ea1e 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 ca09ebdbecc..1fa1fc3d0d7 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 60a4fb82a75..041fb1360c7 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 567026973f6..34d5911076c 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 d3eb4bf3485..d624e894e8b 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 c86c65c43ec..4eeba5b47fb 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 67457735517..e76a7f63990 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 e2d5ac99807..fa58eef5c56 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 7bee8031ad2..47575633e2c 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 75efd03c355..3dcc9ada4d0 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 25c53bdcec9..34e2c22e7e9 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 392fa47d3fe..86d9a6ae22c 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 1b29a08b5ab..552d99cc5c0 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 ab18c3ce70b..d226c2baad4 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 9b827a976a7..4088fd07c78 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 569f15c4745..0ce3388170a 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 aacc5bd8c3b..3eb60afe849 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 656d4837aa5..5eecb34fa36 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 cf117532025..4a3795d0295 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 fe9b8553a65..5486b944227 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 5ddcd86ec0a..fe7a9d7d5b6 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 6ca69d33271..8b98fd144b3 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 44a532f8bcd..4bec053fbf7 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 4d1f673ce6b..8ee7a38a716 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 51ed6ab20ed..46268d63477 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 6e3ba3849bf..1051184b650 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 0b1a4e26d2b..351520ace8d 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 83bb2b19815..f56da2e4e3e 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 602a947d947..209fd76dffb 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 174ff51c91a..de1f81c916d 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 03ab34fe350..a231e72358e 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 f5600a9cf18..ead650764e1 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 07f2f962aa0..4a08ff249ec 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 d8d16829964..80f271065ae 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 1e245d8590b..10d1763b701 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 6cf4306c6cc..9026b0d0a56 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 bb937a71e4d..8d1598fcd7f 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 58c83a4002a..6284f7a4758 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 59335e33189..0dd08537f5e 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 c0e7b739341..233e0c7329f 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 3dcf808c63f..d0d0b232805 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 c96a865f214..32ff899648a 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 ca95f9684b8..b6f87390ba6 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 14f32fc2377..3ce42d580db 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 3520b64a1d8..3cd4be965cd 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 37d9f0ca80c..a357c94c062 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 9fddd976f29..609d3d2c9f0 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 0d3e1c715ed..6729f38e293 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 83af2e841d3..0db725dd2c9 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 82e34d745fa..1628b4d0ae3 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 0e9fbf3675c..c85c6f18766 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 681ded39a18..20806c9aad7 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 29b2cadb36b..d970b7c27ea 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 905e553772e..0535a08cd33 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 920cd4be2ef..e97ab5eb0c4 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 176faf2a58c..891f188999f 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 632c4e0e86d..81cd43688a4 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 5a8c0c16097..3d8263d5edc 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 7138918922f..3173ab7a808 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 8d8ddc8824f..2836b8ec433 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 c25543b3a40..5f7d64e32e0 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 4fb41013e54..6b7cd9fd590 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 7e66408ffa4..5b9ef47efdd 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 b94201894c0..19783b99632 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 c54223ccffb..8b4bb405997 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 22cb022e279..b972e9f7de0 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 a378371ea82..dc89bb11dd8 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 e54ad354b00..62fe33d1655 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 77b846f5595..36af8e047d7 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 8e2c4fad0ec..7b9b06aaa7f 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 b512657a368..6a190c2011b 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 15e0896926d..d6a6ead81de 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 6b093a12aab..158674f9872 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 808c6b456f5..e50d7b9045d 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 78ade0b336e..21184d8e20c 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 fb7f6c6bf69..e01cc47d2b5 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 54a808c3048..fd99bbff132 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 43c0bf50e3d..8b7786720ad 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 2bc69963083..29fbf37bc26 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 fd5828c3b3e..9d5d4d7ce72 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 7be8d62fa42..aa8a06c9aae 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 ef7fda2010b..fb172330172 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 53fc1c1638d..fa027027392 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 f3beec5b002..c679a78ec58 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 a93a1c23154..7ec4a3a22cf 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 5b78571f200..792a5856edf 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 a63e759ca71..ba6dd01e650 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 05fef5bf3a3..506bc5798e0 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 1cf6ad0613b..9d3ce488af6 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 8bd49a791e4..756e293189c 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 4baab41344d..5bf51f166a0 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 f8d35f69ff9..f5d17a883eb 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 77919d5abc1..ea1378b706e 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 289b90e5273..a66f8b5c787 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 f73ef9e0d84..69afe6ebc85 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 b8a64c79ce8..c85d4154f6c 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 84c34834585..ecff00d2093 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 1d5022fe710..3f1cd97653e 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 bfbadddec07..722b3c4c876 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 835d46c380e..7637469b977 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 079e76c5caf..fd72f2243dd 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 08e6a2edcfa..c0d5512bc61 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 ea0b7707022..634f8a2f481 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 476d19165e9..8a51164cb27 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 c40a1f82968..00c499ae5d0 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 fa2355888db..175e629b5b6 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 1a1d090e21e..207f8830540 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 52ed7123a69..faae88b4b6f 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 d01d9ae1c34..89975842282 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 fa289491f0b..bf0f6b625b7 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 19ade8f4572..0c0e91ce032 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 59eb176d315..22116ffdee9 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 f65e6d2f77c..8f8a6a3dcdf 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 d3719a3cd82..d163caa96d1 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 44721d0f80a..395cab19dbb 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 11dc78d27b9..9f39c05425d 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 dd8f380323f..46893524a26 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 57b3688f9a5..ffc12808b9b 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 fa15af8cdb7..ba0d60b2c1d 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 d895c57e68b..92d41572400 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 c72a7bcae3a..563d7c91b2b 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 f928d527ae0..37ed147a7b6 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 ebe0a55f9c0..b10056ccfcd 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 db76370da8a..f356eeb3819 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 68827b3807b..c1dcf1a4f29 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 ab77ea05872..c30f3982f1a 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 57bb97f0c39..8c543bb0f3b 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 11310092c16..0b596956bce 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 fa3245b2510..2eb5df9dbb6 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 d2bf5df1167..4aa2e7c719e 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 81e7f99801c..35018a41c83 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 89e28f548e4..4eb560b345e 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 d10942cddf4..364bd370d16 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 3204030827f..3b12bf94e3a 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 0a9f262f5c5..87660f44fa0 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 d71fbd18514..86594bdfb42 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 7313781050a..3dce50ceb79 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 04548407d66..1b8adf1ec49 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 466b6239087..1c1171119b7 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 6dcd248cb4f..7d6df56082f 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 74d5fe3714e..7c1c9de3563 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 21dc3c6c921..4399c8dcde5 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 5095cca540c..5d3384d2ade 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 a903f5a1dea..3f8a042d4f2 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 645f9668051..d91176dda40 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 e4ed275486a..fd5b5f896b9 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 52500ded6ef..cc81a3d251d 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 7557dc35af7..dc3b79a4b35 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 b4ae5f93a7d..700dcbdd78a 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 f773b5da0fa..0ef735c9a16 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 0bb929b2110..a3cd15b8f3e 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 a5a7b1d0ae1..294eb0b5d7b 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 4f5740662a8..6f892cf8a54 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 06311ab6a1a..84629914370 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 5e376285c89..e9ec20e5909 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 3fd2d0dc453..d9d1e8bb19c 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 c2ae486b64e..dcfe99d5eef 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 9e42e8362ed..1ba9866a796 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 5c48fa106e5..42254554df6 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 0d1f8ed8b4e..90bd73ccc93 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 ece4937a965..568c9e43d31 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 86f723ffe45..8a0a2a269d0 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 9ef3f389044..305971c8a8c 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 5edbdea67fa..8e434dc5986 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 4012ed21849..51ce13ee088 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 9fd403db5d6..3a1a19c1fa6 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 011d6de1e28..c284875b484 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 fe20bc770dd..8017390e76a 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 6be503d84f8..c8c318adba9 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 3317135b947..859fdedc404 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 5cd541cf99c..a11813dc8a8 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 5320274e87a..0001b3fbf13 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 6cd08b38c9a..76c4d17d858 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 5b2421fe038..dad141a582d 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 672318f1cfb..b47bcd796da 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 b62e99f0948..a4f7a68537a 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 5c3749aba4b..5fcb435e558 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 d3b9b07d4f0..f1ed1eef9fa 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 24ca2441307..a7a8beae4a7 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 40502e234ca..a988c84cf03 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 be8d7bf516d..36d03e89235 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 f8b2a35e48a..4eaf3d41a52 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 fefa8fc57e3..56b7afe974c 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 1b104e84a9e..4fbda56e134 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 44c324b9a0c..f798405a2a6 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 345ec4ca159..194c591909c 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 2d4ed3de1b0..b474fd0c1d5 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 1a403564188..dcb515ea114 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 8ec696f1807..ad27504c211 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 87940d4c400..243c3119298 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 87ca187d305..bef72b17f0b 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 6c0e1690a2c..c01952a75e0 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 9a87b520aa5..0306b66c329 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 7ec3ec89661..b601d71ce38 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 073d43aca12..af01a1fd2b5 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 ec2f6e69844..70ac2052020 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 ff0bbaea929..4b1707bdcdf 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 99c17b52a36..b81748ab596 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 c6595699ee2..ac31c06c0bd 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 a8fe9607cd6..0aff979af4e 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 5f1e1db3c71..e585f9e454c 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 96c9d5f5fa9..43a6fbc1a88 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 53a32640dcc..6cd6cfce65d 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 5337f5c93a8..8225b5bc6e2 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 a7253a5ba93..81ba320efcd 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 ba2a2fa38b4..43d6b13522b 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 372dc016a5b..398080798e5 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 f8d3d7185d1..b301d398d1b 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 86288d4d4b3..397d24edfb0 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 fe89e713de1..d43b1d57e83 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 a402a63857c..08073904c7c 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 da3f2ceb51a..3890dc67073 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 45d32f1e218..1aa4c174c66 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 632d0b99d7f..175f8e26f64 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 f6bc0df4d1e..cd150c04d06 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 75628bebda3..b216c02ca5f 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 22139df6064..9ed57061d96 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 e8edf0c770a..657d7ce29c5 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 ee31cda5e4d..26212f4da22 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 c2cae1e24a9..4479b7273b1 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 10ff73ff3c4..7d372475c67 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 5939b2ca290..64a335776d2 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 64f552df7ee..f126a1d1fdc 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 6031539d8e0..ffa394a06c5 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 abb3a4976c1..08d68a5feea 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 cb0131347a2..ea9c84ca6ea 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 da1b564c021..88f3c175d31 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 df212d2803a..4258354f519 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 fa195c5e528..b450c245551 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 c2809a01228..78d03f9361a 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 627ea78686c..e97d9daaec7 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 4fa80c7d7a5..e87241e6d88 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 741626247b1..4280b0d0902 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 0dda6cec31d..7039c2457a3 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 01158d25820..ca151325afd 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 6d8359cbfd2..9ff1815d14d 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 9fc359d8cff..2edef6e2628 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 3582eed136d..96c14876f91 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 def91976375..04000a798fc 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 c62f8f955cc..817ee1e78ae 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 40b2f0cf07b..60958c43c91 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 d4d178d963a..50e61b60868 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 245d5baaa0d..951d18ab8be 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 b24335bfb19..9e0416ab72a 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 46414bee0f0..e46fd7a478f 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 6d537b93da2..3edfdbae389 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 2669b74ee64..c11b318a0da 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 3d92c25b591..f803aaa8347 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 7d1d746ceca..5a42d6a649b 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 fa8222d504b..32a5b9d12e7 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 4f0058e9302..5937626d7b5 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 a6c0b0964a5..363722861f6 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 a754513739d..06b9c213a3f 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 1ff6fc087e6..e86f9a1e270 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 eadb108e536..3dacd0b68eb 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 02e63863027..21014537846 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 69bbb6b14eb..2b6ee4c2eb2 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 1c904859341..cdaa65a1132 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 818f5931a18..dfaae69a2b0 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 48764a89749..58bb744a075 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 77ac5f678d5..96818aaee89 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 c603ba37497..39b45af240b 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 fc00ad687ee..d570fa82569 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 d71728af2fd..59a0c0c2d65 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 b11a2cf90d1..a36a8152cf0 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 cdef48b2d83..500b6b98da7 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 0b1c3532551..2cdb828ce58 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 4078e0c2fed..8c148b8f475 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 4bf9e6b85bd..6f8a7504cbe 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 b3e9cfa6272..6709225f8af 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 8c19bc8e60a..2653c61359c 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 8458fa34d94..06a1f439f3d 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 16fae21238a..1a56658cf24 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 c62a2d2b13b..de7285c02ee 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 6e85ad40893..219b942ae67 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 1bf5c183888..be6af28432b 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 be591f35637..6b393b7edcc 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 23ce827e4dd..b5c9f98d0f9 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 9f3a9328920..767cb5ee6a1 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 0556e22bae3..f49812e50dd 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 f6327d0a215..cf18484a6b8 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 79c7d916dbe..af5b2cec105 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 f05574d5419..2b7576bf618 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 e7b790cea27..86c111a8d6e 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 262a3e1c0f7..1aa833c5030 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 49d1eda43f4..3691aa80917 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 3c7720786b4..3f865ee96b2 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 f74fb19067d..edb27ef0a6d 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 9be24bcea0c..1280e187ce8 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 ae7f4913c5b..da3bb9c8dbd 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 76670eb3a86..5c20ca164bd 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 92f463bce66..fab9310af78 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 9839cd2a9fa..ca52ba97982 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 4ed600dbcd0..baf180925f1 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 f27672ed208..591a5d3acbb 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 0ad46734efb..5de8c162798 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 27791d6d7da..7f949c2e243 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 c75bd9f97fc..440d75169dd 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 8dd63702cd6..8b6a3ebf846 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 01fee91c625..c9943c3ea6a 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 a727bb43b90..430d3e1469a 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 6f7e24792ef..dfe5b4fcce8 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 c0b0977af59..9b9042dd1b8 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 9f0bd4e8eb0..707a6c76e44 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 7f7e85f19c7..a517b02b7bb 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 0af58b20598..b346b4fe73b 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 267d4148c7f..0dfd873477f 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 67476a8238b..c37e1f088d5 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 fe8ab34f610..043140aeeb5 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 38cc71dab1e..1390b94eacf 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 515be618806..f3a0112d978 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 decc5885b30..dfdeccfe0ea 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 ffe4d782452..1b012dd90a3 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 23860615806..afd5315444f 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 07996aa841b..4d4fb7932f6 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 180f8e630f9..58773d2f145 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 96ba6918fc5..7249837ebdd 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 3fed60a7c7f..36706d3aa98 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 f6a18440409..80014a37138 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 67b7f3be0a2..ac07dcaf83c 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 80899bd45de..a5bd989648e 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 b2886dc012c..5eaa1638110 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 c6821b5c430..c420d748bcf 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 5e2ac52611a..ea8c0272c32 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 8e9cd8c73d2..ee545c662f1 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 eb430982e7e..00f7a715133 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 e6f13118a72..bc51a6a6e66 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 12d6d45d240..66db9348a01 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 dd3d45c8371..9a909ed423e 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 537345ca309..67d3e34369c 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 fa4c776a778..3da7dd5a1c5 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 4151718c9d2..405084b2f05 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 d1f5bd67e50..321ca75a149 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 91078543b8a..deda86885ce 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 b657fa55e43..7d3ef1721e9 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 4315e039979..7ac70e7d951 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 57c4fba3395..ea2d59f00b8 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 c4c4c952f2b..2eae0df4cdb 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 136c7d1526f..3a8a3098ea2 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 f748b4e58d0..9e5350ab3e1 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 c20cf814686..fdc7ea94127 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 e31da74d04e..cc50e328a3f 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 1c44ee5b02f..1f4d2e1dca0 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 1505bb9adc7..0b4237246b6 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 0f03dec2db5..05788273c02 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 9ac4fbdb89a..6709e3b7888 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 00bdbf5423a..b20bdb50991 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 e333ce1ae0a..4eb3d84c18b 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 db7d66f5f75..8245037bd75 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 b200b6f9700..1889b4e7374 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 1f51297e27c..95966b24dd8 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 851725db129..a34cfa4cf01 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 3e987a077d1..f5e1cbfd3ac 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 dd69f8a5df5..2d6b7ab520b 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 90c6a45251c..ed083f37883 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 7f8c3ef1a6c..6baf24745db 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 89327ef1c4b..f2c6056cddf 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 c5071d7ee05..8e27e2e6e69 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 5de3ea1e26b..163ce8dae70 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 c5747aa7cf9..ae4ba2592bb 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 a1fb7f91038..8a9c79cac33 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 6a79a604a49..e882d317948 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 50d95b80a78..42c5f071851 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 551d97fb8ed..18ece4731b7 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 b1779d8206e..423cb616585 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 6c12387de3f..c1a5657c115 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 4e928774480..4ac0170f772 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 76bb15398a7..2d10af07158 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 50c1a5e3eb5..6a7a2d6e3c8 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 47b7b1c97b0..8ebe1ed3a52 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 3d9ae5a08e7..686ebdef488 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 167b9e7229a..9e177edd20f 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 cb73efd9eb6..684c8e246bb 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 e8ea40a0a96..b7c3678a92f 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 e99ca29c3a5..3f1a79a4c43 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 47d85613993..eff6e31194b 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 57810ad481a..10d31f46878 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 2a3396be3e6..9b56f51b67c 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 32aec281205..4526d902964 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 05a745878d2..7ce7d23c54c 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 a4e3704104f..9b054e5bacb 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 c5d951da9f5..d77ab2a8a2c 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 a3afbf755f0..9e8d66031fd 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 9c1d19f1690..3f2a1dd3046 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 3dbe323a7d6..a2e4fcfb6f6 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 be911056bde..a340c35cea2 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 d58defbba02..a562b6a3a5c 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 d61d3816adf..bc214974167 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 7e423630d07..650439713f8 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 a361a955735..956ba88edef 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 2a01447befa..6121578b7d2 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 42345686634..3a2ec747bcc 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 a0696163dfd..c7deb252f2f 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 9373c0d1131..80fbc4efea3 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 c3921ae5c05..4b8af183244 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 501915697ad..2fb34a780b1 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 5bef17696dd..8466f89af96 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 5a1411ff89c..69fc78ec241 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 18f4ea20842..bc428fdd9c7 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&)>;