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

Unified Diff: test/mjsunit/array-bounds-check-removal.js

Issue 10698125: Fixed array bounds check elimination (Chromium issue 132114). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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/array-bounds-check-removal.js
diff --git a/test/mjsunit/array-bounds-check-removal.js b/test/mjsunit/array-bounds-check-removal.js
index 81064aa2377ffcf6ba79a94b92f87eae89f31343..0ab30963261a4d995fa8523af589384d51c191ca 100644
--- a/test/mjsunit/array-bounds-check-removal.js
+++ b/test/mjsunit/array-bounds-check-removal.js
@@ -123,7 +123,7 @@ check_test_minus(7,false);
// ALWAYS: 3
// NEVER: 4
-if (false) {
+// Test that we still deopt on failed bound checks
test_base(5,true);
test_base(6,true);
test_base(5,false);
@@ -139,7 +139,21 @@ test_base(6,false);
%OptimizeFunctionOnNextCall(test_base);
test_base(2048,true);
assertTrue(%GetOptimizationStatus(test_base) != 1);
+
+// Specific test on negative offsets
+var short_a = new Array(100);
+for (var i = 0; i < short_a.length; i++) short_a[i] = 0;
+function short_test(a, i) {
+ a[i + 9] = 0;
+ a[i - 10] = 0;
}
+short_test(short_a, 50);
+short_test(short_a, 50);
+%OptimizeFunctionOnNextCall(short_test);
+short_a.length = 10;
+short_test(a, 0);
+assertTrue(%GetOptimizationStatus(short_test) != 1);
+
gc();
« 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