]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / llint-cache-replace-then-cache-get-and-fold-then-invalidate.js
1 var o = {f:42};
2
3 function foo(v) {
4 o.f = v;
5 }
6
7 function bar() {
8 return o.f;
9 }
10
11 noInline(foo);
12 noInline(bar);
13
14 foo(42);
15 foo(42);
16
17 for (var i = 0; i < 100000; ++i) {
18 var result = bar();
19 if (result != 42)
20 throw "Error: bad result: " + result;
21 }
22
23 foo(53);
24 var result = bar();
25 if (result != 53)
26 throw "Error: bad result at end: " + result;