| Index: src/heap/mark-compact.cc
|
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
|
| index 7494330263ea37c0ec0eb32fba3f1b3a19ceaff2..9a4e88d9c4c8be444253f82aea323b241242febd 100644
|
| --- a/src/heap/mark-compact.cc
|
| +++ b/src/heap/mark-compact.cc
|
| @@ -3041,6 +3041,10 @@ bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
|
| AllocationResult allocation = old_space->AllocateRaw(object_size, alignment);
|
| if (allocation.To(&target)) {
|
| MigrateObject(target, object, object_size, old_space->identity());
|
| + // If we end up needing more special cases, we should factor this out.
|
| + if (V8_UNLIKELY(target->IsJSArrayBuffer())) {
|
| + heap()->PromoteArrayBuffer(target);
|
| + }
|
| heap()->IncrementPromotedObjectsSize(object_size);
|
| return true;
|
| }
|
| @@ -4367,7 +4371,6 @@ void MarkCompactCollector::SweepSpaces() {
|
| #ifdef DEBUG
|
| state_ = SWEEP_SPACES;
|
| #endif
|
| - heap()->FreeDeadArrayBuffers();
|
|
|
| MoveEvacuationCandidatesToEndOfPagesList();
|
|
|
| @@ -4395,6 +4398,8 @@ void MarkCompactCollector::SweepSpaces() {
|
|
|
| EvacuateNewSpaceAndCandidates();
|
|
|
| + heap()->FreeDeadArrayBuffers(false);
|
| +
|
| // ClearNonLiveReferences depends on precise sweeping of map space to
|
| // detect whether unmarked map became dead in this collection or in one
|
| // of the previous ones.
|
|
|