summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/profiler/bug1427774.js
blob: 53a3103f3b2c918007c2b64991d667dc2c34f1c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
setJitCompilerOption("baseline.warmup.trigger", 0);
enableGeckoProfiling();
try {
    enableSingleStepProfiling();
} catch(e) {
    quit();
}
function removeAdd(dbg, g) {
    dbg.removeDebuggee(g);
}
function newGlobalDebuggerPair(toggleSeq) {
    var g = newGlobal({newCompartment: true});
    var dbg = new Debugger;
    dbg.addDebuggee(g);
    g.eval("" + function f() {return 100});
    return [g, dbg];
}
function testTrap(toggleSeq) {
    var [g, dbg] = newGlobalDebuggerPair(toggleSeq);
    dbg.onEnterFrame = function(f) {
        f.script.setBreakpoint(Symbol.iterator == (this) ^ (this), {
            hit: function() {
                toggleSeq(dbg, g);
            }
        });
    };
    assertEq(g.f(), 100);
}
testTrap(removeAdd);