js/src/jit-test/tests/debug/breakpoint-gc-03.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // |jit-test| debug
     2 // The GC can cope with old and new breakpoints at the same position.
     4 // This is a regression test for a bug Bill McCloskey found just by looking at
     5 // the source code. See bug 677386 comment 8. Here we're testing that the trap
     6 // string is correctly marked. (The silly expression for the trap string is to
     7 // ensure that it isn't constant-folded; it's harder to get a compile-time
     8 // constant to be GC'd.)
    10 var g = newGlobal();
    11 g.eval("var d = 0;\n" +
    12        "function f() { return 'ok'; }\n" +
    13        "trap(f, 0, Array(17).join('\\n') + 'd++;');\n");
    15 var dbg = new Debugger;
    16 var gw = dbg.addDebuggee(g);
    17 var fw = gw.getOwnPropertyDescriptor("f").value;
    18 var bp = {hits: 0, hit: function (frame) { this.hits++; }};
    19 fw.script.setBreakpoint(0, bp);
    21 gc();
    23 g.f();
    24 assertEq(g.d, 1);
    25 assertEq(bp.hits, 1);

mercurial