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

Function RunAsmJsTest

deps/v8/test/mjsunit/wasm/asm-wasm-u32.js:23–36  ·  view source on GitHub ↗
(asmfunc, expect)

Source from the content-addressed store, hash-verified

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

Callers 1

asm-wasm-u32.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