From 5d3f73aef1b778d81ba101ece41935adee259cf2 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 14 Oct 2016 14:28:47 -0700 Subject: Move reference processor and mirror::Reference to ObjPtr Bug: 31113334 Test: test-art-host Change-Id: I2c7c3dfd88ebf12a0de271436f8a7781f997e061 --- runtime/gc/reference_processor.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'runtime/gc/reference_processor.cc') diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc index 96945978af..4b8f38d709 100644 --- a/runtime/gc/reference_processor.cc +++ b/runtime/gc/reference_processor.cc @@ -60,12 +60,13 @@ void ReferenceProcessor::BroadcastForSlowPath(Thread* self) { condition_.Broadcast(self); } -mirror::Object* ReferenceProcessor::GetReferent(Thread* self, mirror::Reference* reference) { +ObjPtr ReferenceProcessor::GetReferent(Thread* self, + ObjPtr reference) { if (!kUseReadBarrier || self->GetWeakRefAccessEnabled()) { // Under read barrier / concurrent copying collector, it's not safe to call GetReferent() when // weak ref access is disabled as the call includes a read barrier which may push a ref onto the // mark stack and interfere with termination of marking. - mirror::Object* const referent = reference->GetReferent(); + ObjPtr const referent = reference->GetReferent(); // If the referent is null then it is already cleared, we can just return null since there is no // scenario where it becomes non-null during the reference processing phase. if (UNLIKELY(!SlowPathEnabled()) || referent == nullptr) { @@ -116,7 +117,8 @@ void ReferenceProcessor::StopPreservingReferences(Thread* self) { } // Process reference class instances and schedule finalizations. -void ReferenceProcessor::ProcessReferences(bool concurrent, TimingLogger* timings, +void ReferenceProcessor::ProcessReferences(bool concurrent, + TimingLogger* timings, bool clear_soft_references, collector::GarbageCollector* collector) { TimingLogger::ScopedTiming t(concurrent ? __FUNCTION__ : "(Paused)ProcessReferences", timings); @@ -188,7 +190,8 @@ void ReferenceProcessor::ProcessReferences(bool concurrent, TimingLogger* timing // Process the "referent" field in a java.lang.ref.Reference. If the referent has not yet been // marked, put it on the appropriate list in the heap for later processing. -void ReferenceProcessor::DelayReferenceReferent(mirror::Class* klass, mirror::Reference* ref, +void ReferenceProcessor::DelayReferenceReferent(ObjPtr klass, + ObjPtr ref, collector::GarbageCollector* collector) { // klass can be the class of the old object if the visitor already updated the class of ref. DCHECK(klass != nullptr); @@ -260,7 +263,8 @@ void ReferenceProcessor::EnqueueClearedReferences(Thread* self) { } } -bool ReferenceProcessor::MakeCircularListIfUnenqueued(mirror::FinalizerReference* reference) { +bool ReferenceProcessor::MakeCircularListIfUnenqueued( + ObjPtr reference) { Thread* self = Thread::Current(); MutexLock mu(self, *Locks::reference_processor_lock_); // Wait untul we are done processing reference. -- cgit v1.2.3-59-g8ed1b