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

Function addFunction

deps/v8/test/mjsunit/wasm/wasm-interpreter.js:543–567  ·  view source on GitHub ↗
(builder, name, value, makeConstInstr, loadInstr,
    storeInstr, notEqInstr)

Source from the content-addressed store, hash-verified

541(function testLoadStoreSuperInstruction() {
542 print(arguments.callee.name);
543 let addFunction = function (builder, name, value, makeConstInstr, loadInstr,
544 storeInstr, notEqInstr) {
545 builder.addFunction(name, kSig_v_v)
546 .addBody([
547 ...wasmI32Const(1),
548 ...makeConstInstr(value),
549 storeInstr, 0, 0,
550
551 ...wasmI32Const(2),
552 ...wasmI32Const(0),
553 ...wasmI32Const(1),
554 kExprI32Add,
555 loadInstr, 0, 0,
556 storeInstr, 0, 0,
557
558 ...wasmI32Const(2),
559 loadInstr, 0, 0,
560 ...makeConstInstr(value),
561 notEqInstr,
562 kExprIf, kWasmVoid,
563 kExprUnreachable,
564 kExprEnd,
565 ])
566 .exportAs(name);
567 }
568 var builder = new WasmModuleBuilder();
569 addFunction(builder, "test_i32_r2s_LoadStore", 42, wasmI32Const,
570 kExprI32LoadMem, kExprI32StoreMem, kExprI32Ne);

Callers 1

Calls 4

wasmI32ConstFunction · 0.70
exportAsMethod · 0.45
addBodyMethod · 0.45
addFunctionMethod · 0.45

Tested by

no test coverage detected