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

Function RunAsmJsTest

deps/v8/test/mjsunit/wasm/asm-wasm-f64.js:37–50  ·  view source on GitHub ↗
(asmfunc, expect)

Source from the content-addressed store, hash-verified

35}
36
37function RunAsmJsTest(asmfunc, expect) {
38 var asm_source = asmfunc.toString();
39 var nonasm_source = asm_source.replace(new RegExp("use asm"), "");
40 var stdlib = {Math: Math};
41
42 print("Testing " + asmfunc.name + " (js)...");
43 var js_module = eval("(" + nonasm_source + ")")(stdlib);
44 expect(js_module);
45
46 print("Testing " + asmfunc.name + " (asm.js)...");
47 var asm_module = asmfunc(stdlib);
48 assertTrue(%IsAsmWasmCode(asmfunc));
49 expect(asm_module);
50}
51
52const Math_ceil = Math.ceil;
53const Math_floor = Math.floor;

Callers 1

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