OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3629 } | 3629 } |
3630 | 3630 |
3631 { | 3631 { |
3632 GCTracer::Scope gc_scope(heap()->tracer(), | 3632 GCTracer::Scope gc_scope(heap()->tracer(), |
3633 GCTracer::Scope::MC_UPDATE_POINTERS_TO_EVACUATED); | 3633 GCTracer::Scope::MC_UPDATE_POINTERS_TO_EVACUATED); |
3634 SlotsBuffer::UpdateSlotsRecordedIn(heap_, migration_slots_buffer_); | 3634 SlotsBuffer::UpdateSlotsRecordedIn(heap_, migration_slots_buffer_); |
3635 if (FLAG_trace_fragmentation_verbose) { | 3635 if (FLAG_trace_fragmentation_verbose) { |
3636 PrintF(" migration slots buffer: %d\n", | 3636 PrintF(" migration slots buffer: %d\n", |
3637 SlotsBuffer::SizeOfChain(migration_slots_buffer_)); | 3637 SlotsBuffer::SizeOfChain(migration_slots_buffer_)); |
3638 } | 3638 } |
3639 | |
3640 if (compacting_ && was_marked_incrementally_) { | |
3641 GCTracer::Scope gc_scope(heap()->tracer(), | |
3642 GCTracer::Scope::MC_RESCAN_LARGE_OBJECTS); | |
3643 // It's difficult to filter out slots recorded for large objects. | |
3644 LargeObjectIterator it(heap_->lo_space()); | |
3645 for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { | |
3646 // LargeObjectSpace is not swept yet thus we have to skip | |
3647 // dead objects explicitly. | |
3648 if (!IsMarked(obj)) continue; | |
3649 | |
3650 Page* p = Page::FromAddress(obj->address()); | |
3651 if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION)) { | |
3652 obj->Iterate(&updating_visitor); | |
3653 p->ClearFlag(Page::RESCAN_ON_EVACUATION); | |
3654 } | |
3655 } | |
3656 } | |
3657 } | 3639 } |
3658 | 3640 |
3659 int npages = evacuation_candidates_.length(); | 3641 int npages = evacuation_candidates_.length(); |
3660 { | 3642 { |
3661 GCTracer::Scope gc_scope( | 3643 GCTracer::Scope gc_scope( |
3662 heap()->tracer(), | 3644 heap()->tracer(), |
3663 GCTracer::Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED); | 3645 GCTracer::Scope::MC_UPDATE_POINTERS_BETWEEN_EVACUATED); |
3664 for (int i = 0; i < npages; i++) { | 3646 for (int i = 0; i < npages; i++) { |
3665 Page* p = evacuation_candidates_[i]; | 3647 Page* p = evacuation_candidates_[i]; |
3666 DCHECK(p->IsEvacuationCandidate() || | 3648 DCHECK(p->IsEvacuationCandidate() || |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4713 SlotsBuffer* buffer = *buffer_address; | 4695 SlotsBuffer* buffer = *buffer_address; |
4714 while (buffer != NULL) { | 4696 while (buffer != NULL) { |
4715 SlotsBuffer* next_buffer = buffer->next(); | 4697 SlotsBuffer* next_buffer = buffer->next(); |
4716 DeallocateBuffer(buffer); | 4698 DeallocateBuffer(buffer); |
4717 buffer = next_buffer; | 4699 buffer = next_buffer; |
4718 } | 4700 } |
4719 *buffer_address = NULL; | 4701 *buffer_address = NULL; |
4720 } | 4702 } |
4721 } // namespace internal | 4703 } // namespace internal |
4722 } // namespace v8 | 4704 } // namespace v8 |
OLD | NEW |