debug-interrupt-2.js (1025B)
1 // |jit-test| exitstatus: 6; skip-if: !wasmDebuggingEnabled() 2 3 // Don't include wasm.js in timeout tests: when wasm isn't supported, it will 4 // quit(0) which will cause the test to fail. 5 6 // Note: this test triggers an interrupt and then iloops in Wasm code. If the 7 // interrupt fires before the Wasm code is compiled, the test relies on the 8 // JS interrupt check in onEnterFrame to catch it. Warp/Ion code however can 9 // elide the combined interrupt/overrecursion check in simple leaf functions. 10 // Long story short, set the Warp threshold to a non-zero value to prevent 11 // intermittent timeouts with --ion-eager. 12 setJitCompilerOption("ion.warmup.trigger", 30); 13 14 var g = newGlobal({newCompartment: true}); 15 g.parent = this; 16 g.eval("Debugger(parent).onEnterFrame = function() {};"); 17 timeout(0.01); 18 var code = wasmTextToBinary(`(module 19 (func $f2 20 loop $top 21 br $top 22 end 23 ) 24 (func (export "f1") 25 call $f2 26 ) 27 )`); 28 new WebAssembly.Instance(new WebAssembly.Module(code)).exports.f1();