diff options
| author | 2015-12-21 23:34:53 +0000 | |
|---|---|---|
| committer | 2015-12-21 23:34:53 +0000 | |
| commit | 5ae964f43ccee7b770d34f95b22b3421cbeb0e29 (patch) | |
| tree | 9e9de4f500eb8957795f3143b04d7baebf22e38c | |
| parent | 512aad022e2c7bbfd50f3fb5083cc761f7759b13 (diff) | |
| parent | 7b5d3041a2b84ed55f8655af31705e1a591ad69b (diff) | |
Merge "Fix multiple image space handing for SS collector" am: 10e2607281
am: 7b5d3041a2
* commit '7b5d3041a2b84ed55f8655af31705e1a591ad69b':
Fix multiple image space handing for SS collector
| -rw-r--r-- | runtime/gc/collector/semi_space.cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc index e9497a2223..99e98bb56a 100644 --- a/runtime/gc/collector/semi_space.cc +++ b/runtime/gc/collector/semi_space.cc @@ -367,37 +367,26 @@ void SemiSpace::MarkReachableObjects() { GetTimings()); table->UpdateAndMarkReferences(this); DCHECK(GetHeap()->FindRememberedSetFromSpace(space) == nullptr); - } else if (collect_from_space_only_ && space->GetLiveBitmap() != nullptr) { - // If the space has no mod union table (the non-moving space and main spaces when the bump - // pointer space only collection is enabled,) then we need to scan its live bitmap or dirty - // cards as roots (including the objects on the live stack which have just marked in the live - // bitmap above in MarkAllocStackAsLive().) - DCHECK(space == heap_->GetNonMovingSpace() || space == heap_->GetPrimaryFreeListSpace()) - << "Space " << space->GetName() << " " - << "generational_=" << generational_ << " " - << "collect_from_space_only_=" << collect_from_space_only_; + } else if ((space->IsImageSpace() || collect_from_space_only_) && + space->GetLiveBitmap() != nullptr) { + // If the space has no mod union table (the non-moving space, app image spaces, main spaces + // when the bump pointer space only collection is enabled,) then we need to scan its live + // bitmap or dirty cards as roots (including the objects on the live stack which have just + // marked in the live bitmap above in MarkAllocStackAsLive().) accounting::RememberedSet* rem_set = GetHeap()->FindRememberedSetFromSpace(space); - if (kUseRememberedSet) { + if (!space->IsImageSpace()) { + DCHECK(space == heap_->GetNonMovingSpace() || space == heap_->GetPrimaryFreeListSpace()) + << "Space " << space->GetName() << " " + << "generational_=" << generational_ << " " + << "collect_from_space_only_=" << collect_from_space_only_; // App images currently do not have remembered sets. - DCHECK((space->IsImageSpace() && space != heap_->GetBootImageSpace()) || - rem_set != nullptr); + DCHECK_EQ(kUseRememberedSet, rem_set != nullptr); } else { DCHECK(rem_set == nullptr); } if (rem_set != nullptr) { TimingLogger::ScopedTiming t2("UpdateAndMarkRememberedSet", GetTimings()); rem_set->UpdateAndMarkReferences(from_space_, this); - if (kIsDebugBuild) { - // Verify that there are no from-space references that - // remain in the space, that is, the remembered set (and the - // card table) didn't miss any from-space references in the - // space. - accounting::ContinuousSpaceBitmap* live_bitmap = space->GetLiveBitmap(); - SemiSpaceVerifyNoFromSpaceReferencesObjectVisitor visitor(this); - live_bitmap->VisitMarkedRange(reinterpret_cast<uintptr_t>(space->Begin()), - reinterpret_cast<uintptr_t>(space->End()), - visitor); - } } else { TimingLogger::ScopedTiming t2("VisitLiveBits", GetTimings()); accounting::ContinuousSpaceBitmap* live_bitmap = space->GetLiveBitmap(); @@ -406,6 +395,17 @@ void SemiSpace::MarkReachableObjects() { reinterpret_cast<uintptr_t>(space->End()), visitor); } + if (kIsDebugBuild) { + // Verify that there are no from-space references that + // remain in the space, that is, the remembered set (and the + // card table) didn't miss any from-space references in the + // space. + accounting::ContinuousSpaceBitmap* live_bitmap = space->GetLiveBitmap(); + SemiSpaceVerifyNoFromSpaceReferencesObjectVisitor visitor(this); + live_bitmap->VisitMarkedRange(reinterpret_cast<uintptr_t>(space->Begin()), + reinterpret_cast<uintptr_t>(space->End()), + visitor); + } } } |