summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index f88bf9ffc..306a953a7 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -817,11 +817,22 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
wasm.addExport(export_);
}
+#if 0
+ // export memory
auto memoryExport = make_unique<Export>();
memoryExport->name = MEMORY;
memoryExport->value = Name::fromInt(0);
memoryExport->kind = Export::Memory;
wasm.addExport(memoryExport.release());
+#else
+ // import memory
+ auto memoryImport = make_unique<Import>();
+ memoryImport->name = MEMORY;
+ memoryImport->module = ENV;
+ memoryImport->base = MEMORY;
+ memoryImport->kind = Import::Memory;
+ wasm.addImport(memoryImport.release());
+#endif
#if 0 // enable asm2wasm i64 optimizations when browsers have consistent i64 support in wasm
if (udivmoddi4.is() && getTempRet0.is()) {