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