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

Unified Diff: test/mjsunit/elements-kind.js

Issue 9050001: Ensure newly allocated empty Arrays are transitioned to FAST_ELEMENT (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix existing and add new tests Created 9 years 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/elements-kind.js
diff --git a/test/mjsunit/elements-kind.js b/test/mjsunit/elements-kind.js
index e5b5a66c44eba60951c683717d71577b796717e3..40a8d69f77258aff397d13692127b6a115da8bed 100644
--- a/test/mjsunit/elements-kind.js
+++ b/test/mjsunit/elements-kind.js
@@ -39,9 +39,19 @@ support_smi_only_arrays = %HasFastSmiOnlyElements([1,2,3,4,5,6,7,8,9,10]);
if (support_smi_only_arrays) {
print("Tests include smi-only arrays.");
} else {
- print("Tests do NOT include smi-only arrays.");
Jakob Kummerow 2012/01/04 20:55:17 intentional removal?
+ print("Tests do NOT include smi-only.");
}
+// Ensure that there is a global bais for not aggressively transitioning Arrays
Jakob Kummerow 2012/01/04 20:55:17 suggestion: "Ensure that Arrays default to SMI_ONL
+// to FAST_ELEMENTs.
+// TODO(danno): Remove this code when bias for early ElementsKind transition is
+// tracked per allocation site and not globally.
+[1,2,3][0] = 1.5;
+[1,2,3][0] = 1.5;
+[1,2,3][0] = 1.5;
+[1,2,3][0] = 1.5;
+[1,2,3][0] = 1.5;
+
var elements_kind = {
fast_smi_only : 'fast smi only elements',
fast : 'fast elements',
@@ -115,7 +125,7 @@ too.drink = 0xC0C0A;
assertKind(elements_kind.fast_smi_only, too);
// Make sure the element kind transitions from smionly when a non-smi is stored.
-var you = new Array();
+var you = new Array(1);
assertKind(elements_kind.fast_smi_only, you);
for (var i = 0; i < 1337; i++) {
var val = i;

Powered by Google App Engine
This is Rietveld 408576698