diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-04-12 00:16:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-12 00:16:55 +0000 |
commit | 95cd06622b956d7cd5b65248b1f381e602753f2c (patch) | |
tree | 164ea8da2ffe16cfdfa7c4f939a6b48fd2ef6ffa /runtime/gc | |
parent | 248015696ee087878656fb53e37cbf7be2b97e4d (diff) | |
parent | b272cd3013e046b7b001a091b0925b99a844e382 (diff) | |
download | art-95cd06622b956d7cd5b65248b1f381e602753f2c.zip art-95cd06622b956d7cd5b65248b1f381e602753f2c.tar.gz art-95cd06622b956d7cd5b65248b1f381e602753f2c.tar.bz2 |
Merge "Fix heap verification with SS/GSS."
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/collector/semi_space.cc | 4 | ||||
-rw-r--r-- | runtime/gc/heap.cc | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/runtime/gc/collector/semi_space.cc b/runtime/gc/collector/semi_space.cc index 6e31cb7..ccb38c4 100644 --- a/runtime/gc/collector/semi_space.cc +++ b/runtime/gc/collector/semi_space.cc @@ -393,10 +393,10 @@ void SemiSpace::ReclaimPhase() { // Note: Freed bytes can be negative if we copy form a compacted space to a free-list backed // space. heap_->RecordFree(freed_objects, freed_bytes); + timings_.StartSplit("PreSweepingGcVerification"); heap_->PreSweepingGcVerification(this); timings_.EndSplit(); - { WriterMutexLock mu(self_, *Locks::heap_bitmap_lock_); // Reclaim unmarked objects. @@ -411,6 +411,8 @@ void SemiSpace::ReclaimPhase() { TimingLogger::ScopedSplit split("UnBindBitmaps", &timings_); GetHeap()->UnBindBitmaps(); } + // TODO: Do this before doing verification since the from space may have objects which weren't + // moved and point to dead objects. from_space_->Clear(); // Protect the from space. VLOG(heap) << "Protecting space " << *from_space_; diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index e44ec6a..64dafe7 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -2403,9 +2403,11 @@ void Heap::PreSweepingGcVerification(collector::GarbageCollector* gc) { WriterMutexLock mu(self, *Locks::heap_bitmap_lock_); // Swapping bound bitmaps does nothing. gc->SwapBitmaps(); + SwapSemiSpaces(); if (!VerifyHeapReferences()) { LOG(FATAL) << "Pre sweeping " << gc->GetName() << " GC verification failed"; } + SwapSemiSpaces(); gc->SwapBitmaps(); } } |