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

LibWeb: Implement the WebAssembly Memory object and Memory imports

This commit is contained in:
Ali Mohammad Pur 2021-06-21 08:42:58 +04:30 committed by Ali Mohammad Pur
parent eb5c92d4e2
commit 5c90c389c3
7 changed files with 257 additions and 56 deletions

View file

@ -95,19 +95,15 @@ private:
};
class WebAssemblyMemoryObject final : public JS::Object {
JS_OBJECT(WebAssemblyModuleObject, JS::Object);
JS_OBJECT(WebAssemblyMemoryObject, JS::Object);
public:
explicit WebAssemblyMemoryObject(JS::GlobalObject&, Wasm::MemoryAddress);
virtual void initialize(JS::GlobalObject&) override;
virtual ~WebAssemblyMemoryObject() override = default;
auto address() const { return m_address; }
private:
JS_DECLARE_NATIVE_FUNCTION(grow);
JS_DECLARE_NATIVE_GETTER(buffer);
Wasm::MemoryAddress m_address;
};