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

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

Issue 10630027: Make near-jump check more strict in LoadNamedFieldPolymorphic on ia32/x64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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/x64/lithium-codegen-x64.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-134055.js
diff --git a/test/mjsunit/compiler/optimized-closures.js b/test/mjsunit/regress/regress-crbug-134055.js
similarity index 72%
copy from test/mjsunit/compiler/optimized-closures.js
copy to test/mjsunit/regress/regress-crbug-134055.js
index eaf75f8d00ccd9123ed0f5232a91137845fc3973..9b658fb6f650f04520001f61f8e34d0202c5fb7d 100644
--- a/test/mjsunit/compiler/optimized-closures.js
+++ b/test/mjsunit/regress/regress-crbug-134055.js
@@ -27,31 +27,37 @@
// Flags: --allow-natives-syntax
-// Test optimized closures.
-
-var a = new Array(100);
+function crash(obj) {
+ return obj.foo;
+}
-function f() {
- var x=0;
- for (var i=0; i<100; i++) {
- var g = function goo(y) {
- function h() {
- if (goo.arguments[0] == 23) return -42;
- return 42;
- }
- return x + y + h(y);
- }
- g(0);
- %OptimizeFunctionOnNextCall(g);
- a[i] = g(i);
+function base(number_of_properties) {
+ var result = new Array();
+ for (var i = 0; i < number_of_properties; i++) {
+ result["property" + i] = "value" + i;
}
+ result.foo = number_of_properties;
+ return result;
}
-f();
-assertEquals(42, a[0]);
-assertEquals(49, a[7]);
-assertEquals(-19, a[23]);
-
-
-
-
+var a = base(12);
+var b = base(13);
+var c = base(14);
+var d = base(15);
+
+crash(a); // Premonomorphic.
+crash(a);
+crash(b);
+crash(c);
+crash(d); // Polymorphic, degree 4.
+
+//Prepare ElementsKind transition map chain.
+var x = base(13);
+x[0] = "object";
+x = base(14);
+x[0] = "object";
+x = base(15);
+x[0] = "object";
+
+%OptimizeFunctionOnNextCall(crash);
+crash(a);
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698