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

Function RunAsmJsTest

deps/v8/test/mjsunit/wasm/asm-wasm-i32.js:26–39  ·  view source on GitHub ↗
(asmfunc, expect)

Source from the content-addressed store, hash-verified

24}
25
26function RunAsmJsTest(asmfunc, expect) {
27 var asm_source = asmfunc.toString();
28 var nonasm_source = asm_source.replace(new RegExp("use asm"), "");
29 var stdlib = {Math: Math};
30
31 print("Testing " + asmfunc.name + " (js)...");
32 var js_module = eval("(" + nonasm_source + ")")(stdlib);
33 expect(js_module);
34
35 print("Testing " + asmfunc.name + " (asm.js)...");
36 var asm_module = asmfunc(stdlib);
37 assertTrue(%IsAsmWasmCode(asmfunc));
38 expect(asm_module);
39}
40
41const imul = Math.imul;
42const Math_max = Math.max;

Callers 1

asm-wasm-i32.jsFile · 0.70

Calls 5

expectFunction · 0.70
printFunction · 0.50
evalFunction · 0.50
assertTrueFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected