summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/auto-regress/bug557946.js
blob: 1ccfe2c7239ed52d91db5b06b1f37dfedddeb17d (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Binary: cache/js-dbg-64-6f1a38b94754-linux
// Flags: -j
//

var x = 0;
var y = 0;

function h() {
    if (x == 1)
        y++;
    else
        y--;
}

function F() {
    var m = null;

    function g(i) {
        /* Force outgoing typemaps to have a string. */
        m = "badness";

        /* Loop a bit. */
        for (var i = 0; i < 10; i++) {
            h();
        }
    }

    /* Spin for a while so trees build. */
    for (var i = 0; i < 100; i++) {
        /* Capture m == TT_NULL in outgoing fi for rp[0] */
        g();

        /* Flip the switch to bail out with deep nested frames. */
        if (i > 50)
            x = 1;

        /* Set m = null on the loop tail to get better traces. */
        m = null;
    }
}

F();