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

Function addFunctions

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

Source from the content-addressed store, hash-verified

7let kMaxTableSize = 10000000;
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 testBounds(func, table) {
33 for (let i = 0; i < table.length; i++) {

Callers 1

table-grow.jsFile · 0.85

Calls 3

addTypeMethod · 0.45
addBodyMethod · 0.45
addFunctionMethod · 0.45

Tested by

no test coverage detected