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

Unified Diff: test/mjsunit/wasm/instantiate-module-basic.js

Issue 2361053004: Revert of [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 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/instance-gc.js ('k') | test/mjsunit/wasm/module-memory.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/instantiate-module-basic.js
diff --git a/test/mjsunit/wasm/instantiate-module-basic.js b/test/mjsunit/wasm/instantiate-module-basic.js
index b83e8131890a3f929165d42820178d0cb2054226..04fc903010db1b17935e374df2f72820d92488df 100644
--- a/test/mjsunit/wasm/instantiate-module-basic.js
+++ b/test/mjsunit/wasm/instantiate-module-basic.js
@@ -31,16 +31,13 @@
assertFalse(mem === null);
assertFalse(mem === 0);
assertEquals("object", typeof mem);
- assertTrue(mem instanceof WebAssembly.Memory);
- var buf = mem.buffer;
- assertTrue(buf instanceof ArrayBuffer);
- assertEquals(65536, buf.byteLength);
- for (var i = 0; i < 4; i++) {
+ assertTrue(mem instanceof ArrayBuffer);
+ for (let i = 0; i < 4; i++) {
instance.exports.memory = 0; // should be ignored
- mem.buffer = 0; // should be ignored
assertSame(mem, instance.exports.memory);
- assertSame(buf, mem.buffer);
}
+
+ assertEquals(65536, instance.exports.memory.byteLength);
// Check the properties of the main function.
let main = instance.exports.main;
@@ -64,7 +61,6 @@
// Negative tests.
(function InvalidModules() {
- print("InvalidModules...");
let invalid_cases = [undefined, 1, "", "a", {some:1, obj: "b"}];
let len = invalid_cases.length;
for (var i = 0; i < len; ++i) {
@@ -79,10 +75,9 @@
// Compile async an invalid blob.
(function InvalidBinaryAsyncCompilation() {
- print("InvalidBinaryAsyncCompilation...");
let builder = new WasmModuleBuilder();
builder.addFunction("f", kSig_i_i)
- .addBody([kExprCallFunction, 0]);
+ .addBody([kExprCallImport, kArity0, 0]);
let promise = WebAssembly.compile(builder.toBuffer());
promise
.then(compiled =>
@@ -92,7 +87,6 @@
// Multiple instances tests.
(function ManyInstances() {
- print("ManyInstances...");
let compiled_module = new WebAssembly.Module(buffer);
let instance_1 = new WebAssembly.Instance(compiled_module);
let instance_2 = new WebAssembly.Instance(compiled_module);
@@ -100,7 +94,6 @@
})();
(function ManyInstancesAsync() {
- print("ManyInstancesAsync...");
let promise = WebAssembly.compile(buffer);
promise.then(compiled_module => {
let instance_1 = new WebAssembly.Instance(compiled_module);
@@ -110,7 +103,6 @@
})();
(function InstancesAreIsolatedFromEachother() {
- print("InstancesAreIsolatedFromEachother...");
var builder = new WasmModuleBuilder();
builder.addMemory(1,1, true);
var kSig_v_i = makeSig([kAstI32], []);
@@ -120,13 +112,13 @@
builder.addFunction("main", kSig_i_i)
.addBody([
+ kExprI32Const, 1,
kExprGetLocal, 0,
kExprI32LoadMem, 0, 0,
- kExprI32Const, 1,
- kExprCallIndirect, signature,
+ kExprCallIndirect, kArity1, signature,
kExprGetLocal,0,
kExprI32LoadMem,0, 0,
- kExprCallFunction, 0,
+ kExprCallImport, kArity0, 0,
kExprI32Add
]).exportFunc();
@@ -135,8 +127,8 @@
builder.addFunction("_wrap_writer", signature)
.addBody([
kExprGetLocal, 0,
- kExprCallFunction, 1]);
- builder.appendToTable([2, 3]);
+ kExprCallImport, kArity1, 1]);
+ builder.appendToTable([0, 1]);
var module = new WebAssembly.Module(builder.toBuffer());
@@ -163,7 +155,6 @@
})();
(function GlobalsArePrivateToTheInstance() {
- print("GlobalsArePrivateToTheInstance...");
var builder = new WasmModuleBuilder();
builder.addGlobal(kAstI32);
builder.addFunction("read", kSig_i_v)
@@ -188,7 +179,6 @@
(function InstanceMemoryIsIsolated() {
- print("InstanceMemoryIsIsolated...");
var builder = new WasmModuleBuilder();
builder.addMemory(1,1, true);
« no previous file with comments | « test/mjsunit/wasm/instance-gc.js ('k') | test/mjsunit/wasm/module-memory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698