js/src/jit-test/tests/jaeger/recompile/nativestack.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/jaeger/recompile/nativestack.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,25 @@
     1.4 +
     1.5 +/* Recompilation that requires patching the same native stub multiple times on one stack. */
     1.6 +
     1.7 +var first = 0;
     1.8 +var second = 0;
     1.9 +
    1.10 +function eacher(f, vfirst, vsecond) {
    1.11 +  var a = [0];
    1.12 +  a.forEach(f);
    1.13 +  assertEq(first, vfirst);
    1.14 +  assertEq(second, vsecond);
    1.15 +}
    1.16 +
    1.17 +function one() {
    1.18 +  eacher(two, 'one', 'two');
    1.19 +}
    1.20 +
    1.21 +function two() {
    1.22 +  eval("first = 'one';");
    1.23 +  eval("second = 'two';");
    1.24 +}
    1.25 +
    1.26 +eacher(function () {}, 0, 0);
    1.27 +eacher(function () {}, 0, 0);
    1.28 +eacher(one, 'one', 'two');

mercurial