Index: test/mjsunit/regress/regress-calls-with-migrating-prototypes.js |
diff --git a/test/mjsunit/constant-compare-nil-value.js b/test/mjsunit/regress/regress-calls-with-migrating-prototypes.js |
similarity index 84% |
copy from test/mjsunit/constant-compare-nil-value.js |
copy to test/mjsunit/regress/regress-calls-with-migrating-prototypes.js |
index 9f5b2adb063abc0c7920d8dee30edb7ee6eb1ff9..a306e5d9d8914f90ede18ed8512bd85e094a0df1 100644 |
--- a/test/mjsunit/constant-compare-nil-value.js |
+++ b/test/mjsunit/regress/regress-calls-with-migrating-prototypes.js |
@@ -27,16 +27,23 @@ |
// Flags: --allow-natives-syntax |
-function inlined() { |
- return 1; |
+function f() { |
+ return 1; |
} |
- |
-function foo() { |
- if ((inlined() + 0.5) == null) return "null"; |
- return "non-null"; |
+function C1(f) { |
+ this.f = f; |
} |
- |
-assertEquals("non-null", foo()); |
-assertEquals("non-null", foo()); |
+var o1 = new C1(f); |
+var o2 = {__proto__: new C1(f) } |
+function foo(o) { |
+ return o.f(); |
+} |
+foo(o1); |
+foo(o1); |
+foo(o2); |
+foo(o1); |
+var o3 = new C1(function() { return 2; }); |
%OptimizeFunctionOnNextCall(foo); |
-assertEquals("non-null", foo()); |
+assertEquals(1, foo(o2)); |
+o2.__proto__.f = function() { return 3; }; |
+assertEquals(3, foo(o2)); |