]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/varargs-inlined-simple-exit-aliasing-weird.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / varargs-inlined-simple-exit-aliasing-weird.js
1 function foo(a, b) {
2 return a + b;
3 }
4
5 function verify(a, b) {
6 if (a !== b)
7 throw "Error: the two arguments objects aren't identical.";
8 }
9
10 noInline(verify);
11
12 function bar() {
13 var a = arguments;
14 this.verify(arguments, a);
15 return foo.apply(null, a);
16 }
17
18 function baz(a, b) {
19 return this.bar(a, b);
20 }
21
22 noInline(baz);
23
24 for (var i = 0; i < 20000; ++i) {
25 var o = {
26 baz: baz,
27 bar: bar,
28 verify: function() { }
29 };
30 var result = o.baz(1, 2);
31 if (result != 1 + 2)
32 throw "Error: bad result: " + result;
33 }
34
35 var o = {
36 baz: baz,
37 bar: bar,
38 verify: verify
39 };
40 var result = o.baz(1, 2);
41 if (result != 1 + 2)
42 throw "Error: bad result at end: " + result;