From 04302dbb106d590ff72c0dfecda23d85b6565059 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Wed, 11 Nov 2015 23:45:34 -0800 Subject: Fix class unloading with the CC collector. Avoid unnecessarily decoding dex cache and class loader weak roots, which would trigger read barriers. Re-enable 141-class-unload with the CC collector. Bug: 12687968 Bug: 24468364 Change-Id: Ib4c19f25000873cab0e06047040442d135285745 --- runtime/java_vm_ext.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/java_vm_ext.h') diff --git a/runtime/java_vm_ext.h b/runtime/java_vm_ext.h index c1fbdc0389..618f6faad5 100644 --- a/runtime/java_vm_ext.h +++ b/runtime/java_vm_ext.h @@ -149,6 +149,11 @@ class JavaVMExt : public JavaVM { SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!weak_globals_lock_); + // Checks if the weak global ref has been cleared by the GC without decode (read barrier.) + bool IsWeakGlobalCleared(Thread* self, IndirectRef ref) + SHARED_REQUIRES(Locks::mutator_lock_) + REQUIRES(!weak_globals_lock_); + Mutex& WeakGlobalsLock() RETURN_CAPABILITY(weak_globals_lock_) { return weak_globals_lock_; } -- cgit v1.2.3-59-g8ed1b