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

Unified Diff: test/mjsunit/regress/regress-crbug-196583.js

Issue 12620014: Fix detection of |handle_smi| case in HOptimizedGraphBuilder::HandlePolymorphicCallNamed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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-crbug-196583.js
diff --git a/test/mjsunit/regress/regress-2539.js b/test/mjsunit/regress/regress-crbug-196583.js
similarity index 79%
copy from test/mjsunit/regress/regress-2539.js
copy to test/mjsunit/regress/regress-crbug-196583.js
index 5d263f8912bb7f44083d159cfead81ba33a3a3b4..c486158e22e92d2f73fe3473d822a8f6136aed4b 100644
--- a/test/mjsunit/regress/regress-2539.js
+++ b/test/mjsunit/regress/regress-crbug-196583.js
@@ -27,29 +27,26 @@
// Flags: --allow-natives-syntax
-"use strict";
-var dispatcher = {};
-dispatcher.func = C;
+var a = 1;
+a.__proto__.f = 1;
+a.__proto__.f = function() { return 1; }
-function A() {
- B(10, 11);
-}
+// Create some polymorphism.
+function B() {}
+B.prototype = {f: function() { return 2; }};
+var b = new B();
+function C() {}
+C.prototype = {g: "foo", f: function() { return 3; }};
+var c = new C();
-function B(x,y) {
- x = 0; y = 0;
- dispatcher.func.apply(this, arguments);
- assertSame(2, arguments.length);
- assertSame(10, arguments[0]);
- assertSame(11, arguments[1]);
+function crash(obj) {
+ return obj.f();
}
-function C(x,y) {
- assertSame(2, arguments.length);
- assertSame(10, arguments[0]);
- assertSame(11, arguments[1]);
+for (var i = 0; i < 2; i++) {
+ crash(a);
+ crash(b);
+ crash(c);
}
-
-A();
-A();
-%OptimizeFunctionOnNextCall(A);
-A();
+%OptimizeFunctionOnNextCall(crash);
+assertEquals(1, crash(a));
« 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