Index: test/mjsunit/allocation-site-info.js |
diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js |
index 45605317fea69bfd116897c75e9a1a08fc5a9bdb..f533d617384992694ed52113cf961c623f651bdf 100644 |
--- a/test/mjsunit/allocation-site-info.js |
+++ b/test/mjsunit/allocation-site-info.js |
@@ -281,6 +281,23 @@ if (support_smi_only_arrays) { |
obj = newarraycase_list_smiobj(2); |
assertKind(elements_kind.fast, obj); |
+ function newarraycase_onearg(len, value) { |
+ var a = new Array(len); |
+ a[0] = value; |
+ return a; |
+ } |
+ |
+ obj = newarraycase_onearg(5, 3.5); |
+ assertKind(elements_kind.fast_double, obj); |
+ obj = newarraycase_onearg(10, 5); |
+ assertKind(elements_kind.fast_double, obj); |
+ obj = newarraycase_onearg(0, 5); |
+ assertKind(elements_kind.fast_double, obj); |
+ // Now pass a length that forces the dictionary path. |
+ obj = newarraycase_onearg(100000, 5); |
+ assertKind(elements_kind.dictionary, obj); |
+ assertTrue(obj.length == 100000); |
+ |
// Verify that cross context calls work |
var realmA = Realm.current(); |
var realmB = Realm.create(); |