summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-01-09 17:49:06 -0500
committerAndreas Kling <kling@serenityos.org>2023-01-10 16:08:14 +0100
commit7bd8fd000f3f8e92ff632be2370a279ac2309250 (patch)
tree212c47b003f275c40bca964cb1fa4fbbe1824abc /Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp
parent59104262a4fe1b9a5aa234ea810842f205f305db (diff)
downloadserenity-7bd8fd000f3f8e92ff632be2370a279ac2309250.zip
LibWeb: Generate dedicated methods to create Web constructors/prototypes
Currently, for each exposed interface, we generate one massive function to create every Web constructor and prototype. In an effort to lazily create these instead, this first step is to extract the creation of each of these into its own method. First, this generates a forwarding header for all IDL types. This is to allow callers to remain unchanged without forcing them to include the (very heavy) generated IDL headers. This header is included by LibWeb's forwarding header. Next, this defines a base template method on Web::Bindings::Intrinsics to create a prototype/constructor pair. Specializations of this template are now generated in a new .cpp file, IntrinsicDefinitions.cpp. The base Intrinsics class is updated to use this new method, and will continue to cache the result. Last, some WebAssembly classes are updated to use this new mechanism. They were using some ad hoc cache keys that are now in line with the generated specializations. That one massive function is still used to invoke these specializations, so they are not lazy as of this commit.
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp')
-rw-r--r--Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp
index ab11610d3d..1a0ed6802d 100644
--- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp
+++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleConstructor.cpp
@@ -41,7 +41,7 @@ void WebAssemblyModuleConstructor::initialize(JS::Realm& realm)
auto& vm = this->vm();
NativeFunction::initialize(realm);
- define_direct_property(vm.names.prototype, &Bindings::ensure_web_prototype<WebAssemblyModulePrototype>(realm, "WebAssemblyModulePrototype"), 0);
+ define_direct_property(vm.names.prototype, &Bindings::ensure_web_prototype<WebAssemblyModulePrototype>(realm, "WebAssembly.Module"), 0);
define_direct_property(vm.names.length, JS::Value(1), JS::Attribute::Configurable);
}