michael@0: function Foo() { michael@0: for (var i=0; i<10; i++) { michael@0: this["p" + i] = i; michael@0: } michael@0: } michael@0: michael@0: function test1(foo) { michael@0: for (var i=0; i<10400; i++) { michael@0: foo.p1 = i; michael@0: foo.p9 = i; michael@0: var x = foo.p0 + foo.p1 + foo.p2 + foo.p8 + foo.p4 + michael@0: foo.p5 + foo.p6 + foo.p7 + foo.p3 + foo.p9; michael@0: assertEq(x, i + i + 35); michael@0: } michael@0: } michael@0: michael@0: test1(new Foo); michael@0: michael@0: function Bar(arg) { michael@0: if (arg) { // Thwart definite-property analysis. michael@0: this.x = 1; michael@0: this.y = 2; michael@0: this.z = 3; michael@0: } michael@0: } michael@0: michael@0: function test2(bar) { michael@0: for (var i=0; i<10400; i++) { michael@0: bar.x++; michael@0: bar.y++; michael@0: bar.z++; michael@0: } michael@0: assertEq(bar.x, 10401); michael@0: assertEq(bar.y, 10402); michael@0: assertEq(bar.z, 10403); michael@0: } michael@0: michael@0: test2(new Bar(true));