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

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

Issue 1830663002: [wasm] Binary 11: AST changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Renumber opcodes and remove tests added elsewhere Created 4 years, 9 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
Index: test/mjsunit/wasm/test-wasm-module-builder.js
diff --git a/test/mjsunit/wasm/test-wasm-module-builder.js b/test/mjsunit/wasm/test-wasm-module-builder.js
index 50797d055421ee524c0fa47ccc6d4ef1551eddae..28df06f0335112ddd3b83e52e5a4530ce7cdd9cf 100644
--- a/test/mjsunit/wasm/test-wasm-module-builder.js
+++ b/test/mjsunit/wasm/test-wasm-module-builder.js
@@ -25,7 +25,7 @@ var debug = false;
var module = new WasmModuleBuilder();
var index = module.addImport("print", [kAstStmt, kAstI32]);
module.addFunction("foo", [kAstStmt])
- .addBody([kExprCallImport, index, kExprI8Const, 13])
+ .addBody([kExprI8Const, 13, kExprCallImport, index])
.exportAs("main");
var buffer = module.toBuffer(debug);
@@ -38,7 +38,7 @@ var debug = false;
var module = new WasmModuleBuilder();
module.addFunction(undefined, [kAstI32, kAstI32])
.addLocals({i32_count: 1})
- .addBody([kExprSetLocal, 1, kExprGetLocal, 0])
+ .addBody([kExprGetLocal, 0, kExprSetLocal, 1])
.exportAs("main");
var buffer = module.toBuffer(debug);
@@ -60,7 +60,7 @@ var debug = false;
var module = new WasmModuleBuilder();
module.addFunction(undefined, [p.type, p.type])
.addLocals(p.locals)
- .addBody([kExprSetLocal, 1, kExprGetLocal, 0])
+ .addBody([kExprGetLocal, 0, kExprSetLocal, 1])
.exportAs("main");
var buffer = module.toBuffer(debug);
@@ -73,9 +73,9 @@ var debug = false;
(function CallTest() {
var module = new WasmModuleBuilder();
module.addFunction("add", [kAstI32, kAstI32, kAstI32])
- .addBody([kExprI32Add, kExprGetLocal, 0, kExprGetLocal, 1]);
+ .addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprI32Add]);
module.addFunction("main", [kAstI32, kAstI32, kAstI32])
- .addBody([kExprCallFunction, 0, kExprGetLocal, 0, kExprGetLocal, 1])
+ .addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprCallFunction, 0])
.exportAs("main");
var instance = module.instantiate();
@@ -86,10 +86,10 @@ var debug = false;
(function IndirectCallTest() {
var module = new WasmModuleBuilder();
module.addFunction("add", [kAstI32, kAstI32, kAstI32])
- .addBody([kExprI32Add, kExprGetLocal, 0, kExprGetLocal, 1]);
+ .addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprI32Add]);
module.addFunction("main", [kAstI32, kAstI32, kAstI32, kAstI32])
- .addBody([kExprCallIndirect, 0, kExprGetLocal,
- 0, kExprGetLocal, 1, kExprGetLocal, 2])
+ .addBody([kExprGetLocal,
+ 0, kExprGetLocal, 1, kExprGetLocal, 2, kExprCallIndirect, 0, ])
.exportAs("main");
module.appendToFunctionTable([0]);
@@ -103,7 +103,7 @@ var debug = false;
var module = new WasmModuleBuilder();
module.addMemory(1, 1, false);
module.addFunction("load", [kAstI32, kAstI32])
- .addBody([kExprI32LoadMem, 0, 0, kExprGetLocal, 0])
+ .addBody([kExprGetLocal, 0, kExprI32LoadMem, 0, 0])
.exportAs("load");
module.addDataSegment(0, [9, 9, 9, 9], true);
@@ -143,7 +143,7 @@ var debug = false;
var module = new WasmModuleBuilder();
var index = module.addImportWithModule("mod", "print", [kAstStmt, kAstI32]);
module.addFunction("foo", [kAstStmt])
- .addBody([kExprCallImport, index, kExprI8Const, 19])
+ .addBody([kExprI8Const, 19, kExprCallImport, index])
.exportAs("main");
var buffer = module.toBuffer(debug);

Powered by Google App Engine
This is Rietveld 408576698