binary-slow.js (1017B)
1 load(libdir + "wasm-binary.js"); 2 3 const wasmEval = (code, imports) => new WebAssembly.Instance(new WebAssembly.Module(code), imports).exports; 4 const v2vSig = {args:[], ret:VoidCode}; 5 const v2vSigSection = sigSection([v2vSig]); 6 7 // Deep nesting shouldn't crash or even throw. This test takes a long time to 8 // run with the JITs disabled, so to avoid occasional timeout, disable. Also 9 // in eager mode, this triggers pathological recompilation, so only run for 10 // "normal" JIT modes. This test is totally independent of the JITs so this 11 // shouldn't matter. 12 var jco = getJitCompilerOptions(); 13 if (jco["ion.enable"] && jco["baseline.enable"] && jco["baseline.warmup.trigger"] > 0 && jco["ion.warmup.trigger"] > 10) { 14 var manyBlocks = []; 15 for (var i = 0; i < 20000; i++) 16 manyBlocks.push(BlockCode, VoidCode); 17 for (var i = 0; i < 20000; i++) 18 manyBlocks.push(EndCode); 19 wasmEval(moduleWithSections([v2vSigSection, declSection([0]), bodySection([funcBody({locals:[], body:manyBlocks})])])); 20 }