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

Unified Diff: test/mjsunit/regress/regress-convert-hole.js

Issue 16099006: Fix the hole loading optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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-convert-hole.js
diff --git a/test/mjsunit/regress/regress-2671-1.js b/test/mjsunit/regress/regress-convert-hole.js
similarity index 83%
copy from test/mjsunit/regress/regress-2671-1.js
copy to test/mjsunit/regress/regress-convert-hole.js
index 042a501e5adb86cd7d868ec721edef8edde27274..14242219262e5aaa5f9591ecc7a36d3bfbdae451 100644
--- a/test/mjsunit/regress/regress-2671-1.js
+++ b/test/mjsunit/regress/regress-convert-hole.js
@@ -27,19 +27,26 @@
// Flags: --allow-natives-syntax
-var y;
-function f() {
- var a = [];
- a[20] = 0;
- y = 3;
- var i = 7 * (y + -0);
- a[i]++;
- assertTrue(isNaN(a[i]));
+function f(test, test2, a, i) {
+ var o = [0.5,1,,3];
+ var d;
+ if (test) {
+ d = 1.5;
+ } else {
+ d = o[i];
+ }
+ if (test2) {
+ d += 1;
+ }
+ a[i] = d;
+ return d;
}
-f();
-f();
-f();
+var a = [0, 0, 0, {}];
+f(true, false, a, 0);
+f(true, true, a, 0);
+f(false, false, a, 1);
+f(false, true, a, 1);
%OptimizeFunctionOnNextCall(f);
-f();
-
+f(false, false, a, 2);
+assertEquals(undefined, a[2]);
« 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