Index: test/mjsunit/regress/regress-crbug-306851.js |
diff --git a/test/mjsunit/regress/regress-crbug-233737.js b/test/mjsunit/regress/regress-crbug-306851.js |
similarity index 77% |
copy from test/mjsunit/regress/regress-crbug-233737.js |
copy to test/mjsunit/regress/regress-crbug-306851.js |
index 835726b22429ec3cca68df956255d47c53fcfd25..77b711a656c977d27d835d6746fdf5654993cd7b 100644 |
--- a/test/mjsunit/regress/regress-crbug-233737.js |
+++ b/test/mjsunit/regress/regress-crbug-306851.js |
@@ -27,16 +27,26 @@ |
// Flags: --allow-natives-syntax |
-var a = new Array(2); |
-a[0] = 1; |
-assertTrue(%HasFastSmiElements(a)); |
-assertTrue(%HasFastHoleyElements(a)); |
+function Counter() { |
+ this.value = 0; |
+}; |
-function hole(i) { |
- return a[i] << 0; |
+Object.defineProperty(Counter.prototype, 'count', { |
+ get: function() { return this.value; }, |
+ set: function(value) { this.value = value; } |
+}); |
+ |
+var obj = new Counter(); |
+ |
+function bummer() { |
+ obj.count++; |
+ return obj.count; |
} |
-assertEquals(1, hole(0)); |
-assertEquals(1, hole(0)); |
-%OptimizeFunctionOnNextCall(hole); |
-assertEquals(0, hole(1)); |
+assertEquals(1, bummer()); |
+assertEquals(2, bummer()); |
+assertEquals(3, bummer()); |
+%OptimizeFunctionOnNextCall(bummer); |
+assertEquals(4, bummer()); |
+assertEquals(5, bummer()); |
+assertEquals(6, bummer()); |