Index: test/mjsunit/wasm/module-memory.js |
diff --git a/test/mjsunit/wasm/module-memory.js b/test/mjsunit/wasm/module-memory.js |
index d7cc1297c92bca84d7985d6b28d2aeca5d94e71e..ff11465fe87d4a89930e6c566cb8acb0eecf4ff6 100644 |
--- a/test/mjsunit/wasm/module-memory.js |
+++ b/test/mjsunit/wasm/module-memory.js |
@@ -12,7 +12,8 @@ var kMemSize = 65536; |
function genModule(memory) { |
var builder = new WasmModuleBuilder(); |
- builder.addMemory(1, 1, true); |
+ builder.addImportedMemory("", "memory", 1, 1); |
+ builder.exportMemoryAs("memory"); |
builder.addFunction("main", kSig_i_i) |
.addBody([ |
// main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0; |
@@ -36,7 +37,7 @@ function genModule(memory) { |
/**/ kExprI32Const, 0 // -- |
]) |
.exportFunc(); |
- var module = builder.instantiate(null, memory); |
+ var module = builder.instantiate({"": {memory:memory}}); |
assertTrue(module.exports.memory instanceof WebAssembly.Memory); |
if (memory != null) assertEquals(memory.buffer, module.exports.memory.buffer); |
return module; |
@@ -44,7 +45,7 @@ function genModule(memory) { |
function testPokeMemory() { |
print("testPokeMemory"); |
- var module = genModule(null); |
+ var module = genModule(new WebAssembly.Memory({initial: 1})); |
var buffer = module.exports.memory.buffer; |
var main = module.exports.main; |
assertEquals(kMemSize, buffer.byteLength); |
@@ -75,7 +76,7 @@ function genAndGetMain(buffer) { |
} |
function testSurvivalAcrossGc() { |
- var checker = genAndGetMain(null); |
+ var checker = genAndGetMain(new WebAssembly.Memory({initial: 1})); |
for (var i = 0; i < 3; i++) { |
print("gc run ", i); |
assertEquals(0, checker(kMemSize - 4)); |