MCPcopy Index your code
hub / github.com/nodejs/node / generator

Function generator

deps/v8/test/mjsunit/wasm/array-init-from-segment.js:32–42  ·  view source on GitHub ↗
(name, segment)

Source from the content-addressed store, hash-verified

30 struct_type);
31
32 function generator(name, segment) {
33 builder.addFunction(name, makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32]))
34 .addBody([
35 kExprLocalGet, 0, // offset
36 kExprLocalGet, 1, // length
37 kGCPrefix, kExprArrayNewElem, array_type_index, segment,
38 kExprLocalGet, 2, // index in the array
39 kGCPrefix, kExprArrayGet, array_type_index,
40 kGCPrefix, kExprStructGet, struct_type_index, 0])
41 .exportFunc()
42 }
43
44 // Respective segment elements should be pointer-identical.
45 builder.addFunction("identical", makeSig([kWasmI32, kWasmI32], [kWasmI32]))

Callers 1

Calls 4

makeSigFunction · 0.70
exportFuncMethod · 0.45
addBodyMethod · 0.45
addFunctionMethod · 0.45

Tested by

no test coverage detected