Chromium Code Reviews| Index: test/mjsunit/wasm/default-func-call2.js |
| diff --git a/test/mjsunit/wasm/indirect-calls.js b/test/mjsunit/wasm/default-func-call2.js |
| similarity index 61% |
| copy from test/mjsunit/wasm/indirect-calls.js |
| copy to test/mjsunit/wasm/default-func-call2.js |
| index 80bee412e028541e3b54ba7a175a512cb8293e77..af4e9724950485dcae2bad6d0eb810af3159cc8e 100644 |
| --- a/test/mjsunit/wasm/indirect-calls.js |
| +++ b/test/mjsunit/wasm/default-func-call2.js |
| @@ -1,8 +1,10 @@ |
| // Copyright 2015 the V8 project authors. All rights reserved. |
| +// |
|
bradn
2016/06/16 08:00:20
Extra line.
Separate file?
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // Flags: --expose-wasm |
| +// Flags: --wasm-jit-prototpe |
| load("test/mjsunit/wasm/wasm-constants.js"); |
| load("test/mjsunit/wasm/wasm-module-builder.js"); |
| @@ -22,6 +24,16 @@ var module = (function () { |
| kExprGetLocal, 1, // -- |
| kExprI32Sub, // -- |
| ]); |
| + builder.appendToFunctionTable([0, 1]); |
| + for (var i = 0; i < 2000; i++) { |
| + builder.addFunction("sub".concat(i.toString()), sig_index) |
| + .addBody([ |
| + kExprGetLocal, 0, |
| + kExprGetLocal, 1, |
| + kExprI32Sub, |
| + ]); |
| + builder.appendToFunctionTable([i + 2]); |
| + } |
| builder.addFunction("main", kSig_i_iii) |
| .addBody([ |
| kExprGetLocal, 0, |
| @@ -30,7 +42,7 @@ var module = (function () { |
| kExprCallIndirect, kArity2, sig_index |
| ]) |
| .exportFunc() |
| - builder.appendToFunctionTable([0, 1, 2]); |
| + builder.appendToFunctionTable([2002]); |
| return builder.instantiate({add: function(a, b) { return a + b | 0; }}); |
| })(); |
| @@ -45,5 +57,10 @@ assertEquals("function", typeof module.exports.main); |
| assertEquals(5, module.exports.main(1, 12, 7)); |
| assertEquals(19, module.exports.main(0, 12, 7)); |
| -assertTraps(kTrapFuncSigMismatch, "module.exports.main(2, 12, 33)"); |
| -assertTraps(kTrapFuncInvalid, "module.exports.main(3, 12, 33)"); |
| +assertTraps(kTrapFuncSigMismatch, "module.exports.main(2002, 12, 33)"); |
| +assertTraps(kTrapFuncInvalid, "module.exports.main(-1, 12, 33)"); |
| +assertTraps(kTrapFuncInvalid, "module.exports.main(2003, 12, 33)"); |
| +assertTraps(kTrapFuncInvalid, "module.exports.main(4005, 12, 33)"); |
| +assertTraps(kTrapFuncInvalid, "module.exports.main(4006, 12, 33)"); |
| +assertTraps(kTrapFuncInvalid, "module.exports.main(4004, 12, 33)"); |
| +assertTraps(kTrapFuncInvalid, "module.exports.main(100000, 12, 33)"); |