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

Side by Side Diff: test/mjsunit/wasm/module-memory.js

Issue 2594993002: [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* (Closed)
Patch Set: Fix inspector tests Created 3 years, 12 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/wasm/instantiate-module-basic.js ('k') | test/mjsunit/wasm/params.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-wasm --expose-gc --stress-compaction 5 // Flags: --expose-wasm --expose-gc --stress-compaction
6 6
7 load("test/mjsunit/wasm/wasm-constants.js"); 7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js"); 8 load("test/mjsunit/wasm/wasm-module-builder.js");
9 9
10 var kMemSize = 65536; 10 var kMemSize = 65536;
11 11
12 function genModule(memory) { 12 function genModule(memory) {
13 var builder = new WasmModuleBuilder(); 13 var builder = new WasmModuleBuilder();
14 14
15 builder.addMemory(1, 1, true); 15 builder.addMemory(1, 1, true);
16 builder.addFunction("main", kSig_i_i) 16 builder.addFunction("main", kSig_i_i)
17 .addBody([ 17 .addBody([
18 // main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0; 18 // main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0;
19 // TODO(titzer): this manual bytecode has a copy of test-run-wasm.cc 19 // TODO(titzer): this manual bytecode has a copy of test-run-wasm.cc
20 /**/ kExprLoop, kAstStmt, // -- 20 /**/ kExprLoop, kWasmStmt, // --
21 /* */ kExprGetLocal, 0, // -- 21 /* */ kExprGetLocal, 0, // --
22 /* */ kExprIf, kAstStmt, // -- 22 /* */ kExprIf, kWasmStmt, // --
23 /* */ kExprGetLocal, 0, // -- 23 /* */ kExprGetLocal, 0, // --
24 /* */ kExprI32LoadMem, 0, 0, // -- 24 /* */ kExprI32LoadMem, 0, 0, // --
25 /* */ kExprIf, kAstStmt, // -- 25 /* */ kExprIf, kWasmStmt, // --
26 /* */ kExprI8Const, 255, // -- 26 /* */ kExprI8Const, 255, // --
27 /* */ kExprReturn, // -- 27 /* */ kExprReturn, // --
28 /* */ kExprEnd, // -- 28 /* */ kExprEnd, // --
29 /* */ kExprGetLocal, 0, // -- 29 /* */ kExprGetLocal, 0, // --
30 /* */ kExprI8Const, 4, // -- 30 /* */ kExprI8Const, 4, // --
31 /* */ kExprI32Sub, // -- 31 /* */ kExprI32Sub, // --
32 /* */ kExprSetLocal, 0, // -- 32 /* */ kExprSetLocal, 0, // --
33 /* */ kExprBr, 1, // -- 33 /* */ kExprBr, 1, // --
34 /* */ kExprEnd, // -- 34 /* */ kExprEnd, // --
35 /* */ kExprEnd, // -- 35 /* */ kExprEnd, // --
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 162
163 for (offset = 65534; offset < 66536; offset++) { 163 for (offset = 65534; offset < 66536; offset++) {
164 assertTraps(kTrapMemOutOfBounds, read); 164 assertTraps(kTrapMemOutOfBounds, read);
165 assertTraps(kTrapMemOutOfBounds, write); 165 assertTraps(kTrapMemOutOfBounds, write);
166 } 166 }
167 } 167 }
168 168
169 testOOBThrows(); 169 testOOBThrows();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/instantiate-module-basic.js ('k') | test/mjsunit/wasm/params.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698