summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/recompile/nativestack.js
blob: 350649afcdac161b60283dd189c54de10ef579d4 (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
/* Recompilation that requires patching the same native stub multiple times on one stack. */

var first = 0;
var second = 0;

function eacher(f, vfirst, vsecond) {
  var a = [0];
  a.forEach(f);
  assertEq(first, vfirst);
  assertEq(second, vsecond);
}

function one() {
  eacher(two, 'one', 'two');
}

function two() {
  eval("first = 'one';");
  eval("second = 'two';");
}

eacher(function () {}, 0, 0);
eacher(function () {}, 0, 0);
eacher(one, 'one', 'two');