summaryrefslogtreecommitdiffstats
path: root/runtime/gc/heap.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-03-27 16:09:46 -0700
committerMathieu Chartier <mathieuc@google.com>2014-03-28 11:35:02 -0700
commit4aeec176eaf11fe03f342aadcbb79142230270ed (patch)
treeb2c7abd4b3624dc1f801f6a29893e0f66497f378 /runtime/gc/heap.cc
parenta708e32a9f764a48175e705ec4bcd2201c84f492 (diff)
downloadart-4aeec176eaf11fe03f342aadcbb79142230270ed.zip
art-4aeec176eaf11fe03f342aadcbb79142230270ed.tar.gz
art-4aeec176eaf11fe03f342aadcbb79142230270ed.tar.bz2
Refactor some GC code.
Reduced amount of code in mark sweep / semi space by moving common logic to garbage_collector.cc. Cleaned up mod union tables and deleted an unused implementation. Change-Id: I4bcc6ba41afd96d230cfbaf4d6636f37c52e37ea
Diffstat (limited to 'runtime/gc/heap.cc')
-rw-r--r--runtime/gc/heap.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index ff4b4ce..26a812a 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2821,5 +2821,19 @@ void Heap::RemoveRememberedSet(space::Space* space) {
CHECK(remembered_sets_.find(space) == remembered_sets_.end());
}
+void Heap::ClearMarkedObjects() {
+ // Clear all of the spaces' mark bitmaps.
+ for (const auto& space : GetContinuousSpaces()) {
+ accounting::SpaceBitmap* mark_bitmap = space->GetMarkBitmap();
+ if (space->GetLiveBitmap() != mark_bitmap) {
+ mark_bitmap->Clear();
+ }
+ }
+ // Clear the marked objects in the discontinous space object sets.
+ for (const auto& space : GetDiscontinuousSpaces()) {
+ space->GetMarkObjects()->Clear();
+ }
+}
+
} // namespace gc
} // namespace art