Index: test/mjsunit/elements-kind.js |
diff --git a/test/mjsunit/elements-kind.js b/test/mjsunit/elements-kind.js |
index cf9c21605df62a84c9e843a762b67b06540dff5b..0f5389623fa3251a0c064c60456a985fd7fc66ab 100644 |
--- a/test/mjsunit/elements-kind.js |
+++ b/test/mjsunit/elements-kind.js |
@@ -229,8 +229,16 @@ if (support_smi_only_arrays) { |
%OptimizeFunctionOnNextCall(convert_mixed); |
smis = construct_smis(); |
doubles = construct_doubles(); |
- convert_mixed(smis, 1, elements_kind.fast); |
- convert_mixed(doubles, 1, elements_kind.fast); |
+ if (getKind(smis) == elements_kind.fast_smi_only) { |
+ convert_mixed(smis, 1, elements_kind.fast); |
+ // Test failure here. My change must have broken the assumption above, that |
+ // the crankshafted convert_mixed() function will transition the doubles |
+ // array to fast. |
+ convert_mixed(doubles, 1, elements_kind.fast); |
+ } else { |
+ convert_mixed(smis, 1, elements_kind.fast); |
+ convert_mixed(doubles, 1, elements_kind.fast); |
+ } |
assertTrue(%HaveSameMap(smis, doubles)); |
} |
@@ -343,5 +351,25 @@ if (support_smi_only_arrays) { |
assertKind(elements_kind.fast, c); |
} |
+/* |
+if (support_smi_only_arrays) { |
+ function create_array() { |
+ var ar = [1,2,3]; |
+ return ar; |
+ } |
+ |
+ var a = create_array(); |
+ assertKind(elements_kind.fast_smi_only, a); |
+ a[1] = 1; |
+ assertKind(elements_kind.fast_smi_only, a); |
+ a[1] = 1.5; |
+ assertKind(elements_kind.fast_double, a); |
+ |
+ // The boilerplate should have been pre-transitioned now. |
+ var b = create_array(); |
+ assertKind(elements_kind.fast_double, b); |
+} |
+*/ |
+ |
// Throw away type information in the ICs for next stress run. |
gc(); |