Fix CC root visiting bug
Also some cleanup.
Change-Id: Ia3de8f2d409770be3619ec116e8b06ecd82338fe
diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index 19d4e1a..6a68880 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -1148,11 +1148,11 @@
mirror::Object** root = roots[i];
mirror::Object* ref = *root;
if (ref == nullptr || region_space_->IsInToSpace(ref)) {
- return;
+ continue;
}
mirror::Object* to_ref = Mark(ref);
if (to_ref == ref) {
- return;
+ continue;
}
Atomic<mirror::Object*>* addr = reinterpret_cast<Atomic<mirror::Object*>*>(root);
mirror::Object* expected_ref = ref;
@@ -1173,11 +1173,11 @@
mirror::CompressedReference<mirror::Object>* root = roots[i];
mirror::Object* ref = root->AsMirrorPtr();
if (ref == nullptr || region_space_->IsInToSpace(ref)) {
- return;
+ continue;
}
mirror::Object* to_ref = Mark(ref);
if (to_ref == ref) {
- return;
+ continue;
}
auto* addr = reinterpret_cast<Atomic<mirror::CompressedReference<mirror::Object>>*>(root);
auto expected_ref = mirror::CompressedReference<mirror::Object>::FromMirrorPtr(ref);