| Index: test/mjsunit/allocation-site-info.js
|
| diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js
|
| index 72df772b0c11986940ec61b0f6e17ca5c0d951f7..442d108928eaad02e911ca60871c03642233d81f 100644
|
| --- a/test/mjsunit/allocation-site-info.js
|
| +++ b/test/mjsunit/allocation-site-info.js
|
| @@ -175,6 +175,20 @@ if (support_smi_only_arrays) {
|
| obj = fastliteralcase_smifast(2);
|
| assertKind(elements_kind.fast, obj);
|
|
|
| + // Case: make sure transitions from packed to holey are tracked
|
| + function fastliteralcase_smiholey(index, value) {
|
| + var literal = [1, 2, 3, 4];
|
| + literal[index] = value;
|
| + return literal;
|
| + }
|
| +
|
| + obj = fastliteralcase_smiholey(5, 1);
|
| + assertKind(elements_kind.fast_smi_only, obj);
|
| + assertHoley(obj);
|
| + obj = fastliteralcase_smiholey(0, 1);
|
| + assertKind(elements_kind.fast_smi_only, obj);
|
| + assertHoley(obj);
|
| +
|
| function newarraycase_smidouble(value) {
|
| var a = new Array();
|
| a[0] = value;
|
| @@ -268,6 +282,32 @@ if (support_smi_only_arrays) {
|
| obj = newarraycase_list_smiobj(2);
|
| assertKind(elements_kind.fast, obj);
|
|
|
| + // Case: array constructor calls with out of date feedback.
|
| + // The boilerplate should incorporate all feedback, but the input array
|
| + // should be minimally transitioned based on immediate need.
|
| + (function() {
|
| + function foo(i) {
|
| + // We have two cases, one for literals one for constructed arrays.
|
| + var a = (i == 0)
|
| + ? [1, 2, 3]
|
| + : new Array(1, 2, 3);
|
| + return a;
|
| + }
|
| +
|
| + for (i = 0; i < 2; i++) {
|
| + a = foo(i);
|
| + b = foo(i);
|
| + b[5] = 1; // boilerplate goes holey
|
| + assertHoley(foo(i));
|
| + a[0] = 3.5; // boilerplate goes holey double
|
| + assertKind(elements_kind.fast_double, a);
|
| + assertNotHoley(a);
|
| + c = foo(i);
|
| + assertKind(elements_kind.fast_double, c);
|
| + assertHoley(c);
|
| + }
|
| + })();
|
| +
|
| function newarraycase_onearg(len, value) {
|
| var a = new Array(len);
|
| a[0] = value;
|
|
|