SemiSpace::MarkObject is called from ModUnionScanImageRootVisitor
which. These roots may be visited multiple times by the GC. One
example is the allocation stack traces and a class visiting the same
ArtMethod twice.
Bug:
27435111
Change-Id: I721b8bcf7fe43f4c351d902c2f3422d3bb585295
}
obj_ptr->Assign(forward_address);
} else if (!collect_from_space_only_ && !immune_spaces_.IsInImmuneRegion(obj)) {
+ DCHECK(!to_space_->HasAddress(obj)) << "Tried to mark " << obj << " in to-space";
BitmapSetSlowPathVisitor visitor(this);
if (!mark_bitmap_->Set(obj, visitor)) {
// This object was not previously marked.
mirror::Object* SemiSpace::MarkObject(mirror::Object* root) {
auto ref = StackReference<mirror::Object>::FromMirrorPtr(root);
- MarkObject(&ref);
+ MarkObjectIfNotInToSpace(&ref);
return ref.AsMirrorPtr();
}