(Experimental) Add Brooks pointers.
This feature is disabled by default.
Verified that the Brooks pointers are installed correctly by using the
CMS/SS collectors.
Change-Id: Ia9be9814ab6e29169ac85edc4792ce8c81d552a9
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index cc34689..736dcb1 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -439,6 +439,12 @@
inline void MarkSweep::UnMarkObjectNonNull(const Object* obj) {
DCHECK(!IsImmune(obj));
+
+ if (kUseBrooksPointer) {
+ // Verify all the objects have the correct Brooks pointer installed.
+ obj->AssertSelfBrooksPointer();
+ }
+
// Try to take advantage of locality of references within a space, failing this find the space
// the hard way.
accounting::SpaceBitmap* object_bitmap = current_mark_bitmap_;
@@ -459,6 +465,11 @@
inline void MarkSweep::MarkObjectNonNull(const Object* obj) {
DCHECK(obj != NULL);
+ if (kUseBrooksPointer) {
+ // Verify all the objects have the correct Brooks pointer installed.
+ obj->AssertSelfBrooksPointer();
+ }
+
if (IsImmune(obj)) {
DCHECK(IsMarked(obj));
return;
@@ -521,6 +532,11 @@
inline bool MarkSweep::MarkObjectParallel(const Object* obj) {
DCHECK(obj != NULL);
+ if (kUseBrooksPointer) {
+ // Verify all the objects have the correct Brooks pointer installed.
+ obj->AssertSelfBrooksPointer();
+ }
+
if (IsImmune(obj)) {
DCHECK(IsMarked(obj));
return false;