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

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

Issue 7992003: Porting r9392 to x64 (smi-only arrays). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: save one memory access. Created 9 years, 3 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
« src/x64/stub-cache-x64.cc ('K') | « src/x64/stub-cache-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/element-kind.js
diff --git a/test/mjsunit/element-kind.js b/test/mjsunit/element-kind.js
index 1949857fd8b0214c9fc3d117725f629c59c63723..0159f5aafb7ce7e83fde09583d7c1190c83403c4 100644
--- a/test/mjsunit/element-kind.js
+++ b/test/mjsunit/element-kind.js
@@ -47,7 +47,7 @@ var element_kind = {
}
// We expect an object to only be of one element kind.
-function assertKind(expected, obj){
+function assertKind(expected, obj) {
if (support_smi_only_arrays) {
assertEquals(expected == element_kind.fast_smi_only_elements,
%HasFastSmiOnlyElements(obj));
@@ -100,7 +100,7 @@ assertKind(element_kind.fast_smi_only_elements, too);
// Make sure the element kind transitions from smionly when a non-smi is stored.
var you = new Array();
assertKind(element_kind.fast_smi_only_elements, you);
-for(i = 0; i < 1337; i++) {
+for (var i = 0; i < 1337; i++) {
var val = i;
if (i == 1336) {
assertKind(element_kind.fast_smi_only_elements, you);
@@ -110,10 +110,11 @@ for(i = 0; i < 1337; i++) {
}
assertKind(element_kind.fast_elements, you);
-assertKind(element_kind.dictionary_elements, new Array(0xC0C0A));
-
-// fast_double_elements not yet available
+assertKind(element_kind.dictionary_elements, new Array(0xDECAF));
+var fast_double_array = new Array(0xDECAF);
+for (var i = 0; i < 0xDECAF; i++) fast_double_array[i] = i / 2;
+assertKind(element_kind.fast_double_elements, fast_double_array);
William Hesse 2011/09/23 13:25:22 Why is the test for fast double elements in the ch
Yang 2011/09/23 14:19:12 Yes, this should have been a separate CL. Kind of
assertKind(element_kind.external_byte_elements, new Int8Array(9001));
assertKind(element_kind.external_unsigned_byte_elements, new Uint8Array(007));
« src/x64/stub-cache-x64.cc ('K') | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698