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/v8.h" | 5 #include "src/v8.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 3680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3691 | 3691 |
3692 | 3692 |
3693 void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { | 3693 void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { |
3694 Heap::RelocationLock relocation_lock(heap()); | 3694 Heap::RelocationLock relocation_lock(heap()); |
3695 | 3695 |
3696 bool code_slots_filtering_required; | 3696 bool code_slots_filtering_required; |
3697 { | 3697 { |
3698 GCTracer::Scope gc_scope(heap()->tracer(), | 3698 GCTracer::Scope gc_scope(heap()->tracer(), |
3699 GCTracer::Scope::MC_SWEEP_NEWSPACE); | 3699 GCTracer::Scope::MC_SWEEP_NEWSPACE); |
3700 code_slots_filtering_required = MarkInvalidatedCode(); | 3700 code_slots_filtering_required = MarkInvalidatedCode(); |
| 3701 EvacuationScope evacuation_scope(this); |
3701 EvacuateNewSpace(); | 3702 EvacuateNewSpace(); |
3702 } | 3703 } |
3703 | 3704 |
3704 { | 3705 { |
3705 GCTracer::Scope gc_scope(heap()->tracer(), | 3706 GCTracer::Scope gc_scope(heap()->tracer(), |
3706 GCTracer::Scope::MC_EVACUATE_PAGES); | 3707 GCTracer::Scope::MC_EVACUATE_PAGES); |
3707 EvacuationScope evacuation_scope(this); | 3708 EvacuationScope evacuation_scope(this); |
3708 EvacuatePages(); | 3709 EvacuatePages(); |
| 3710 #ifdef VERIFY_HEAP |
| 3711 if (FLAG_verify_heap && !sweeping_in_progress_) { |
| 3712 VerifyEvacuation(heap()); |
| 3713 } |
| 3714 #endif |
3709 } | 3715 } |
3710 | 3716 |
3711 // Second pass: find pointers to new space and update them. | 3717 // Second pass: find pointers to new space and update them. |
3712 PointersUpdatingVisitor updating_visitor(heap()); | 3718 PointersUpdatingVisitor updating_visitor(heap()); |
3713 | 3719 |
3714 { | 3720 { |
3715 GCTracer::Scope gc_scope(heap()->tracer(), | 3721 GCTracer::Scope gc_scope(heap()->tracer(), |
3716 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); | 3722 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); |
3717 // Update pointers in to space. | 3723 // Update pointers in to space. |
3718 SemiSpaceIterator to_it(heap()->new_space()->bottom(), | 3724 SemiSpaceIterator to_it(heap()->new_space()->bottom(), |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4793 SlotsBuffer* buffer = *buffer_address; | 4799 SlotsBuffer* buffer = *buffer_address; |
4794 while (buffer != NULL) { | 4800 while (buffer != NULL) { |
4795 SlotsBuffer* next_buffer = buffer->next(); | 4801 SlotsBuffer* next_buffer = buffer->next(); |
4796 DeallocateBuffer(buffer); | 4802 DeallocateBuffer(buffer); |
4797 buffer = next_buffer; | 4803 buffer = next_buffer; |
4798 } | 4804 } |
4799 *buffer_address = NULL; | 4805 *buffer_address = NULL; |
4800 } | 4806 } |
4801 } | 4807 } |
4802 } // namespace v8::internal | 4808 } // namespace v8::internal |
OLD | NEW |