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:
parent
eb5c92d4e2
commit
5c90c389c3
7 changed files with 257 additions and 56 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue