]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/llint-put-to-scope-global-cache-watchpoint-invalidate.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / llint-put-to-scope-global-cache-watchpoint-invalidate.js
1 function foo(v) {
2 global = v;
3 }
4
5 function bar() {
6 return global;
7 }
8
9 noInline(foo);
10 noInline(bar);
11
12 var value = 42;
13 foo(value);
14 var n = 100000;
15 var m = 100;
16 for (var i = 0; i < n; ++i) {
17 if (i == n - m)
18 foo(value = 53);
19 var result = bar();
20 if (result != value)
21 throw "Error: on iteration " + i + " got: " + result;
22 }