| Index: test/mjsunit/outobject-double-for-in.js
|
| diff --git a/test/mjsunit/regress/regress-crbug-134055.js b/test/mjsunit/outobject-double-for-in.js
|
| similarity index 66%
|
| copy from test/mjsunit/regress/regress-crbug-134055.js
|
| copy to test/mjsunit/outobject-double-for-in.js
|
| index 9b658fb6f650f04520001f61f8e34d0202c5fb7d..eb8ac940a7f403af5db752d779a4b35acab0c6a1 100644
|
| --- a/test/mjsunit/regress/regress-crbug-134055.js
|
| +++ b/test/mjsunit/outobject-double-for-in.js
|
| @@ -27,37 +27,40 @@
|
|
|
| // Flags: --allow-natives-syntax
|
|
|
| -function crash(obj) {
|
| - return obj.foo;
|
| +function DoubleContainer() {
|
| + this.x0 = 0.5;
|
| + this.x1 = undefined;
|
| + this.x2 = undefined;
|
| + this.x3 = undefined;
|
| + this.x4 = undefined;
|
| + this.x5 = undefined;
|
| + this.x6 = undefined;
|
| + this.x7 = 5;
|
| + this.x8 = undefined;
|
| + this.x9 = undefined;
|
| + this.x10 = undefined;
|
| + this.x11 = undefined;
|
| + this.x12 = undefined;
|
| + this.x13 = undefined;
|
| + this.x14 = undefined;
|
| + this.x15 = undefined;
|
| + this.x16 = true;
|
| + this.y = 2.5;
|
| }
|
|
|
| -function base(number_of_properties) {
|
| - var result = new Array();
|
| - for (var i = 0; i < number_of_properties; i++) {
|
| - result["property" + i] = "value" + i;
|
| +var z = new DoubleContainer();
|
| +
|
| +function test_props(a) {
|
| + for (var i in a) {
|
| + assertTrue(i !== "x0" || a[i] === 0.5);
|
| + assertTrue(i !== "y" || a[i] === 2.5);
|
| + assertTrue(i !== "x12" || a[i] === undefined);
|
| + assertTrue(i !== "x16" || a[i] === true);
|
| + assertTrue(i !== "x7" || a[i] === 5);
|
| }
|
| - result.foo = number_of_properties;
|
| - return result;
|
| }
|
|
|
| -var a = base(12);
|
| -var b = base(13);
|
| -var c = base(14);
|
| -var d = base(15);
|
| -
|
| -crash(a); // Premonomorphic.
|
| -crash(a);
|
| -crash(b);
|
| -crash(c);
|
| -crash(d); // Polymorphic, degree 4.
|
| -
|
| -//Prepare ElementsKind transition map chain.
|
| -var x = base(13);
|
| -x[0] = "object";
|
| -x = base(14);
|
| -x[0] = "object";
|
| -x = base(15);
|
| -x[0] = "object";
|
| -
|
| -%OptimizeFunctionOnNextCall(crash);
|
| -crash(a);
|
| +test_props(z);
|
| +test_props(z);
|
| +%OptimizeFunctionOnNextCall(test_props);
|
| +test_props(z);
|
|
|