1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

LibWeb: Port WebAssembly.Table to IDL

This commit is contained in:
Timothy Flynn 2023-03-15 20:16:22 -04:00 committed by Andreas Kling
parent ca96f8e364
commit 2cfcbccdb5
17 changed files with 230 additions and 357 deletions

View file

@ -15,8 +15,8 @@
#include <LibWeb/WebAssembly/Instance.h>
#include <LibWeb/WebAssembly/Memory.h>
#include <LibWeb/WebAssembly/Module.h>
#include <LibWeb/WebAssembly/Table.h>
#include <LibWeb/WebAssembly/WebAssemblyObject.h>
#include <LibWeb/WebAssembly/WebAssemblyTableObject.h>
namespace Web::WebAssembly {
@ -71,9 +71,9 @@ JS::ThrowCompletionOr<void> Instance::initialize(JS::Realm& realm)
return {};
},
[&](Wasm::TableAddress const& address) -> JS::ThrowCompletionOr<void> {
Optional<JS::GCPtr<Bindings::WebAssemblyTableObject>> object = cache.table_instances.get(address);
Optional<JS::GCPtr<Table>> object = cache.table_instances.get(address);
if (!object.has_value()) {
object = MUST_OR_THROW_OOM(heap().allocate<Web::Bindings::WebAssemblyTableObject>(realm, realm, address));
object = MUST_OR_THROW_OOM(heap().allocate<Table>(realm, realm, address));
cache.table_instances.set(address, *object);
}