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

Unified Diff: test/mjsunit/regress/regress-polymorphic-load.js

Issue 25718002: Only fold polymorphic into monomorphic load if all load from either receiver or same prototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months 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/hydrogen.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-polymorphic-load.js
diff --git a/test/mjsunit/regress/regress-2671.js b/test/mjsunit/regress/regress-polymorphic-load.js
similarity index 91%
copy from test/mjsunit/regress/regress-2671.js
copy to test/mjsunit/regress/regress-polymorphic-load.js
index 8da1b8f07f69c487fe9913e485c60f3e257e0986..2545e85f60a2c7fe8f68dd9c667e38a0528ff127 100644
--- a/test/mjsunit/regress/regress-2671.js
+++ b/test/mjsunit/regress/regress-polymorphic-load.js
@@ -27,19 +27,17 @@
// Flags: --allow-natives-syntax
-var y;
-function f() {
- var a = [];
- a[20] = 0;
- y = 3;
- var i = 7 * (y + -0);
- a[i] = 1/y;
- assertFalse(isNaN(a[i]));
+function f(o) {
+ return o.x;
}
-f();
-f();
-f();
-%OptimizeFunctionOnNextCall(f);
-f();
+var o1 = {x:1};
+var o2 = {__proto__: {x:2}};
+f(o2);
+f(o2);
+f(o2);
+f(o1);
+%OptimizeFunctionOnNextCall(f);
+assertEquals(1, f(o1));
+assertEquals(2, f(o2));
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698