js/src/jit-test/tests/auto-regress/bug557946.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/auto-regress/bug557946.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +// Binary: cache/js-dbg-64-6f1a38b94754-linux
     1.5 +// Flags: -j
     1.6 +//
     1.7 +/* vim: set ts=8 sts=4 et sw=4 tw=99: */
     1.8 +
     1.9 +var x = 0;
    1.10 +var y = 0;
    1.11 +
    1.12 +function h() {
    1.13 +    if (x == 1)
    1.14 +        y++;
    1.15 +    else
    1.16 +        y--;
    1.17 +}
    1.18 +
    1.19 +function F() {
    1.20 +    var m = null;
    1.21 +
    1.22 +    function g(i) {
    1.23 +        /* Force outgoing typemaps to have a string. */
    1.24 +        m = "badness";
    1.25 +
    1.26 +        /* Loop a bit. */
    1.27 +        for (var i = 0; i < 10; i++) {
    1.28 +            h();
    1.29 +        }
    1.30 +    }
    1.31 +
    1.32 +    /* Spin for a while so trees build. */
    1.33 +    for (var i = 0; i < 100; i++) {
    1.34 +        /* Capture m == TT_NULL in outgoing fi for rp[0] */
    1.35 +        g();
    1.36 +
    1.37 +        /* Flip the switch to bail out with deep nested frames. */
    1.38 +        if (i > 50)
    1.39 +            x = 1;
    1.40 +
    1.41 +        /* Set m = null on the loop tail to get better traces. */
    1.42 +        m = null;
    1.43 +    }
    1.44 +}
    1.45 +
    1.46 +F();
    1.47 +

mercurial