]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/exit-after-int52-to-value.js
92ed1f85350250618066fbab293994a422fe9056
[apple/javascriptcore.git] / tests / stress / exit-after-int52-to-value.js
1 function foo(a, b, c) {
2 c.f.f = a.f + b.f;
3 }
4
5 noInline(foo);
6
7 var counter = 0;
8 function makeWeirdObject() {
9 var result = {};
10 result["blah" + (counter++)] = 42;
11 return result;
12 }
13
14 for (var i = 0; i < 100000; ++i) {
15 var o = makeWeirdObject();
16 foo({f:2000000000}, {f:2000000000}, {f:o});
17 if (o.f != 4000000000)
18 throw "Error: bad result: " + result;
19 }
20
21 var thingy;
22 Number.prototype.__defineSetter__("f", function(value) { thingy = value; });
23 foo({f:2000000000}, {f:2000000000}, {f:42});
24 if (thingy != 4000000000)
25 throw "Error: bad result: " + thingy;