diff options
Diffstat (limited to 'js/src/jit-test/tests/jaeger/recompile/nativestack.js')
-rw-r--r-- | js/src/jit-test/tests/jaeger/recompile/nativestack.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/recompile/nativestack.js b/js/src/jit-test/tests/jaeger/recompile/nativestack.js new file mode 100644 index 000000000..350649afc --- /dev/null +++ b/js/src/jit-test/tests/jaeger/recompile/nativestack.js @@ -0,0 +1,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'); |