OLD | NEW |
---|---|
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 | 5 // Flags: --expose-wasm |
6 // Flags: --wasm-jit-prototype | 6 // Flags: --wasm-jit-prototype |
7 | 7 |
8 load("test/mjsunit/wasm/wasm-constants.js"); | 8 load("test/mjsunit/wasm/wasm-constants.js"); |
9 load("test/mjsunit/wasm/wasm-module-builder.js"); | 9 load("test/mjsunit/wasm/wasm-module-builder.js"); |
10 | 10 |
11 var module = (function () { | 11 var module = (function () { |
12 var builder = new WasmModuleBuilder(); | 12 var builder = new WasmModuleBuilder(); |
13 | 13 |
14 var kSig_i_iiiii = | 14 var kSig_i_iiiii = |
15 makeSig([kAstI32, kAstI32, kAstI32, kAstI32, kAstI32], [kAstI32]); | 15 makeSig([kAstI32, kAstI32, kAstI32, kAstI32, kAstI32], [kAstI32]); |
16 | |
bradnelson
2016/07/21 19:05:20
No real change in file, drop it.
| |
17 var sig_index2 = builder.addType(kSig_i_ii); | 16 var sig_index2 = builder.addType(kSig_i_ii); |
18 var sig_index5 = builder.addType(kSig_i_iiiii); | 17 var sig_index5 = builder.addType(kSig_i_iiiii); |
19 | 18 |
20 builder.addMemory(1, 1, true); | 19 builder.addMemory(1, 1, true); |
21 var wasm_bytes_sub = [ | 20 var wasm_bytes_sub = [ |
22 0, | 21 0, |
23 kExprGetLocal, 0, | 22 kExprGetLocal, 0, |
24 kExprGetLocal, 1, | 23 kExprGetLocal, 1, |
25 kExprI32Sub | 24 kExprI32Sub |
26 ]; | 25 ]; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 | 69 |
71 // Check that the index lies in the bounds of the table size | 70 // Check that the index lies in the bounds of the table size |
72 assertTraps(kTrapInvalidIndex, "module.exports.main(0, 6, 10, 55, 99)"); | 71 assertTraps(kTrapInvalidIndex, "module.exports.main(0, 6, 10, 55, 99)"); |
73 assertTraps(kTrapInvalidIndex, "module.exports.main(0, 6, -1, 55, 99)"); | 72 assertTraps(kTrapInvalidIndex, "module.exports.main(0, 6, -1, 55, 99)"); |
74 | 73 |
75 // args: base offset, size of func_bytes, index, param1, param2 | 74 // args: base offset, size of func_bytes, index, param1, param2 |
76 assertEquals(-444, module.exports.main(0, 6, 3, 555, 999)); // JIT sub function | 75 assertEquals(-444, module.exports.main(0, 6, 3, 555, 999)); // JIT sub function |
77 assertEquals(13, module.exports.main(0, 6, 9, 45, 32)); // JIT sub function | 76 assertEquals(13, module.exports.main(0, 6, 9, 45, 32)); // JIT sub function |
78 assertEquals(187, module.exports.main(6, 6, 6, 17, 11)); // JIT mul function | 77 assertEquals(187, module.exports.main(6, 6, 6, 17, 11)); // JIT mul function |
79 assertEquals(30525, module.exports.main(6, 6, 9, 555, 55)); // JIT mul function | 78 assertEquals(30525, module.exports.main(6, 6, 9, 555, 55)); // JIT mul function |
OLD | NEW |