Index: test/mjsunit/regress/regress-2593.js |
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/regress/regress-2593.js |
similarity index 76% |
copy from test/mjsunit/regress/regress-2489.js |
copy to test/mjsunit/regress/regress-2593.js |
index 882c4f794a88e24d1d64e86a466b27c39f51e625..fd158d5181ecfe1e60744a872b422af2f16b7855 100644 |
--- a/test/mjsunit/regress/regress-2489.js |
+++ b/test/mjsunit/regress/regress-2593.js |
@@ -25,26 +25,37 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Flags: --expose_gc |
-"use strict"; |
+p1 = { }; |
+p2 = { }; |
+p3 = { x : 1 }; |
+p2.__proto__ = p3 |
+p1.__proto__ = p2 |
-function f(a, b) { |
- return g("c", "d"); |
-} |
+// Normalize p1. |
+p1.some_random_property2 = 1 |
+delete p1.some_random_property2 |
+ |
+// Make sure all objects are in old space. |
+for (var i = 0; i < 10; i++) gc(); |
-function g(a, b) { |
- g.constructor.apply(this, arguments); |
+function f2() { |
+ p2.x; |
} |
-g.constructor = function(a, b) { |
- assertEquals("c", a); |
- assertEquals("d", b); |
+function f1() { |
+ return p1.x; |
} |
-f("a", "b"); |
-f("a", "b"); |
-%OptimizeFunctionOnNextCall(f); |
-f("a", "b"); |
-g.x = "deopt"; |
-f("a", "b"); |
+// Create load stub in p2. |
+for (var i = 0; i < 10; i++) f2(); |
+ |
+// Create load stub in p2 for p1. |
+for (var i = 0; i < 10; i++) f1(); |
+ |
+assertEquals(1, f1()); |
+ |
+p2.x = 2; |
+ |
+assertEquals(2, f1()); |