Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: test/mjsunit/wasm/module-memory.js

Issue 2460773003: [wasm] make WebAssembly.Instance require a WebAssembly.Memory (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/wasm/instantiate-module-basic.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/module-memory.js
diff --git a/test/mjsunit/wasm/module-memory.js b/test/mjsunit/wasm/module-memory.js
index 6707f0816410c0667e3711b78936226b2e0cf2be..8c57ca00d57f563857d5b2682c436d4bc3197945 100644
--- a/test/mjsunit/wasm/module-memory.js
+++ b/test/mjsunit/wasm/module-memory.js
@@ -38,11 +38,12 @@ function genModule(memory) {
.exportFunc();
var module = builder.instantiate(null, memory);
assertTrue(module.exports.memory instanceof WebAssembly.Memory);
- if (memory != null) assertEquals(memory, module.exports.memory.buffer);
+ if (memory != null) assertEquals(memory.buffer, module.exports.memory.buffer);
return module;
}
function testPokeMemory() {
+ print("testPokeMemory");
var module = genModule(null);
var buffer = module.exports.memory.buffer;
var main = module.exports.main;
@@ -89,12 +90,13 @@ testSurvivalAcrossGc();
function testPokeOuterMemory() {
- var buffer = new ArrayBuffer(kMemSize);
+ print("testPokeOuterMemory");
+ var buffer = new WebAssembly.Memory({initial: kMemSize / kPageSize});
var module = genModule(buffer);
var main = module.exports.main;
- assertEquals(kMemSize, buffer.byteLength);
+ assertEquals(kMemSize, buffer.buffer.byteLength);
- var array = new Int8Array(buffer);
+ var array = new Int8Array(buffer.buffer);
assertEquals(kMemSize, array.length);
for (var i = 0; i < kMemSize; i++) {
@@ -116,7 +118,7 @@ function testPokeOuterMemory() {
testPokeOuterMemory();
function testOuterMemorySurvivalAcrossGc() {
- var buffer = new ArrayBuffer(kMemSize);
+ var buffer = new WebAssembly.Memory({initial: kMemSize / kPageSize});
var checker = genAndGetMain(buffer);
for (var i = 0; i < 3; i++) {
print("gc run ", i);
« no previous file with comments | « test/mjsunit/wasm/instantiate-module-basic.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698