Lines Matching refs:ref
503 mirror::Object* ref = *root; in VisitRoots() local
504 if (ref != nullptr) { in VisitRoots()
505 mirror::Object* to_ref = concurrent_copying_->Mark(self, ref); in VisitRoots()
506 if (to_ref != ref) { in VisitRoots()
521 mirror::Object* ref = root->AsMirrorPtr(); in VisitRoots() local
522 mirror::Object* to_ref = concurrent_copying_->Mark(self, ref); in VisitRoots()
523 if (to_ref != ref) { in VisitRoots()
617 void operator()(ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const in operator ()()
620 CheckReference(ref->GetReferent<kWithoutReadBarrier>(), in operator ()()
621 ref, in operator ()()
642 void CheckReference(ObjPtr<mirror::Object> ref, in CheckReference() argument
646 if (ref != nullptr) { in CheckReference()
647 if (!collector_->immune_spaces_.ContainsObject(ref.Ptr())) { in CheckReference()
651 CHECK(large_object_space->Contains(ref.Ptr()) && in CheckReference()
652 large_object_space->IsZygoteLargeObject(Thread::Current(), ref.Ptr())) in CheckReference()
653 << "Non gray object references non immune, non zygote large object "<< ref << " " in CheckReference()
654 << mirror::Object::PrettyTypeOf(ref) << " in holder " << holder << " " in CheckReference()
659 ref->GetClass<kVerifyNone, kWithoutReadBarrier>())); in CheckReference()
701 ObjPtr<mirror::Reference> ref) const in operator ()()
704 this->operator()(ref, mirror::Reference::ReferentOffset(), false); in operator ()()
719 void CheckReference(mirror::Object* ref, int32_t offset = -1) const in CheckReference() argument
721 if (ref != nullptr && cc_->region_space_->IsInNewlyAllocatedRegion(ref)) { in CheckReference()
724 << ref->PrettyTypeOf() << "(" << ref << ") in newly allocated region at offset=" << offset; in CheckReference()
728 LOG(FATAL_WITHOUT_ABORT) << cc_->DumpReferenceInfo(ref, "ref", kIndent); in CheckReference()
949 mirror::Object* ref = *root; in VisitRoots() local
950 if (ref != nullptr && !collector_->TestAndSetMarkBitForRef<kAtomicTestAndSet>(ref)) { in VisitRoots()
951 collector_->PushOntoMarkStack(self_, ref); in VisitRoots()
963 mirror::Object* ref = root->AsMirrorPtr(); in VisitRoots() local
964 if (!collector_->TestAndSetMarkBitForRef<kAtomicTestAndSet>(ref)) { in VisitRoots()
965 collector_->PushOntoMarkStack(self_, ref); in VisitRoots()
1083 mirror::Object* ref = in operator ()() local
1086 if (UNLIKELY(ref == nullptr && offset == mirror::Object::ClassOffset())) { in operator ()()
1094 ref = obj->GetClass<kVerifyNone, kWithoutReadBarrier>(); in operator ()()
1095 if (ref != nullptr) { in operator ()()
1099 << ref << " (" << mirror::Object::PrettyTypeOf(ref) << ")"; in operator ()()
1104 if (UNLIKELY(ref == nullptr)) { in operator ()()
1108 collector_->heap_->GetVerification()->LogHeapCorruption(obj, offset, ref, /* fatal */ true); in operator ()()
1111 CheckReference(ref); in operator ()()
1114 void operator()(ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const in operator ()()
1124 && ref->AsReference()->GetReferent<kWithoutReadBarrier>() != nullptr) { in operator ()()
1148 void CheckReference(mirror::Object* ref) const in CheckReference()
1150 if (ref == nullptr) { in CheckReference()
1154 if (!collector_->TestAndSetMarkBitForRef(ref)) { in CheckReference()
1155 collector_->PushOntoLocalMarkStack(ref); in CheckReference()
1158 size_t ref_region_idx = collector_->RegionSpace()->RegionIdxForRef(ref); in CheckReference()
1173 void ConcurrentCopying::AddLiveBytesAndScanRef(mirror::Object* ref) { in AddLiveBytesAndScanRef() argument
1174 DCHECK(ref != nullptr); in AddLiveBytesAndScanRef()
1175 DCHECK(!immune_spaces_.ContainsObject(ref)); in AddLiveBytesAndScanRef()
1176 DCHECK(TestMarkBitmapForRef(ref)); in AddLiveBytesAndScanRef()
1178 if (LIKELY(region_space_->HasAddress(ref))) { in AddLiveBytesAndScanRef()
1179 obj_region_idx = region_space_->RegionIdxForRefUnchecked(ref); in AddLiveBytesAndScanRef()
1184 size_t obj_size = ref->SizeOf<kDefaultVerifyFlags>(); in AddLiveBytesAndScanRef()
1186 region_space_->AddLiveBytes(ref, alloc_size); in AddLiveBytesAndScanRef()
1191 ref->VisitReferences</*kVisitNativeRoots=*/ true, kDefaultVerifyFlags, kWithoutReadBarrier>( in AddLiveBytesAndScanRef()
1202 DCHECK(heap_->non_moving_space_->HasAddress(ref)); in AddLiveBytesAndScanRef()
1203 non_moving_space_inter_region_bitmap_.Set(ref); in AddLiveBytesAndScanRef()
1205 region_space_inter_region_bitmap_.Set(ref); in AddLiveBytesAndScanRef()
1211 bool ConcurrentCopying::TestAndSetMarkBitForRef(mirror::Object* ref) { in TestAndSetMarkBitForRef() argument
1214 if (LIKELY(region_space_->HasAddress(ref))) { in TestAndSetMarkBitForRef()
1216 } else if (heap_->GetNonMovingSpace()->HasAddress(ref)) { in TestAndSetMarkBitForRef()
1218 } else if (immune_spaces_.ContainsObject(ref)) { in TestAndSetMarkBitForRef()
1220 DCHECK(heap_mark_bitmap_->GetContinuousSpaceBitmap(ref)->Test(ref)); in TestAndSetMarkBitForRef()
1225 && (!IsAligned<kPageSize>(ref) || heap_->GetLargeObjectsSpace() == nullptr)) { in TestAndSetMarkBitForRef()
1230 ref, in TestAndSetMarkBitForRef()
1236 return (bitmap != nullptr) ? bitmap->AtomicTestAndSet(ref) : los_bitmap->AtomicTestAndSet(ref); in TestAndSetMarkBitForRef()
1238 return (bitmap != nullptr) ? bitmap->Set(ref) : los_bitmap->Set(ref); in TestAndSetMarkBitForRef()
1242 bool ConcurrentCopying::TestMarkBitmapForRef(mirror::Object* ref) { in TestMarkBitmapForRef() argument
1243 if (LIKELY(region_space_->HasAddress(ref))) { in TestMarkBitmapForRef()
1244 return region_space_bitmap_->Test(ref); in TestMarkBitmapForRef()
1245 } else if (heap_->GetNonMovingSpace()->HasAddress(ref)) { in TestMarkBitmapForRef()
1246 return heap_->GetNonMovingSpace()->GetMarkBitmap()->Test(ref); in TestMarkBitmapForRef()
1247 } else if (immune_spaces_.ContainsObject(ref)) { in TestMarkBitmapForRef()
1249 DCHECK(heap_mark_bitmap_->GetContinuousSpaceBitmap(ref)->Test(ref)); in TestMarkBitmapForRef()
1254 && (!IsAligned<kPageSize>(ref) || heap_->GetLargeObjectsSpace() == nullptr)) { in TestMarkBitmapForRef()
1259 ref, in TestMarkBitmapForRef()
1262 return heap_->GetLargeObjectsSpace()->GetMarkBitmap()->Test(ref); in TestMarkBitmapForRef()
1266 void ConcurrentCopying::PushOntoLocalMarkStack(mirror::Object* ref) { in PushOntoLocalMarkStack() argument
1276 gc_mark_stack_->PushBack(ref); in PushOntoLocalMarkStack()
1283 [this] (mirror::Object* ref) in ProcessMarkStackForMarkingAndComputeLiveBytes()
1285 AddLiveBytesAndScanRef(ref); in ProcessMarkStackForMarkingAndComputeLiveBytes()
1294 mirror::Object* ref = gc_mark_stack_->PopBack(); in ProcessMarkStackForMarkingAndComputeLiveBytes() local
1295 AddLiveBytesAndScanRef(ref); in ProcessMarkStackForMarkingAndComputeLiveBytes()
1827 for (auto& ref : temp) { in ExpandGcMarkStack() local
1828 gc_mark_stack_->PushBack(ref.AsMirrorPtr()); in ExpandGcMarkStack()
1914 void operator()(mirror::Object* ref, in operator ()() argument
1918 if (ref == nullptr) { in operator ()()
1922 collector_->AssertToSpaceInvariant(holder, offset, ref); in operator ()()
1924 CHECK_EQ(ref->GetReadBarrierState(), ReadBarrier::NonGrayState()) in operator ()()
1925 << "Ref " << ref << " " << ref->PrettyTypeOf() << " has gray rb_state"; in operator ()()
1948 mirror::Object* ref = in operator ()() local
1951 visitor(ref, offset, obj.Ptr()); in operator ()()
1954 ObjPtr<mirror::Reference> ref) const in operator ()()
1957 this->operator()(ref, mirror::Reference::ReferentOffset(), false); in operator ()()
2043 mirror::Object* ref = in operator ()() local
2045 collector_->AssertToSpaceInvariant(obj.Ptr(), offset, ref); in operator ()()
2047 void operator()(ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref ATTRIBUTE_UNUSED) const in operator ()()
2061 mirror::Object* ref = root->AsMirrorPtr(); in VisitRoot() local
2062 collector_->AssertToSpaceInvariant(/* obj */ nullptr, MemberOffset(0), ref); in VisitRoot()
2142 [this] (mirror::Object* ref) in ProcessMarkStackOnce()
2144 ProcessMarkStackRef(ref); in ProcessMarkStackOnce()
2177 for (mirror::Object* ref : refs) { in ProcessMarkStackOnce()
2178 ProcessMarkStackRef(ref); in ProcessMarkStackOnce()
2430 [this] (mirror::Object* ref) in SwitchToSharedMarkStackMode()
2432 ProcessMarkStackRef(ref); in SwitchToSharedMarkStackMode()
2833 std::string ConcurrentCopying::DumpReferenceInfo(mirror::Object* ref, in DumpReferenceInfo() argument
2837 oss << indent << heap_->GetVerification()->DumpObjectInfo(ref, ref_name) << '\n'; in DumpReferenceInfo()
2838 if (ref != nullptr) { in DumpReferenceInfo()
2840 oss << indent << ref_name << "->GetMarkBit()=" << ref->GetMarkBit() << '\n'; in DumpReferenceInfo()
2841 oss << indent << ref_name << "->GetReadBarrierState()=" << ref->GetReadBarrierState() << '\n'; in DumpReferenceInfo()
2844 if (region_space_->HasAddress(ref)) { in DumpReferenceInfo()
2846 region_space_->DumpRegionForObject(oss, ref); in DumpReferenceInfo()
2849 << std::boolalpha << region_space_bitmap_->Test(ref) << std::noboolalpha; in DumpReferenceInfo()
2857 mirror::Object* ref) { in DumpHeapReference() argument
2860 oss << kIndent << "Invalid reference: ref=" << ref in DumpHeapReference()
2865 oss << DumpReferenceInfo(ref, "ref", kIndent); in DumpHeapReference()
2871 mirror::Object* ref) { in AssertToSpaceInvariant() argument
2874 if (ref == nullptr) { in AssertToSpaceInvariant()
2877 } else if (region_space_->HasAddress(ref)) { in AssertToSpaceInvariant()
2880 space::RegionSpace::RegionType type = region_space_->GetRegionTypeUnsafe(ref); in AssertToSpaceInvariant()
2885 if (!IsMarkedInUnevacFromSpace(ref)) { in AssertToSpaceInvariant()
2889 LOG(FATAL_WITHOUT_ABORT) << DumpHeapReference(obj, offset, ref); in AssertToSpaceInvariant()
2892 CHECK(IsMarkedInUnevacFromSpace(ref)) << ref; in AssertToSpaceInvariant()
2902 LOG(FATAL_WITHOUT_ABORT) << DumpHeapReference(obj, offset, ref); in AssertToSpaceInvariant()
2927 ref->GetLockWord(false).Dump(LOG_STREAM(FATAL_WITHOUT_ABORT)); in AssertToSpaceInvariant()
2932 LOG(FATAL) << "Invalid reference " << ref in AssertToSpaceInvariant()
2937 AssertToSpaceInvariantInNonMovingSpace(obj, ref); in AssertToSpaceInvariant()
2967 std::string ConcurrentCopying::DumpGcRoot(mirror::Object* ref) { in DumpGcRoot() argument
2970 oss << kIndent << "Invalid GC root: ref=" << ref << '\n'; in DumpGcRoot()
2972 oss << DumpReferenceInfo(ref, "ref", kIndent); in DumpGcRoot()
2977 mirror::Object* ref) { in AssertToSpaceInvariant() argument
2980 if (ref == nullptr) { in AssertToSpaceInvariant()
2983 } else if (region_space_->HasAddress(ref)) { in AssertToSpaceInvariant()
2986 space::RegionSpace::RegionType type = region_space_->GetRegionTypeUnsafe(ref); in AssertToSpaceInvariant()
2991 if (!IsMarkedInUnevacFromSpace(ref)) { in AssertToSpaceInvariant()
2995 LOG(FATAL_WITHOUT_ABORT) << DumpGcRoot(ref); in AssertToSpaceInvariant()
2997 CHECK(IsMarkedInUnevacFromSpace(ref)) << ref; in AssertToSpaceInvariant()
3007 LOG(FATAL_WITHOUT_ABORT) << DumpGcRoot(ref); in AssertToSpaceInvariant()
3023 ref->GetLockWord(false).Dump(LOG_STREAM(FATAL_WITHOUT_ABORT)); in AssertToSpaceInvariant()
3028 LOG(FATAL) << "Invalid reference " << ref; in AssertToSpaceInvariant()
3032 AssertToSpaceInvariantInNonMovingSpace(/* obj= */ nullptr, ref); in AssertToSpaceInvariant()
3112 mirror::Object* ref) { in AssertToSpaceInvariantInNonMovingSpace() argument
3113 CHECK(ref != nullptr); in AssertToSpaceInvariantInNonMovingSpace()
3114 CHECK(!region_space_->HasAddress(ref)) << "obj=" << obj << " ref=" << ref; in AssertToSpaceInvariantInNonMovingSpace()
3116 if (immune_spaces_.ContainsObject(ref)) { in AssertToSpaceInvariantInNonMovingSpace()
3124 CHECK(updated_all_immune_objects || ref->GetReadBarrierState() == ReadBarrier::GrayState()) in AssertToSpaceInvariantInNonMovingSpace()
3127 << " ref=" << ref << " ref rb_state=" << ref->GetReadBarrierState() in AssertToSpaceInvariantInNonMovingSpace()
3135 CHECK(IsMarkedInNonMovingSpace(ref)) in AssertToSpaceInvariantInNonMovingSpace()
3138 << " ref=" << ref in AssertToSpaceInvariantInNonMovingSpace()
3139 << " rb_state=" << ref->GetReadBarrierState() in AssertToSpaceInvariantInNonMovingSpace()
3164 void operator()(ObjPtr<mirror::Class> klass, ObjPtr<mirror::Reference> ref) const in operator ()()
3167 collector_->DelayReferenceReferent(klass, ref); in operator ()()
3220 mirror::Object* ref = obj->GetFieldObject< in Process() local
3224 ref, in Process()
3227 if (to_ref == ref) { in Process()
3231 mirror::Object* expected_ref = ref; in Process()
3254 mirror::Object* ref = *root; in VisitRoots() local
3255 mirror::Object* to_ref = Mark(self, ref); in VisitRoots()
3256 if (to_ref == ref) { in VisitRoots()
3260 mirror::Object* expected_ref = ref; in VisitRoots()
3275 mirror::Object* const ref = root->AsMirrorPtr(); in MarkRoot() local
3276 mirror::Object* to_ref = Mark<kGrayImmuneObject>(self, ref); in MarkRoot()
3277 if (to_ref != ref) { in MarkRoot()
3279 auto expected_ref = mirror::CompressedReference<mirror::Object>::FromMirrorPtr(ref); in MarkRoot()
3283 if (ref != addr->load(std::memory_order_relaxed).AsMirrorPtr()) { in MarkRoot()
3650 bool ConcurrentCopying::IsOnAllocStack(mirror::Object* ref) { in IsOnAllocStack() argument
3654 return alloc_stack->Contains(ref); in IsOnAllocStack()
3658 mirror::Object* ref, in MarkNonMoving() argument
3662 DCHECK(!region_space_->HasAddress(ref)) << ref; in MarkNonMoving()
3663 DCHECK(!immune_spaces_.ContainsObject(ref)); in MarkNonMoving()
3667 const bool is_los = !mark_bitmap->HasAddress(ref); in MarkNonMoving()
3669 if (!IsAligned<kPageSize>(ref)) { in MarkNonMoving()
3675 heap_->GetVerification()->LogHeapCorruption(holder, offset, ref, /* fatal= */ true); in MarkNonMoving()
3678 << "ref=" << ref in MarkNonMoving()
3681 DCHECK(los_bitmap->HasAddress(ref)); in MarkNonMoving()
3696 if (!IsOnAllocStack(ref) && in MarkNonMoving()
3697 ref->AtomicSetReadBarrierState(ReadBarrier::NonGrayState(), ReadBarrier::GrayState())) { in MarkNonMoving()
3702 PushOntoMarkStack(self, ref); in MarkNonMoving()
3704 return ref; in MarkNonMoving()
3707 if (!is_los && mark_bitmap->Test(ref)) { in MarkNonMoving()
3709 } else if (is_los && los_bitmap->Test(ref)) { in MarkNonMoving()
3711 } else if (IsOnAllocStack(ref)) { in MarkNonMoving()
3715 DCHECK(!mark_bitmap->Test(ref)); in MarkNonMoving()
3717 DCHECK(!los_bitmap->Test(ref)); in MarkNonMoving()
3720 DCHECK_EQ(ref->GetReadBarrierState(), ReadBarrier::NonGrayState()); in MarkNonMoving()
3727 success = ref->AtomicSetReadBarrierState(ReadBarrier::NonGrayState(), in MarkNonMoving()
3731 !los_bitmap->AtomicTestAndSet(ref) : in MarkNonMoving()
3732 !mark_bitmap->AtomicTestAndSet(ref); in MarkNonMoving()
3736 DCHECK_EQ(ref->GetReadBarrierState(), ReadBarrier::GrayState()); in MarkNonMoving()
3738 PushOntoMarkStack(self, ref); in MarkNonMoving()
3741 return ref; in MarkNonMoving()