]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/load-varargs-elimination-bounds-check.js
3 for (var i
= 0; i
< arguments
.length
; ++i
)
4 result
+= arguments
[i
];
9 return foo
.apply(this, arguments
);
14 return bar(1, 2, 3, 4);
20 // Execute baz() once with p set, so that the call has a valid prediction.
23 // Warm up profiling in bar and foo. Convince this profiling that bar()'s varargs call will tend to
24 // pass a small number of arguments;
25 for (var i
= 0; i
< 1000; ++i
)
28 // Now compile baz(), but don't run the bad code yet.
29 for (var i
= 0; i
< 10000; ++i
)
32 // Finally, trigger the bug.
33 var result
= baz(true);
35 throw "Error: bad result: " + result
;