From d80bbba155fd18a38075cf6f626bee382c2b492c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 20 Dec 2022 16:25:58 +0000 Subject: Keep classes alive for stack traces with copied methods. Test: Additional test in 141-class-unload. Test: testrunner.py --host --optimizing Bug: 263254495 Change-Id: Iea925ab96fb7c8d1b825c0b100e689ab722d3159 --- runtime/jni/java_vm_ext.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/jni/java_vm_ext.h') diff --git a/runtime/jni/java_vm_ext.h b/runtime/jni/java_vm_ext.h index 8c8b1b3177..7f4f5485b6 100644 --- a/runtime/jni/java_vm_ext.h +++ b/runtime/jni/java_vm_ext.h @@ -184,6 +184,11 @@ class JavaVMExt : public JavaVM { REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::jni_weak_globals_lock_); + // Decode weak global as strong. Use only if the target object is known to be alive. + ObjPtr DecodeWeakGlobalAsStrong(IndirectRef ref) + REQUIRES_SHARED(Locks::mutator_lock_) + REQUIRES(!Locks::jni_weak_globals_lock_); + // Like DecodeWeakGlobal() but to be used only during a runtime shutdown where self may be // null. ObjPtr DecodeWeakGlobalDuringShutdown(Thread* self, IndirectRef ref) -- cgit v1.2.3-59-g8ed1b