Debian Codegraph @

js/src/jit-test/tests/debug/bug1891662.js

raw
1 // |jit-test| --baseline-eager
2
3 var src = "";
4 for (var i = 0; i < 100; i++) {
5 src += "function foo" + i + "() { foo" + (i+1) + "(); }"
6 }
7 eval(src);
8
9 function foo100() {
10 let g = newGlobal({newCompartment: true});
11 let d = new g.Debugger(this);
12
13 // When we set this debugger hook, we will trigger 100
14 // baseline recompilations. We want an OOM to occur
15 // during one of those recompilations. We allocate
16 // about 400 times before starting recompilation, and
17 // about 30000 times total. This number is picked to
18 // leave a healthy margin on either side.
19 oomAtAllocation(5000);
20 d.onEnterFrame = () => {}
21 }
22 try {
23 foo0();
24 } catch {}