| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 959e3d38648277f47e94c492297adc411f6fe800..ec5e04c1ee8749ac6dd9d0a13427be27cc61884d 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -10883,6 +10883,10 @@ MaybeObject* JSObject::SetFastElementsCapacityAndLength(
|
| }
|
| ValidateElements();
|
| set_map_and_elements(new_map, new_elements);
|
| +
|
| + // Transition through the allocation site as well if present.
|
| + maybe_obj = UpdateAllocationSite(new_elements_kind);
|
| + if (maybe_obj->IsFailure()) return maybe_obj;
|
| } else {
|
| FixedArray* parameter_map = FixedArray::cast(old_elements);
|
| parameter_map->set(1, new_elements);
|
| @@ -12406,7 +12410,7 @@ MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) {
|
| if (IsHoleyElementsKind(kind)) {
|
| to_kind = GetHoleyElementsKind(to_kind);
|
| }
|
| - if (AllocationSite::GetMode(kind, to_kind) == TRACK_ALLOCATION_SITE) {
|
| + if (IsMoreGeneralElementsKindTransition(kind, to_kind)) {
|
| // If the array is huge, it's not likely to be defined in a local
|
| // function, so we shouldn't make new instances of it very often.
|
| uint32_t length = 0;
|
| @@ -12428,7 +12432,7 @@ MaybeObject* JSObject::UpdateAllocationSite(ElementsKind to_kind) {
|
| if (IsHoleyElementsKind(kind)) {
|
| to_kind = GetHoleyElementsKind(to_kind);
|
| }
|
| - if (AllocationSite::GetMode(kind, to_kind) == TRACK_ALLOCATION_SITE) {
|
| + if (IsMoreGeneralElementsKindTransition(kind, to_kind)) {
|
| if (FLAG_trace_track_allocation_sites) {
|
| PrintF("AllocationSite: JSArray %p site updated %s->%s\n",
|
| reinterpret_cast<void*>(this),
|
|
|