debug-interrupt-1.js (966B)
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 (export "f1") 20 (loop $top br $top) 21 ) 22 )`); 23 new WebAssembly.Instance(new WebAssembly.Module(code)).exports.f1();