From d62c0fcbdc253fc21403285dcedbdee7a3234383 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sat, 6 Apr 2024 10:15:41 -0700 Subject: [PATCH] LibJS: Add calls to JS_{DECLARE,DEFINE}_ALLOCATOR() --- Userland/Libraries/LibJS/Module.cpp | 1 + Userland/Libraries/LibJS/Module.h | 1 + Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp | 2 ++ Userland/Libraries/LibJS/Runtime/ErrorPrototype.h | 1 + .../LibJS/Runtime/PromiseResolvingElementFunctions.cpp | 1 + .../Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h | 1 + Userland/Libraries/LibJS/Runtime/SetPrototype.cpp | 2 ++ Userland/Libraries/LibJS/Runtime/SetPrototype.h | 1 + .../Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp | 2 ++ .../Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h | 1 + 10 files changed, 13 insertions(+) diff --git a/Userland/Libraries/LibJS/Module.cpp b/Userland/Libraries/LibJS/Module.cpp index a729612bfe..574178c913 100644 --- a/Userland/Libraries/LibJS/Module.cpp +++ b/Userland/Libraries/LibJS/Module.cpp @@ -16,6 +16,7 @@ namespace JS { JS_DEFINE_ALLOCATOR(Module); +JS_DEFINE_ALLOCATOR(GraphLoadingState); Module::Module(Realm& realm, ByteString filename, Script::HostDefined* host_defined) : m_realm(realm) diff --git a/Userland/Libraries/LibJS/Module.h b/Userland/Libraries/LibJS/Module.h index a32f98db91..dafe46510e 100644 --- a/Userland/Libraries/LibJS/Module.h +++ b/Userland/Libraries/LibJS/Module.h @@ -59,6 +59,7 @@ struct ResolvedBinding { // https://tc39.es/ecma262/#graphloadingstate-record struct GraphLoadingState : public Cell { JS_CELL(GraphLoadingState, Cell); + JS_DECLARE_ALLOCATOR(GraphLoadingState); public: struct HostDefined : Cell { diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp index 9d5d4d7ce7..39eddbc67d 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -125,6 +125,8 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::stack_setter) } #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ + JS_DEFINE_ALLOCATOR(PrototypeName); \ + \ PrototypeName::PrototypeName(Realm& realm) \ : PrototypeObject(realm.intrinsics().error_prototype()) \ { \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h index aa8a06c9aa..063078abc5 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h @@ -31,6 +31,7 @@ private: #define DECLARE_NATIVE_ERROR_PROTOTYPE(ClassName, snake_name, PrototypeName, ConstructorName) \ class PrototypeName final : public PrototypeObject { \ JS_PROTOTYPE_OBJECT(PrototypeName, ClassName, ClassName); \ + JS_DECLARE_ALLOCATOR(PrototypeName); \ \ public: \ virtual void initialize(Realm&) override; \ diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp index 817ee1e78a..2077b8d0e7 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp @@ -17,6 +17,7 @@ JS_DEFINE_ALLOCATOR(RemainingElements); JS_DEFINE_ALLOCATOR(PromiseValueList); JS_DEFINE_ALLOCATOR(PromiseResolvingElementFunction); JS_DEFINE_ALLOCATOR(PromiseAllResolveElementFunction); +JS_DEFINE_ALLOCATOR(PromiseAllSettledResolveElementFunction); JS_DEFINE_ALLOCATOR(PromiseAllSettledRejectElementFunction); JS_DEFINE_ALLOCATOR(PromiseAnyRejectElementFunction); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h index 60958c43c9..787047d00b 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h @@ -88,6 +88,7 @@ private: // 27.2.4.2.2 Promise.allSettled Resolve Element Functions, https://tc39.es/ecma262/#sec-promise.allsettled-resolve-element-functions class PromiseAllSettledResolveElementFunction final : public PromiseResolvingElementFunction { JS_OBJECT(PromiseResolvingFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(PromiseAllSettledResolveElementFunction); public: static NonnullGCPtr create(Realm&, size_t, PromiseValueList&, NonnullGCPtr, RemainingElements&); diff --git a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp index 2087e35e0f..844ad69cf3 100644 --- a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp @@ -15,6 +15,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(SetPrototype); + SetPrototype::SetPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().object_prototype()) { diff --git a/Userland/Libraries/LibJS/Runtime/SetPrototype.h b/Userland/Libraries/LibJS/Runtime/SetPrototype.h index 24708ba481..1284240fba 100644 --- a/Userland/Libraries/LibJS/Runtime/SetPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SetPrototype.h @@ -13,6 +13,7 @@ namespace JS { class SetPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SetPrototype, Set, Set); + JS_DECLARE_ALLOCATOR(SetPrototype); public: virtual void initialize(Realm&) override; diff --git a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp index 38f6ab866d..a6c3e8169f 100644 --- a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp @@ -10,6 +10,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(WrapForValidIteratorPrototype); + // 3.1.1.2.2.1 The %WrapForValidIteratorPrototype% Object, https://tc39.es/proposal-iterator-helpers/#sec-wrapforvaliditeratorprototype-object WrapForValidIteratorPrototype::WrapForValidIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().iterator_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h index c0693f07ce..36d3746722 100644 --- a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h @@ -14,6 +14,7 @@ namespace JS { class WrapForValidIteratorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(WrapForValidIteratorPrototype, Iterator, Iterator); + JS_DECLARE_ALLOCATOR(WrapForValidIteratorPrototype); public: virtual void initialize(Realm&) override;