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

Function testCallPrint

deps/v8/test/mjsunit/wasm/import-function.js:237–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235
236
237function testCallPrint() {
238 var builder = new WasmModuleBuilder();
239 builder.addImport("q", "print", makeSig_v_x(kWasmI32));
240 builder.addImport("q", "print", makeSig_r_x(kWasmF64, kWasmF64));
241 builder.addFunction("main", makeSig_r_x(kWasmF64, kWasmF64))
242 .addBody([
243 kExprI32Const, 27, // --
244 kExprCallFunction, 0, // --
245 kExprLocalGet, 0, // --
246 kExprCallFunction, 1 // --
247 ])
248 .exportFunc();
249
250 var main = builder.instantiate({q: {print: print}}).exports.main;
251
252 for (var i = -9; i < 900; i += 16.125) {
253 main(i);
254 }
255}
256
257testCallPrint();
258testCallPrint();

Callers 1

import-function.jsFile · 0.85

Calls 8

addImportMethod · 0.95
addFunctionMethod · 0.95
instantiateMethod · 0.95
makeSig_v_xFunction · 0.70
makeSig_r_xFunction · 0.70
mainFunction · 0.70
exportFuncMethod · 0.45
addBodyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…