From dc061d038e4e48fe2a967fd4a9c200d112df5698 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Mon, 24 Oct 2016 13:19:37 -0700 Subject: ART: Clean up IndirectReferenceTable Introduce constants and move some functions into the IndirectReferenceTable class. Slightly change IndirectRef encoding to be more obvious (and slighly more optimized when decoding). Bug: 32125344 Test: m test-art-host Change-Id: I05819eccb733b611de582fb8d7151f1a110c305a --- runtime/java_vm_ext.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/java_vm_ext.cc') diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc index 9b4327f137..f1f9de8ef8 100644 --- a/runtime/java_vm_ext.cc +++ b/runtime/java_vm_ext.cc @@ -680,7 +680,7 @@ ObjPtr JavaVMExt::DecodeWeakGlobal(Thread* self, IndirectRef ref // This only applies in the case where MayAccessWeakGlobals goes from false to true. In the other // case, it may be racy, this is benign since DecodeWeakGlobalLocked does the correct behavior // if MayAccessWeakGlobals is false. - DCHECK_EQ(GetIndirectRefKind(ref), kWeakGlobal); + DCHECK_EQ(IndirectReferenceTable::GetIndirectRefKind(ref), kWeakGlobal); if (LIKELY(MayAccessWeakGlobalsUnlocked(self))) { return weak_globals_.SynchronizedGet(ref); } @@ -699,7 +699,7 @@ ObjPtr JavaVMExt::DecodeWeakGlobalLocked(Thread* self, IndirectR } ObjPtr JavaVMExt::DecodeWeakGlobalDuringShutdown(Thread* self, IndirectRef ref) { - DCHECK_EQ(GetIndirectRefKind(ref), kWeakGlobal); + DCHECK_EQ(IndirectReferenceTable::GetIndirectRefKind(ref), kWeakGlobal); DCHECK(Runtime::Current()->IsShuttingDown(self)); if (self != nullptr) { return DecodeWeakGlobal(self, ref); @@ -712,7 +712,7 @@ ObjPtr JavaVMExt::DecodeWeakGlobalDuringShutdown(Thread* self, I } bool JavaVMExt::IsWeakGlobalCleared(Thread* self, IndirectRef ref) { - DCHECK_EQ(GetIndirectRefKind(ref), kWeakGlobal); + DCHECK_EQ(IndirectReferenceTable::GetIndirectRefKind(ref), kWeakGlobal); MutexLock mu(self, *Locks::jni_weak_globals_lock_); while (UNLIKELY(!MayAccessWeakGlobals(self))) { weak_globals_add_condition_.WaitHoldingLocks(self); -- cgit v1.2.3-59-g8ed1b