From f4fa37afd211fc297f3edd4a963878bd5994b03c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 23 Dec 2023 15:15:27 +0100 Subject: [PATCH] LibJS+LibWeb: Add missing JS_DEFINE_ALLOCATOR() for a bunch of classes --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 2 ++ .../Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp | 2 +- Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp | 2 ++ Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h | 1 + Userland/Libraries/LibJS/Runtime/Symbol.cpp | 2 ++ .../Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp | 2 ++ Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp | 2 ++ Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp | 2 ++ Userland/Libraries/LibWeb/FileAPI/FileList.cpp | 2 ++ .../LibWeb/HTML/CustomElements/CustomElementRegistry.cpp | 1 + Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp | 2 ++ Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp | 2 ++ Userland/Libraries/LibWeb/HTML/TrackEvent.cpp | 2 ++ 15 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 156acc65de4..dc1e0a5d4dc 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2563,6 +2563,8 @@ static void generate_named_properties_object_definitions(IDL::Interface const& i generator.append(R"~~~( #include +JS_DEFINE_ALLOCATOR(@named_properties_class@); + @named_properties_class@::@named_properties_class@(JS::Realm& realm) : JS::Object(realm, nullptr, MayInterfereWithIndexedPropertyAccess::Yes) , m_realm(realm) diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp index 141c637a804..e334ce66de4 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp @@ -14,7 +14,7 @@ namespace JS { -JS_DECLARE_ALLOCATOR(AsyncFromSyncIteratorPrototype); +JS_DEFINE_ALLOCATOR(AsyncFromSyncIteratorPrototype); AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype(Realm& realm) : PrototypeObject(realm.intrinsics().async_iterator_prototype()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp index ecea9480ee9..80e64d48f7c 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp @@ -10,6 +10,8 @@ namespace JS::Intl { +JS_DEFINE_ALLOCATOR(NumberFormatFunction); + // 15.5.2 Number Format Functions, https://tc39.es/ecma402/#sec-number-format-functions NonnullGCPtr NumberFormatFunction::create(Realm& realm, NumberFormat& number_format) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h index 4dd161bf48e..0bf141f3169 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h @@ -14,6 +14,7 @@ namespace JS::Intl { class NumberFormatFunction final : public NativeFunction { JS_OBJECT(NumberFormatFunction, NativeFunction); + JS_DECLARE_ALLOCATOR(NumberFormatFunction); public: static NonnullGCPtr create(Realm&, NumberFormat&); diff --git a/Userland/Libraries/LibJS/Runtime/Symbol.cpp b/Userland/Libraries/LibJS/Runtime/Symbol.cpp index 0fe3e705ef8..2737adeacab 100644 --- a/Userland/Libraries/LibJS/Runtime/Symbol.cpp +++ b/Userland/Libraries/LibJS/Runtime/Symbol.cpp @@ -11,6 +11,8 @@ namespace JS { +JS_DEFINE_ALLOCATOR(Symbol); + Symbol::Symbol(Optional description, bool is_global) : m_description(move(description)) , m_is_global(is_global) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp index bd12b7f932a..974646b41dd 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp @@ -14,6 +14,8 @@ namespace JS::Temporal { +JS_DEFINE_ALLOCATOR(DurationConstructor); + // 7.1 The Temporal.Duration Constructor, https://tc39.es/proposal-temporal/#sec-temporal-duration-constructor DurationConstructor::DurationConstructor(Realm& realm) : NativeFunction(realm.vm().names.Duration.as_string(), realm.intrinsics().function_prototype()) diff --git a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp index 86f690ee6e8..5ccda1fa62f 100644 --- a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp +++ b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp @@ -9,6 +9,8 @@ namespace Web::Animations { +JS_DEFINE_ALLOCATOR(KeyframeEffect); + JS::NonnullGCPtr KeyframeEffect::create(JS::Realm& realm) { return realm.heap().allocate(realm, realm); diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 54d83ecb3e4..15398cb2a29 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -14,6 +14,8 @@ namespace Web::CSS { +JS_DEFINE_ALLOCATOR(CSSFontFaceRule); + JS::NonnullGCPtr CSSFontFaceRule::create(JS::Realm& realm, FontFace&& font_face) { return realm.heap().allocate(realm, realm, move(font_face)); diff --git a/Userland/Libraries/LibWeb/FileAPI/FileList.cpp b/Userland/Libraries/LibWeb/FileAPI/FileList.cpp index 505611bbc7e..71e069b4c13 100644 --- a/Userland/Libraries/LibWeb/FileAPI/FileList.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/FileList.cpp @@ -11,6 +11,8 @@ namespace Web::FileAPI { +JS_DEFINE_ALLOCATOR(FileList); + JS::NonnullGCPtr FileList::create(JS::Realm& realm, Vector>&& files) { return realm.heap().allocate(realm, realm, move(files)); diff --git a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp index c393e2a01aa..ec029675c81 100644 --- a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp +++ b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp @@ -20,6 +20,7 @@ namespace Web::HTML { +JS_DEFINE_ALLOCATOR(CustomElementRegistry); JS_DEFINE_ALLOCATOR(CustomElementDefinition); CustomElementRegistry::CustomElementRegistry(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp index 77ffa17668d..f5ee101fc8f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp @@ -9,6 +9,8 @@ namespace Web::HTML { +JS_DEFINE_ALLOCATOR(HTMLDataListElement); + HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp index 8ead3df8d13..7a4c785363c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp @@ -8,7 +8,7 @@ namespace Web::HTML { -JS_DECLARE_ALLOCATOR(HTMLDocument); +JS_DEFINE_ALLOCATOR(HTMLDocument); HTMLDocument::HTMLDocument(JS::Realm& realm, AK::URL const& url) : Document(realm, url) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 363bd830e58..a96ad581f2e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -36,7 +36,7 @@ namespace Web::HTML { -JS_DECLARE_ALLOCATOR(HTMLElement); +JS_DEFINE_ALLOCATOR(HTMLElement); HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_name) : Element(document, move(qualified_name)) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 6d107730fc9..42db3923d22 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -19,6 +19,8 @@ namespace Web::HTML { +JS_DEFINE_ALLOCATOR(HTMLTextAreaElement); + HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { diff --git a/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp b/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp index a1f75376480..e42548bda2f 100644 --- a/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp @@ -10,6 +10,8 @@ namespace Web::HTML { +JS_DEFINE_ALLOCATOR(TrackEvent); + JS::NonnullGCPtr TrackEvent::create(JS::Realm& realm, FlyString const& event_name, TrackEventInit event_init) { return realm.heap().allocate(realm, realm, event_name, move(event_init));