Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: test/mjsunit/regress/regress-calls-with-migrating-prototypes.js

Issue 104793003: Fix polymorphic inlined calls with migrating prototypes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed inefficient recursion Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/typing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « src/typing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698