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

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

Issue 1830663002: [wasm] Binary 11: AST changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/indirect-calls.js ('k') | test/mjsunit/wasm/stack.js » ('j') | 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 ef85eb23576acbe4076ea5311ec517cc94054d68..c8d9c6d32309dbfac23b8aa3c29dc1e2f4a62cdd 100644
--- a/test/mjsunit/wasm/module-memory.js
+++ b/test/mjsunit/wasm/module-memory.js
@@ -15,17 +15,25 @@ function genModule(memory) {
builder.addMemory(1, 1, true);
builder.addFunction("main", [kAstI32, kAstI32])
.addBody([
- kExprBlock,2,
- kExprLoop,1,
- kExprIf,
+ // main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0;
+ kExprLoop,
+ kExprGetLocal,0,
+ kExprIf,
kExprGetLocal,0,
- kExprBr, 0,
- kExprIfElse,
- kExprI32LoadMem,0,0,kExprGetLocal,0,
- kExprBr,2, kExprI8Const, 255,
- kExprSetLocal,0,
- kExprI32Sub,kExprGetLocal,0,kExprI8Const,4,
- kExprI8Const,0])
+ kExprI32LoadMem,0,0,
+ kExprIf,
+ kExprI8Const,255,
+ kExprReturn, kArity1,
+ kExprEnd,
+ kExprGetLocal,0,
+ kExprI8Const,4,
+ kExprI32Sub,
+ kExprSetLocal,0,
+ kExprBr, kArity1, 1,
+ kExprEnd,
+ kExprEnd,
+ kExprI8Const,0
+ ])
.exportFunc();
return builder.instantiate(null, memory);
@@ -122,12 +130,14 @@ function testOOBThrows() {
builder.addMemory(1, 1, true);
builder.addFunction("geti", [kAstI32, kAstI32, kAstI32])
.addBody([
- kExprI32StoreMem, 0, 0, kExprGetLocal, 0, kExprI32LoadMem, 0, 0, kExprGetLocal, 1
+ kExprGetLocal, 0,
+ kExprGetLocal, 1,
+ kExprI32LoadMem, 0, 0,
+ kExprI32StoreMem, 0, 0
])
.exportFunc();
var module = builder.instantiate();
-
var offset;
function read() { return module.exports.geti(0, offset); }
« no previous file with comments | « test/mjsunit/wasm/indirect-calls.js ('k') | test/mjsunit/wasm/stack.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698