js/src/jit-test/tests/ion/getprop-cache.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 function test1() {
     2     function h(node) {
     3         var x = 0.1;
     4         for (var i=0; i<100; i++) {
     5             x += node.parent;
     6         }
     7         return x;
     8     }
     9     function build(depth) {
    10         if (depth > 10)
    11             return {parent: 3.3};
    12         return {__proto__: build(depth + 1)};
    13     }
    14     var tree = build(0);
    15     assertEq(h(tree)|0, 330);
    16 }
    17 test1();
    19 function test2() {
    20     function Foo() {};
    21     Foo.prototype.x = 3.3;
    23     var o = new Foo();
    24     for (var i=0; i<100; i++) {
    25         assertEq(o.x, 3.3);
    26     }
    27 }
    28 test2();

mercurial