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

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

Issue 8230008: Make elements_kind map transition test conditional on smi element support (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 | « no previous file | 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 cc95f460016c6ccca2f31775e49cab376c32d98d..46fd8f567d48f536661a2df63a5bdae3393dca74 100644
--- a/test/mjsunit/element-kind.js
+++ b/test/mjsunit/element-kind.js
@@ -209,49 +209,53 @@ crankshaft_test();
// A map can have three different elements_kind transitions: SMI->DOUBLE,
// DOUBLE->OBJECT, and SMI->OBJECT. No matter in which order these three are
// created, they must always end up with the same FAST map.
-// Preparation: create one pair of identical objects for each case.
-var a = [1, 2, 3];
-var b = [1, 2, 3];
-assertTrue(%HaveSameMap(a, b));
-assertKind(element_kind.fast_smi_only_elements, a);
-var c = [1, 2, 3];
-c["case2"] = true;
-var d = [1, 2, 3];
-d["case2"] = true;
-assertTrue(%HaveSameMap(c, d));
-assertFalse(%HaveSameMap(a, c));
-assertKind(element_kind.fast_smi_only_elements, c);
-var e = [1, 2, 3];
-e["case3"] = true;
-var f = [1, 2, 3];
-f["case3"] = true;
-assertTrue(%HaveSameMap(e, f));
-assertFalse(%HaveSameMap(a, e));
-assertFalse(%HaveSameMap(c, e));
-assertKind(element_kind.fast_smi_only_elements, e);
-// Case 1: SMI->DOUBLE, DOUBLE->OBJECT, SMI->OBJECT.
-a[0] = 1.5;
-assertKind(element_kind.fast_double_elements, a);
-a[0] = "foo";
-assertKind(element_kind.fast_elements, a);
-b[0] = "bar";
-assertTrue(%HaveSameMap(a, b));
-// Case 2: SMI->DOUBLE, SMI->OBJECT, DOUBLE->OBJECT.
-c[0] = 1.5;
-assertKind(element_kind.fast_double_elements, c);
-assertFalse(%HaveSameMap(c, d));
-d[0] = "foo";
-assertKind(element_kind.fast_elements, d);
-assertFalse(%HaveSameMap(c, d));
-c[0] = "bar";
-assertTrue(%HaveSameMap(c, d));
-// Case 3: SMI->OBJECT, SMI->DOUBLE, DOUBLE->OBJECT.
-e[0] = "foo";
-assertKind(element_kind.fast_elements, e);
-assertFalse(%HaveSameMap(e, f));
-f[0] = 1.5;
-assertKind(element_kind.fast_double_elements, f);
-assertFalse(%HaveSameMap(e, f));
-f[0] = "bar";
-assertKind(element_kind.fast_elements, f);
-assertTrue(%HaveSameMap(e, f));
+
+// This test is meaningless without FAST_SMI_ONLY_ELEMENTS.
+if (support_smi_only_arrays) {
+ // Preparation: create one pair of identical objects for each case.
+ var a = [1, 2, 3];
+ var b = [1, 2, 3];
+ assertTrue(%HaveSameMap(a, b));
+ assertKind(element_kind.fast_smi_only_elements, a);
+ var c = [1, 2, 3];
+ c["case2"] = true;
+ var d = [1, 2, 3];
+ d["case2"] = true;
+ assertTrue(%HaveSameMap(c, d));
+ assertFalse(%HaveSameMap(a, c));
+ assertKind(element_kind.fast_smi_only_elements, c);
+ var e = [1, 2, 3];
+ e["case3"] = true;
+ var f = [1, 2, 3];
+ f["case3"] = true;
+ assertTrue(%HaveSameMap(e, f));
+ assertFalse(%HaveSameMap(a, e));
+ assertFalse(%HaveSameMap(c, e));
+ assertKind(element_kind.fast_smi_only_elements, e);
+ // Case 1: SMI->DOUBLE, DOUBLE->OBJECT, SMI->OBJECT.
+ a[0] = 1.5;
+ assertKind(element_kind.fast_double_elements, a);
+ a[0] = "foo";
+ assertKind(element_kind.fast_elements, a);
+ b[0] = "bar";
+ assertTrue(%HaveSameMap(a, b));
+ // Case 2: SMI->DOUBLE, SMI->OBJECT, DOUBLE->OBJECT.
+ c[0] = 1.5;
+ assertKind(element_kind.fast_double_elements, c);
+ assertFalse(%HaveSameMap(c, d));
+ d[0] = "foo";
+ assertKind(element_kind.fast_elements, d);
+ assertFalse(%HaveSameMap(c, d));
+ c[0] = "bar";
+ assertTrue(%HaveSameMap(c, d));
+ // Case 3: SMI->OBJECT, SMI->DOUBLE, DOUBLE->OBJECT.
+ e[0] = "foo";
+ assertKind(element_kind.fast_elements, e);
+ assertFalse(%HaveSameMap(e, f));
+ f[0] = 1.5;
+ assertKind(element_kind.fast_double_elements, f);
+ assertFalse(%HaveSameMap(e, f));
+ f[0] = "bar";
+ assertKind(element_kind.fast_elements, f);
+ assertTrue(%HaveSameMap(e, f));
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698