]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/ftl-library-inlining-loops.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / ftl-library-inlining-loops.js
1 function foo(){
2 var count = 100;
3 var d = new DataView(new ArrayBuffer(count));
4
5 for (var i = 0; i < count / 4; i++){
6 d.setInt32(i, i);
7 }
8
9 for (var i = 0; i < count; i++){
10 d.setInt8(i, i);
11 }
12 var result = 0;
13 for (var i = 0; i < count; i++){
14 result += d.getInt8(i);
15 }
16 return result;
17 }
18
19 noInline(foo);
20
21 var r = 0;
22 for (var i = 0 ; i < 50000; i++){
23 r += foo();
24 }
25
26 if (r != 247500000)
27 throw "Bad result: " + r;
28