| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 103e93e8c4ac2547bea8167c190803000071ea6a..9e1003b713bda0d14457536bf004b0dc0f153f5a 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -8152,7 +8152,8 @@ class AllocationSite: public Struct {
|
|
|
| // transition_info bitfields, for constructed array transition info.
|
| class ElementsKindBits: public BitField<ElementsKind, 0, 15> {};
|
| - class UnusedBits: public BitField<int, 15, 14> {};
|
| + class InitialElementsCapacity : public BitField<int, 15, 10> {};
|
| + class UnusedBits : public BitField<int, 25, 4> {};
|
| class DoNotInlineBit: public BitField<bool, 29, 1> {};
|
|
|
| // Bitfields for pretenure_data
|
| @@ -8242,6 +8243,11 @@ class AllocationSite: public Struct {
|
| SKIP_WRITE_BARRIER);
|
| }
|
|
|
| + inline int GetInitialElementsCapacity();
|
| +
|
| + // Note that the function accepts the new length, not capacity.
|
| + inline void DigestInitialElementsCapacityFeedback(int new_length);
|
| +
|
| bool CanInlineCall() {
|
| int value = Smi::cast(transition_info())->value();
|
| return DoNotInlineBit::decode(value) == 0;
|
| @@ -10101,7 +10107,12 @@ class JSArray: public JSObject {
|
| DECLARE_VERIFIER(JSArray)
|
|
|
| // Number of element slots to pre-allocate for an empty array.
|
| - static const int kPreallocatedArrayElements = 4;
|
| + static int PreallocatedArrayElements() {
|
| + if (FLAG_initial_capacity_mode == 1) return 4;
|
| + DCHECK(FLAG_initial_capacity_mode == 0 ||
|
| + FLAG_initial_capacity_mode == 2);
|
| + return 0;
|
| + }
|
|
|
| // Layout description.
|
| static const int kLengthOffset = JSObject::kHeaderSize;
|
|
|