1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:57:44 +00:00

LibWeb: Add support for accessing exported wasm table instances

This commit is contained in:
Ali Mohammad Pur 2022-11-20 06:51:24 +03:30 committed by Ali Mohammad Pur
parent 0d1471e72f
commit af511a64cd
3 changed files with 13 additions and 0 deletions

View file

@ -14,6 +14,7 @@
namespace Web::Bindings {
class WebAssemblyMemoryObject;
class WebAssemblyTableObject;
JS::ThrowCompletionOr<size_t> parse_module(JS::VM&, JS::Object* buffer);
JS::NativeFunction* create_native_function(JS::VM&, Wasm::FunctionAddress address, String const& name);
JS::Value to_js_value(JS::VM&, Wasm::Value& wasm_value);
@ -47,6 +48,7 @@ public:
struct ModuleCache {
HashMap<Wasm::FunctionAddress, JS::FunctionObject*> function_instances;
HashMap<Wasm::MemoryAddress, WebAssemblyMemoryObject*> memory_instances;
HashMap<Wasm::TableAddress, WebAssemblyTableObject*> table_instances;
};
struct GlobalModuleCache {
HashMap<Wasm::FunctionAddress, JS::NativeFunction*> function_instances;