]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - 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
... / ...
CommitLineData
1function foo(a, b) {
2 return a + b;
3}
4
5function verify(a, b) {
6 if (a !== b)
7 throw "Error: the two arguments objects aren't identical.";
8}
9
10noInline(verify);
11
12function bar() {
13 var a = arguments;
14 this.verify(arguments, a);
15 return foo.apply(null, a);
16}
17
18function baz(a, b) {
19 return this.bar(a, b);
20}
21
22noInline(baz);
23
24for (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
35var o = {
36 baz: baz,
37 bar: bar,
38 verify: verify
39};
40var result = o.baz(1, 2);
41if (result != 1 + 2)
42 throw "Error: bad result at end: " + result;