Lines Matching refs:r
154 Region* r = ®ions_[i]; in FromSpaceSize() local
155 if (r->IsInFromSpace()) { in FromSpaceSize()
166 Region* r = ®ions_[i]; in UnevacFromSpaceSize() local
167 if (r->IsInUnevacFromSpace()) { in UnevacFromSpaceSize()
178 Region* r = ®ions_[i]; in ToSpaceSize() local
179 if (r->IsInToSpace()) { in ToSpaceSize()
336 Region* r = ®ions_[i]; in SetFromSpace() local
337 RegionState state = r->State(); in SetFromSpace()
338 RegionType type = r->Type(); in SetFromSpace()
339 if (!r->IsFree()) { in SetFromSpace()
340 DCHECK(r->IsInToSpace()); in SetFromSpace()
345 bool should_evacuate = r->ShouldBeEvacuated(evac_mode); in SetFromSpace()
346 bool is_newly_allocated = r->IsNewlyAllocated(); in SetFromSpace()
348 r->SetAsFromSpace(); in SetFromSpace()
349 DCHECK(r->IsInFromSpace()); in SetFromSpace()
351 r->SetAsUnevacFromSpace(clear_live_bytes); in SetFromSpace()
352 DCHECK(r->IsInUnevacFromSpace()); in SetFromSpace()
364 GetMarkBitmap()->Clear(reinterpret_cast<mirror::Object*>(r->Begin())); in SetFromSpace()
366 num_expected_large_tails = RoundUp(r->BytesAllocated(), kRegionSize) / kRegionSize - 1; in SetFromSpace()
373 r->SetAsFromSpace(); in SetFromSpace()
374 DCHECK(r->IsInFromSpace()); in SetFromSpace()
376 r->SetAsUnevacFromSpace(clear_live_bytes); in SetFromSpace()
377 DCHECK(r->IsInUnevacFromSpace()); in SetFromSpace()
385 rb_table->Clear(r->Begin(), r->End()); in SetFromSpace()
389 DCHECK(!r->is_newly_allocated_); in SetFromSpace()
449 auto expand_madvise_range = [&madvise_list, &clear_block_begin, &clear_block_end] (Region* r) { in ClearFromSpace() argument
450 if (clear_block_end != r->Begin()) { in ClearFromSpace()
455 clear_block_begin = r->Begin(); in ClearFromSpace()
457 clear_block_end = r->End(); in ClearFromSpace()
460 Region* r = ®ions_[i]; in ClearFromSpace() local
465 CheckLiveBytesAgainstRegionBitmap(r); in ClearFromSpace()
467 if (r->IsInFromSpace()) { in ClearFromSpace()
468 expand_madvise_range(r); in ClearFromSpace()
469 } else if (r->IsInUnevacFromSpace()) { in ClearFromSpace()
471 if (r->LiveBytes() == 0 && !r->IsLargeTail()) { in ClearFromSpace()
478 expand_madvise_range(r); in ClearFromSpace()
523 Region* r = ®ions_[i]; in ClearFromSpace() local
524 if (r->IsInFromSpace()) { in ClearFromSpace()
525 DCHECK(!r->IsTlab()); in ClearFromSpace()
526 *cleared_bytes += r->BytesAllocated(); in ClearFromSpace()
527 *cleared_objects += r->ObjectsAllocated(); in ClearFromSpace()
529 r->Clear(/*zero_and_release_pages=*/false); in ClearFromSpace()
530 } else if (r->IsInUnevacFromSpace()) { in ClearFromSpace()
531 if (r->LiveBytes() == 0) { in ClearFromSpace()
532 DCHECK(!r->IsLargeTail()); in ClearFromSpace()
533 *cleared_bytes += r->BytesAllocated(); in ClearFromSpace()
534 *cleared_objects += r->ObjectsAllocated(); in ClearFromSpace()
535 r->Clear(/*zero_and_release_pages=*/false); in ClearFromSpace()
547 reinterpret_cast<mirror::Object*>(r->Begin()), in ClearFromSpace()
548 reinterpret_cast<mirror::Object*>(r->Begin() + free_regions * kRegionSize)); in ClearFromSpace()
552 r->SetUnevacFromSpaceAsToSpace(); in ClearFromSpace()
553 if (r->AllAllocatedBytesAreLive()) { in ClearFromSpace()
597 reinterpret_cast<mirror::Object*>(r->Begin()), in ClearFromSpace()
598 reinterpret_cast<mirror::Object*>(r->Begin() in ClearFromSpace()
610 if (!use_generational_cc_ || (r->LiveBytes() != static_cast<size_t>(-1))) { in ClearFromSpace()
613 DCHECK(r->IsAllocated()) << r->State(); in ClearFromSpace()
615 PoisonDeadObjectsInUnevacuatedRegion(r); in ClearFromSpace()
634 void RegionSpace::CheckLiveBytesAgainstRegionBitmap(Region* r) { in CheckLiveBytesAgainstRegionBitmap() argument
635 if (r->LiveBytes() == static_cast<size_t>(-1)) { in CheckLiveBytesAgainstRegionBitmap()
644 [&r, &live_bytes_recount](mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) { in CheckLiveBytesAgainstRegionBitmap()
646 if (r->IsLarge()) { in CheckLiveBytesAgainstRegionBitmap()
651 DCHECK_EQ(reinterpret_cast<uint8_t*>(obj), r->Begin()); in CheckLiveBytesAgainstRegionBitmap()
653 live_bytes_recount = r->Top() - r->Begin(); in CheckLiveBytesAgainstRegionBitmap()
655 DCHECK(r->IsAllocated()) in CheckLiveBytesAgainstRegionBitmap()
656 << "r->State()=" << r->State() << " r->LiveBytes()=" << r->LiveBytes(); in CheckLiveBytesAgainstRegionBitmap()
663 GetLiveBitmap()->VisitMarkedRange(reinterpret_cast<uintptr_t>(r->Begin()), in CheckLiveBytesAgainstRegionBitmap()
664 reinterpret_cast<uintptr_t>(r->Top()), in CheckLiveBytesAgainstRegionBitmap()
667 DCHECK_EQ(live_bytes_recount, r->LiveBytes()); in CheckLiveBytesAgainstRegionBitmap()
685 void RegionSpace::PoisonDeadObjectsInUnevacuatedRegion(Region* r) { in PoisonDeadObjectsInUnevacuatedRegion() argument
689 DCHECK_NE(r->LiveBytes(), static_cast<size_t>(-1)) in PoisonDeadObjectsInUnevacuatedRegion()
690 << "Unexpected live bytes count of -1 in " << Dumpable<Region>(*r); in PoisonDeadObjectsInUnevacuatedRegion()
694 uint8_t* prev_obj_end = reinterpret_cast<uint8_t*>(r->Begin()); in PoisonDeadObjectsInUnevacuatedRegion()
711 GetLiveBitmap()->VisitMarkedRange(reinterpret_cast<uintptr_t>(r->Begin()), in PoisonDeadObjectsInUnevacuatedRegion()
712 reinterpret_cast<uintptr_t>(r->Top()), in PoisonDeadObjectsInUnevacuatedRegion()
715 if (prev_obj_end < r->Top()) { in PoisonDeadObjectsInUnevacuatedRegion()
716 PoisonUnevacuatedRange(prev_obj_end, r->Top()); in PoisonDeadObjectsInUnevacuatedRegion()
733 Region* r = ®ions_[i]; in LogFragmentationAllocFailure() local
734 if (r->IsFree()) { in LogFragmentationAllocFailure()
780 Region* r = ®ions_[i]; in Clear() local
781 if (!r->IsFree()) { in Clear()
784 r->Clear(/*zero_and_release_pages=*/true); in Clear()
854 Region* r = RefToRegion(ref); in RecordAlloc() local
855 r->objects_allocated_.fetch_add(1, std::memory_order_relaxed); in RecordAlloc()
863 Region* r = nullptr; in AllocNewTlab() local
872 r = largest_partial_tlab->second; in AllocNewTlab()
873 pos = r->End() - largest_partial_tlab->first; in AllocNewTlab()
875 DCHECK_GT(r->End(), pos); in AllocNewTlab()
876 DCHECK_LE(r->Begin(), pos); in AllocNewTlab()
877 DCHECK_GE(r->Top(), pos); in AllocNewTlab()
878 *bytes_tl_bulk_allocated -= r->Top() - pos; in AllocNewTlab()
881 if (r == nullptr) { in AllocNewTlab()
883 r = AllocateRegion(/*for_evac=*/ false); in AllocNewTlab()
885 if (r != nullptr) { in AllocNewTlab()
886 uint8_t* start = pos != nullptr ? pos : r->Begin(); in AllocNewTlab()
888 r->is_a_tlab_ = true; in AllocNewTlab()
889 r->thread_ = self; in AllocNewTlab()
890 r->SetTop(r->End()); in AllocNewTlab()
891 self->SetTlab(start, start + tlab_size, r->End()); in AllocNewTlab()
913 Region* r = RefToRegionLocked(reinterpret_cast<mirror::Object*>(tlab_start)); in RevokeThreadLocalBuffersLocked() local
914 r->is_a_tlab_ = false; in RevokeThreadLocalBuffersLocked()
915 r->thread_ = nullptr; in RevokeThreadLocalBuffersLocked()
916 DCHECK(r->IsAllocated()); in RevokeThreadLocalBuffersLocked()
918 r->RecordThreadLocalAllocations(thread->GetThreadLocalObjectsAllocated(), in RevokeThreadLocalBuffersLocked()
919 thread->GetTlabEnd() - r->Begin()); in RevokeThreadLocalBuffersLocked()
920 DCHECK_GE(r->End(), thread->GetTlabPos()); in RevokeThreadLocalBuffersLocked()
921 DCHECK_LE(r->Begin(), thread->GetTlabPos()); in RevokeThreadLocalBuffersLocked()
922 size_t remaining_bytes = r->End() - thread->GetTlabPos(); in RevokeThreadLocalBuffersLocked()
924 partial_tlabs_.insert(std::make_pair(remaining_bytes, r)); in RevokeThreadLocalBuffersLocked()
1053 Region* r = ®ions_[region_index]; in AllocateRegion() local
1054 if (r->IsFree()) { in AllocateRegion()
1055 r->Unfree(this, time_); in AllocateRegion()
1058 DCHECK_IMPLIES(for_evac, !r->is_newly_allocated_); in AllocateRegion()
1065 r->SetNewlyAllocated(); in AllocateRegion()
1073 return r; in AllocateRegion()