| 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 3689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3700 code_slots_filtering_required = MarkInvalidatedCode(); | 3700 code_slots_filtering_required = MarkInvalidatedCode(); |
| 3701 EvacuationScope evacuation_scope(this); | 3701 EvacuationScope evacuation_scope(this); |
| 3702 EvacuateNewSpace(); | 3702 EvacuateNewSpace(); |
| 3703 } | 3703 } |
| 3704 | 3704 |
| 3705 { | 3705 { |
| 3706 GCTracer::Scope gc_scope(heap()->tracer(), | 3706 GCTracer::Scope gc_scope(heap()->tracer(), |
| 3707 GCTracer::Scope::MC_EVACUATE_PAGES); | 3707 GCTracer::Scope::MC_EVACUATE_PAGES); |
| 3708 EvacuationScope evacuation_scope(this); | 3708 EvacuationScope evacuation_scope(this); |
| 3709 EvacuatePages(); | 3709 EvacuatePages(); |
| 3710 #ifdef VERIFY_HEAP | |
| 3711 if (FLAG_verify_heap && !sweeping_in_progress_) { | |
| 3712 VerifyEvacuation(heap()); | |
| 3713 } | |
| 3714 #endif | |
| 3715 } | 3710 } |
| 3716 | 3711 |
| 3717 // Second pass: find pointers to new space and update them. | 3712 // Second pass: find pointers to new space and update them. |
| 3718 PointersUpdatingVisitor updating_visitor(heap()); | 3713 PointersUpdatingVisitor updating_visitor(heap()); |
| 3719 | 3714 |
| 3720 { | 3715 { |
| 3721 GCTracer::Scope gc_scope(heap()->tracer(), | 3716 GCTracer::Scope gc_scope(heap()->tracer(), |
| 3722 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); | 3717 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); |
| 3723 // Update pointers in to space. | 3718 // Update pointers in to space. |
| 3724 SemiSpaceIterator to_it(heap()->new_space()->bottom(), | 3719 SemiSpaceIterator to_it(heap()->new_space()->bottom(), |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4489 ReleaseEvacuationCandidates(); | 4484 ReleaseEvacuationCandidates(); |
| 4490 CodeRange* code_range = heap()->isolate()->code_range(); | 4485 CodeRange* code_range = heap()->isolate()->code_range(); |
| 4491 if (code_range != NULL && code_range->valid()) { | 4486 if (code_range != NULL && code_range->valid()) { |
| 4492 code_range->ReserveEmergencyBlock(); | 4487 code_range->ReserveEmergencyBlock(); |
| 4493 } | 4488 } |
| 4494 | 4489 |
| 4495 if (FLAG_print_cumulative_gc_stat) { | 4490 if (FLAG_print_cumulative_gc_stat) { |
| 4496 heap_->tracer()->AddSweepingTime(base::OS::TimeCurrentMillis() - | 4491 heap_->tracer()->AddSweepingTime(base::OS::TimeCurrentMillis() - |
| 4497 start_time); | 4492 start_time); |
| 4498 } | 4493 } |
| 4494 |
| 4495 #ifdef VERIFY_HEAP |
| 4496 if (FLAG_verify_heap && !sweeping_in_progress_) { |
| 4497 VerifyEvacuation(heap()); |
| 4498 } |
| 4499 #endif |
| 4499 } | 4500 } |
| 4500 | 4501 |
| 4501 | 4502 |
| 4502 void MarkCompactCollector::ParallelSweepSpaceComplete(PagedSpace* space) { | 4503 void MarkCompactCollector::ParallelSweepSpaceComplete(PagedSpace* space) { |
| 4503 PageIterator it(space); | 4504 PageIterator it(space); |
| 4504 while (it.has_next()) { | 4505 while (it.has_next()) { |
| 4505 Page* p = it.next(); | 4506 Page* p = it.next(); |
| 4506 if (p->parallel_sweeping() == MemoryChunk::SWEEPING_FINALIZE) { | 4507 if (p->parallel_sweeping() == MemoryChunk::SWEEPING_FINALIZE) { |
| 4507 p->set_parallel_sweeping(MemoryChunk::SWEEPING_DONE); | 4508 p->set_parallel_sweeping(MemoryChunk::SWEEPING_DONE); |
| 4508 p->SetWasSwept(); | 4509 p->SetWasSwept(); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4799 SlotsBuffer* buffer = *buffer_address; | 4800 SlotsBuffer* buffer = *buffer_address; |
| 4800 while (buffer != NULL) { | 4801 while (buffer != NULL) { |
| 4801 SlotsBuffer* next_buffer = buffer->next(); | 4802 SlotsBuffer* next_buffer = buffer->next(); |
| 4802 DeallocateBuffer(buffer); | 4803 DeallocateBuffer(buffer); |
| 4803 buffer = next_buffer; | 4804 buffer = next_buffer; |
| 4804 } | 4805 } |
| 4805 *buffer_address = NULL; | 4806 *buffer_address = NULL; |
| 4806 } | 4807 } |
| 4807 } | 4808 } |
| 4808 } // namespace v8::internal | 4809 } // namespace v8::internal |
| OLD | NEW |