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

Unified Diff: test/mjsunit/array-constructor-feedback.js

Issue 1086873003: Array() in optimized code can create with wrong ElementsKind in corner cases. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix a test expectation. Created 5 years, 8 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
Index: test/mjsunit/array-constructor-feedback.js
diff --git a/test/mjsunit/array-constructor-feedback.js b/test/mjsunit/array-constructor-feedback.js
index e14c344278de85efc71f6b8d6f45be245038b00a..b8e1f5c71f9134540183d956818cf91e648c2b8a 100644
--- a/test/mjsunit/array-constructor-feedback.js
+++ b/test/mjsunit/array-constructor-feedback.js
@@ -216,3 +216,17 @@ function assertKind(expected, obj, name_opt) {
assertFalse(isHoley(a));
}
})();
+
+// Test: Make sure that crankshaft continues with feedback for large arrays.
+(function() {
+ function bar(len) { return new Array(len); }
+ var size = 100001;
+ bar(size)[10] = 'string';
+ assertKind(elements_kind.fast, bar(size));
+ %OptimizeFunctionOnNextCall(bar);
+ assertKind(elements_kind.fast, bar(size));
+ // But there is a limit, based on the size of the old generation, currently
+ // 22937600, but double it to prevent the test being too brittle.
+ var large_size = 22937600 * 2;
+ assertKind(elements_kind.dictionary, bar(large_size));
+})();

Powered by Google App Engine
This is Rietveld 408576698