]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/simple-polyvariant-put-by-id-inlining-example.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / simple-polyvariant-put-by-id-inlining-example.js
1 function foo(o) {
2 bar(o);
3 }
4
5 function fuzz(o) {
6 bar(o);
7 }
8
9 function bar(o) {
10 o.f = 42;
11 }
12
13 noInline(foo);
14 noInline(fuzz);
15
16 for (var i = 0; i < 100000; ++i) {
17 var o = {};
18 foo(o);
19 if (o.f != 42)
20 throw "Error: bad result: " + o.f;
21 o = {f:23};
22 var result = fuzz(o);
23 if (o.f != 42)
24 throw "Error: bad result: " + o.f;
25 }
26