diff options
author | 2022-12-20 16:25:58 +0000 | |
---|---|---|
committer | 2023-01-17 10:15:09 +0000 | |
commit | d80bbba155fd18a38075cf6f626bee382c2b492c (patch) | |
tree | 90a0282dca2c05f3b3484d7e21de5d4b6213e5b7 /runtime/jni/java_vm_ext.cc | |
parent | 9e3761d6b98e090cff2e30e0f5e9714f434dd0f2 (diff) |
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
Diffstat (limited to 'runtime/jni/java_vm_ext.cc')
-rw-r--r-- | runtime/jni/java_vm_ext.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/jni/java_vm_ext.cc b/runtime/jni/java_vm_ext.cc index b4e7938e91..7ae6c99fc6 100644 --- a/runtime/jni/java_vm_ext.cc +++ b/runtime/jni/java_vm_ext.cc @@ -866,6 +866,11 @@ ObjPtr<mirror::Object> JavaVMExt::DecodeWeakGlobalLocked(Thread* self, IndirectR return weak_globals_.Get(ref); } +ObjPtr<mirror::Object> JavaVMExt::DecodeWeakGlobalAsStrong(IndirectRef ref) { + // The target is known to be alive. Simple `Get()` with read barrier is enough. + return weak_globals_.Get(ref); +} + ObjPtr<mirror::Object> JavaVMExt::DecodeWeakGlobalDuringShutdown(Thread* self, IndirectRef ref) { DCHECK_EQ(IndirectReferenceTable::GetIndirectRefKind(ref), kWeakGlobal); DCHECK(Runtime::Current()->IsShuttingDown(self)); |