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
diff --git a/runtime/gc/collector/mark_sweep.h b/runtime/gc/collector/mark_sweep.h
index 84b775a..9bf4cd1 100644
--- a/runtime/gc/collector/mark_sweep.h
+++ b/runtime/gc/collector/mark_sweep.h
@@ -32,33 +32,22 @@
namespace mirror {
class Class;
class Object;
- template<class T> class ObjectArray;
class Reference;
} // namespace mirror
-class StackVisitor;
class Thread;
enum VisitRootFlags : uint8_t;
namespace gc {
+class Heap;
+
namespace accounting {
- template <typename T> class AtomicStack;
- class MarkIfReachesAllocspaceVisitor;
- class ModUnionClearCardVisitor;
- class ModUnionVisitor;
- class ModUnionTableBitmap;
- class MarkStackChunk;
+ template<typename T> class AtomicStack;
typedef AtomicStack<mirror::Object*> ObjectStack;
class SpaceBitmap;
} // namespace accounting
-namespace space {
- class ContinuousSpace;
-} // namespace space
-
-class Heap;
-
namespace collector {
class MarkSweep : public GarbageCollector {
@@ -137,8 +126,8 @@
EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- // Update and mark references from immune spaces. Virtual as overridden by StickyMarkSweep.
- virtual void UpdateAndMarkModUnion()
+ // Update and mark references from immune spaces.
+ void UpdateAndMarkModUnion()
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Pre clean cards to reduce how much work is needed in the pause.
@@ -311,7 +300,7 @@
accounting::ObjectStack* mark_stack_;
- // Immune range, every object inside the immune range is assumed to be marked.
+ // Immune region, every object inside the immune range is assumed to be marked.
ImmuneRegion immune_region_;
// Parallel finger.