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

Side by Side Diff: test/mjsunit/wasm/default-func-call.js

Issue 2049513003: [wasm] Support undefined indirect table entries, behind a flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] Patching in the change to have only one runtime check, instead of two. Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 //
bradn 2016/06/16 08:00:20 Extra line. Maybe in a separate file?
2 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 4 // found in the LICENSE file.
4 5
5 // Flags: --expose-wasm 6 // Flags: --expose-wasm
7 // Flags: --wasm-jit-prototpe
6 8
7 load("test/mjsunit/wasm/wasm-constants.js"); 9 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js"); 10 load("test/mjsunit/wasm/wasm-module-builder.js");
9 11
10 var module = (function () { 12 var module = (function () {
11 var builder = new WasmModuleBuilder(); 13 var builder = new WasmModuleBuilder();
12 14
13 var sig_index = builder.addSignature(kSig_i_ii); 15 var sig_index = builder.addSignature(kSig_i_ii);
14 builder.addImport("add", sig_index); 16 builder.addImport("add", sig_index);
15 builder.addFunction("add", sig_index) 17 builder.addFunction("add", sig_index)
(...skipping 24 matching lines...) Expand all
40 assertFalse(module === null); 42 assertFalse(module === null);
41 assertFalse(module === 0); 43 assertFalse(module === 0);
42 assertEquals("object", typeof module.exports); 44 assertEquals("object", typeof module.exports);
43 assertEquals("function", typeof module.exports.main); 45 assertEquals("function", typeof module.exports.main);
44 46
45 assertEquals(5, module.exports.main(1, 12, 7)); 47 assertEquals(5, module.exports.main(1, 12, 7));
46 assertEquals(19, module.exports.main(0, 12, 7)); 48 assertEquals(19, module.exports.main(0, 12, 7));
47 49
48 assertTraps(kTrapFuncSigMismatch, "module.exports.main(2, 12, 33)"); 50 assertTraps(kTrapFuncSigMismatch, "module.exports.main(2, 12, 33)");
49 assertTraps(kTrapFuncInvalid, "module.exports.main(3, 12, 33)"); 51 assertTraps(kTrapFuncInvalid, "module.exports.main(3, 12, 33)");
52 assertTraps(kTrapFuncInvalid, "module.exports.main(4, 12, 33)");
53 assertTraps(kTrapFuncInvalid, "module.exports.main(1023, 12, 33)");
54 assertTraps(kTrapFuncInvalid, "module.exports.main(1025, 12, 33)");
55 assertTraps(kTrapFuncInvalid, "module.exports.main(2048, 12, 33)");
56 assertTraps(kTrapFuncInvalid, "module.exports.main(511, 12, 33)");
57 assertTraps(kTrapFuncInvalid, "module.exports.main(513, 12, 33)");
58 assertTraps(kTrapFuncInvalid, "module.exports.main(-1, 12, 33)");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698