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

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

Issue 2226053002: [wasm] Remove single function JIT support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Drop test Created 4 years, 4 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 | « src/wasm/wasm-opcodes.h ('k') | test/mjsunit/wasm/jit-single-function.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5
6 // Flags: --expose-wasm
7 // Flags: --wasm-jit-prototype
8
9 load("test/mjsunit/wasm/wasm-constants.js");
10 load("test/mjsunit/wasm/wasm-module-builder.js");
11
12 var module = (function () {
13 var builder = new WasmModuleBuilder();
14
15 var sig_index = builder.addType(kSig_i_ii);
16 builder.addPadFunctionTable(512);
17 builder.addImport("add", sig_index);
18 builder.addFunction("add", sig_index)
19 .addBody([
20 kExprGetLocal, 0, kExprGetLocal, 1, kExprCallImport, kArity2, 0
21 ]);
22 builder.addFunction("sub", sig_index)
23 .addBody([
24 kExprGetLocal, 0, // --
25 kExprGetLocal, 1, // --
26 kExprI32Sub, // --
27 ]);
28 builder.addFunction("main", kSig_i_iii)
29 .addBody([
30 kExprGetLocal, 0,
31 kExprGetLocal, 1,
32 kExprGetLocal, 2,
33 kExprCallIndirect, kArity2, sig_index
34 ])
35 .exportFunc()
36 builder.appendToTable([0, 1, 2]);
37
38 return builder.instantiate({add: function(a, b) { return a + b | 0; }});
39 })();
40
41 // Check the module exists.
42 assertFalse(module === undefined);
43 assertFalse(module === null);
44 assertFalse(module === 0);
45 assertEquals("object", typeof module.exports);
46 assertEquals("function", typeof module.exports.main);
47
48 assertEquals(5, module.exports.main(1, 12, 7));
49 assertEquals(19, module.exports.main(0, 12, 7));
50
51 assertTraps(kTrapFuncSigMismatch, "module.exports.main(2, 12, 33)");
52 assertTraps(kTrapFuncSigMismatch, "module.exports.main(4, 12, 33)");
53 assertTraps(kTrapFuncSigMismatch, "module.exports.main(511, 12, 33)");
54 assertTraps(kTrapFuncInvalid, "module.exports.main(512, 12, 33)");
55 assertTraps(kTrapFuncInvalid, "module.exports.main(1025, 12, 33)");
56 assertTraps(kTrapFuncInvalid, "module.exports.main(-1, 12, 33)");
OLDNEW
« no previous file with comments | « src/wasm/wasm-opcodes.h ('k') | test/mjsunit/wasm/jit-single-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698