Chromium Code Reviews| Index: src/heap/mark-compact.cc |
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
| index 878efd639e192c04147f8c583e045c90999b4fa7..71290f192da172f1f9d948f60341c3cd56af67ed 100644 |
| --- a/src/heap/mark-compact.cc |
| +++ b/src/heap/mark-compact.cc |
| @@ -293,8 +293,6 @@ void MarkCompactCollector::ClearInvalidSlotsBufferEntries(PagedSpace* space) { |
| void MarkCompactCollector::ClearInvalidStoreAndSlotsBufferEntries() { |
| heap_->store_buffer()->ClearInvalidStoreBufferEntries(); |
| - RemoveDeoptimizedCodeSlots(); |
| - |
| ClearInvalidSlotsBufferEntries(heap_->old_space()); |
| ClearInvalidSlotsBufferEntries(heap_->code_space()); |
| ClearInvalidSlotsBufferEntries(heap_->map_space()); |
| @@ -769,7 +767,6 @@ void MarkCompactCollector::AbortCompaction() { |
| } |
| compacting_ = false; |
| evacuation_candidates_.Rewind(0); |
| - invalidated_code_.Rewind(0); |
| } |
| DCHECK_EQ(0, evacuation_candidates_.length()); |
| } |
| @@ -3593,7 +3590,11 @@ void MarkCompactCollector::InvalidateCode(Code* code) { |
| MarkBit mark_bit = Marking::MarkBitFrom(code); |
| if (Marking::IsWhite(mark_bit)) return; |
| - invalidated_code_.Add(code); |
| + // Ignore all slots that might have been recorded in the body of the |
| + // deoptimized code object. Assumption: no slots will be recorded for |
| + // this object after invalidating it. |
| + RemoveObjectSlots(code->instruction_start(), |
| + code->address() + code->Size()); |
| } |
| } |
| @@ -3604,42 +3605,6 @@ bool MarkCompactCollector::WillBeDeoptimized(Code* code) { |
| } |
| -void MarkCompactCollector::RemoveDeoptimizedCodeSlots() { |
| - int length = invalidated_code_.length(); |
| - for (int i = 0; i < length; i++) { |
| - Code* code = invalidated_code_[i]; |
| - Page* p = Page::FromAddress(code->address()); |
| - if (!p->IsEvacuationCandidate() && |
| - !p->IsFlagSet(Page::RESCAN_ON_EVACUATION)) { |
| - // Ignore all slots that might have been recorded in the body of the |
| - // deoptimized code object. |
| - RemoveObjectSlots(code->instruction_start(), |
| - code->address() + code->Size()); |
| - } |
| - } |
| -} |
| - |
| - |
| -void MarkCompactCollector::RemoveDeadInvalidatedCode() { |
| - int length = invalidated_code_.length(); |
| - for (int i = 0; i < length; i++) { |
| - if (!IsMarked(invalidated_code_[i])) invalidated_code_[i] = NULL; |
| - } |
| -} |
| - |
| - |
| -void MarkCompactCollector::ProcessInvalidatedCode(ObjectVisitor* visitor) { |
| - int length = invalidated_code_.length(); |
| - for (int i = 0; i < length; i++) { |
| - Code* code = invalidated_code_[i]; |
| - if (code != NULL) { |
| - code->Iterate(visitor); |
| - } |
| - } |
| - invalidated_code_.Rewind(0); |
| -} |
| - |
| - |
| void MarkCompactCollector::RemoveObjectSlots(Address start_slot, |
| Address end_slot) { |
| // Remove entries by replacing them with an old-space slot containing a smi |
| @@ -3647,9 +3612,8 @@ void MarkCompactCollector::RemoveObjectSlots(Address start_slot, |
| int npages = evacuation_candidates_.length(); |
| for (int i = 0; i < npages; i++) { |
| Page* p = evacuation_candidates_[i]; |
| - DCHECK(p->IsEvacuationCandidate() || |
| - p->IsFlagSet(Page::RESCAN_ON_EVACUATION)); |
| - if (p->IsEvacuationCandidate()) { |
| + if (!p->IsEvacuationCandidate() && |
|
Michael Starzinger
2015/08/04 07:45:57
As discussed offline: This change looks bogus, the
Hannes Payer (out of office)
2015/08/10 12:04:55
Done.
|
| + !p->IsFlagSet(Page::RESCAN_ON_EVACUATION)) { |
| SlotsBuffer::RemoveObjectSlots(heap_, p->slots_buffer(), start_slot, |
| end_slot); |
| } |
| @@ -3801,10 +3765,6 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { |
| EvacuationWeakObjectRetainer evacuation_object_retainer; |
| heap()->ProcessAllWeakReferences(&evacuation_object_retainer); |
| - // Visit invalidated code (we ignored all slots on it) and clear mark-bits |
| - // under it. |
| - ProcessInvalidatedCode(&updating_visitor); |
| - |
| heap_->isolate()->inner_pointer_to_code_cache()->Flush(); |
| slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_); |
| @@ -4434,8 +4394,6 @@ void MarkCompactCollector::SweepSpaces() { |
| } |
| } |
| - RemoveDeadInvalidatedCode(); |
| - |
| EvacuateNewSpaceAndCandidates(); |
| heap()->FreeDeadArrayBuffers(false); |