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/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 ForAllSweepingSpaces([this](AllocationSpace space) { | 535 ForAllSweepingSpaces([this](AllocationSpace space) { |
536 if (space == NEW_SPACE) { | 536 if (space == NEW_SPACE) { |
537 swept_list_[NEW_SPACE].Clear(); | 537 swept_list_[NEW_SPACE].Clear(); |
538 } | 538 } |
539 DCHECK(sweeping_list_[space].empty()); | 539 DCHECK(sweeping_list_[space].empty()); |
540 }); | 540 }); |
541 late_pages_ = false; | 541 late_pages_ = false; |
542 sweeping_in_progress_ = false; | 542 sweeping_in_progress_ = false; |
543 } | 543 } |
544 | 544 |
| 545 void MarkCompactCollector::Sweeper::EnsureNewSpaceCompleted() { |
| 546 if (!sweeping_in_progress_) return; |
| 547 if (!FLAG_concurrent_sweeping || !IsSweepingCompleted()) { |
| 548 for (Page* p : *heap_->new_space()) { |
| 549 SweepOrWaitUntilSweepingCompleted(p); |
| 550 } |
| 551 } |
| 552 } |
| 553 |
545 void MarkCompactCollector::EnsureSweepingCompleted() { | 554 void MarkCompactCollector::EnsureSweepingCompleted() { |
546 if (!sweeper().sweeping_in_progress()) return; | 555 if (!sweeper().sweeping_in_progress()) return; |
547 | 556 |
548 sweeper().EnsureCompleted(); | 557 sweeper().EnsureCompleted(); |
549 heap()->old_space()->RefillFreeList(); | 558 heap()->old_space()->RefillFreeList(); |
550 heap()->code_space()->RefillFreeList(); | 559 heap()->code_space()->RefillFreeList(); |
551 heap()->map_space()->RefillFreeList(); | 560 heap()->map_space()->RefillFreeList(); |
552 | 561 |
553 #ifdef VERIFY_HEAP | 562 #ifdef VERIFY_HEAP |
554 if (FLAG_verify_heap && !evacuation()) { | 563 if (FLAG_verify_heap && !evacuation()) { |
(...skipping 3473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4028 // The target is always in old space, we don't have to record the slot in | 4037 // The target is always in old space, we don't have to record the slot in |
4029 // the old-to-new remembered set. | 4038 // the old-to-new remembered set. |
4030 DCHECK(!heap()->InNewSpace(target)); | 4039 DCHECK(!heap()->InNewSpace(target)); |
4031 RecordRelocSlot(host, &rinfo, target); | 4040 RecordRelocSlot(host, &rinfo, target); |
4032 } | 4041 } |
4033 } | 4042 } |
4034 } | 4043 } |
4035 | 4044 |
4036 } // namespace internal | 4045 } // namespace internal |
4037 } // namespace v8 | 4046 } // namespace v8 |
OLD | NEW |