From 5ffa0780a2738eed1f86efb967ea99badcbd5d9c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 27 Jul 2016 10:45:47 -0700 Subject: Reduce unnecessary read barriers in GC Removed read barrier from IsUnprocessed, DequeuePendingReference, EnqueueReference, and a few other places. Hard to tell if GC time goes down. EAAC: Before GC slow path count: 254857 After GC slow path count: 1005 Bug: 30162165 Bug: 12687968 Test: test-art-host, volantis boot with CC Change-Id: Ic2add3a9b1e1d7561b0b167f2218b10f8dbff76c --- runtime/mirror/reference.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/mirror/reference.h') diff --git a/runtime/mirror/reference.h b/runtime/mirror/reference.h index 3baa12e40b..e8ad5fa1c8 100644 --- a/runtime/mirror/reference.h +++ b/runtime/mirror/reference.h @@ -76,8 +76,9 @@ class MANAGED Reference : public Object { SetFieldObjectVolatile(ReferentOffset(), nullptr); } + template Reference* GetPendingNext() SHARED_REQUIRES(Locks::mutator_lock_) { - return GetFieldObject(PendingNextOffset()); + return GetFieldObject(PendingNextOffset()); } void SetPendingNext(Reference* pending_next) @@ -102,7 +103,7 @@ class MANAGED Reference : public Object { // removed from the list after having determined the reference is not ready // to be enqueued on a java ReferenceQueue. bool IsUnprocessed() SHARED_REQUIRES(Locks::mutator_lock_) { - return GetPendingNext() == nullptr; + return GetPendingNext() == nullptr; } template -- cgit v1.2.3-59-g8ed1b