MCPcopy Create free account
hub / github.com/nodejs/node / AddFunctions

Function AddFunctions

deps/v8/test/mjsunit/wasm/indirect-tables.js:9–30  ·  view source on GitHub ↗
(builder)

Source from the content-addressed store, hash-verified

7d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
8
9function AddFunctions(builder) {
10 let sig_index = builder.addType(kSig_i_ii);
11 let mul = builder.addFunction("mul", sig_index)
12 .addBody([
13 kExprLocalGet, 0, // --
14 kExprLocalGet, 1, // --
15 kExprI32Mul // --
16 ]);
17 let add = builder.addFunction("add", sig_index)
18 .addBody([
19 kExprLocalGet, 0, // --
20 kExprLocalGet, 1, // --
21 kExprI32Add // --
22 ]);
23 let sub = builder.addFunction("sub", sig_index)
24 .addBody([
25 kExprLocalGet, 0, // --
26 kExprLocalGet, 1, // --
27 kExprI32Sub // --
28 ]);
29 return {mul: mul, add: add, sub: sub};
30}
31
32function js_div(a, b) { return (a / b) | 0; }
33

Callers 1

indirect-tables.jsFile · 0.70

Calls 3

addTypeMethod · 0.45
addBodyMethod · 0.45
addFunctionMethod · 0.45

Tested by

no test coverage detected