diff options
author | 2022-11-21 11:19:14 +0100 | |
---|---|---|
committer | 2022-11-21 13:33:42 +0000 | |
commit | 618159141b905d79cd424d88b8a2448ad339ce39 (patch) | |
tree | 844c9e484f8625473075c4d35d8c7f8e5ae08fe1 /runtime/jni/java_vm_ext.cc | |
parent | dd1d13d3f75032d65e29488ecd0cadc9e897a7ad (diff) |
Clean up `IndirectReferenceTable` visiting.
Move weak global sweeping to the IRT class and clean up the
entry visiting to avoid the need for the `IrtIterator`.
Move `JNIEnvExt::UpdateLocal` to the `jni_env_ext-inl.h`
because it requires `indirect_reference_table-inl.h`.
Test: m test-art-host-gtest
Test: tesrunner.py --host --optimizing
Bug: 172332525
Change-Id: Ia96d31e0d8d701c93d7752bf76f633719a836f3f
Diffstat (limited to 'runtime/jni/java_vm_ext.cc')
-rw-r--r-- | runtime/jni/java_vm_ext.cc | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/runtime/jni/java_vm_ext.cc b/runtime/jni/java_vm_ext.cc index 248335a78a..f28532b001 100644 --- a/runtime/jni/java_vm_ext.cc +++ b/runtime/jni/java_vm_ext.cc @@ -1169,23 +1169,6 @@ void* JavaVMExt::FindCodeForNativeMethod(ArtMethod* m, std::string* error_msg, b return native_method; } -void JavaVMExt::SweepJniWeakGlobals(IsMarkedVisitor* visitor) { - MutexLock mu(Thread::Current(), *Locks::jni_weak_globals_lock_); - Runtime* const runtime = Runtime::Current(); - for (auto* entry : weak_globals_) { - // Need to skip null here to distinguish between null entries and cleared weak ref entries. - if (!entry->IsNull()) { - // Since this is called by the GC, we don't need a read barrier. - mirror::Object* obj = entry->Read<kWithoutReadBarrier>(); - mirror::Object* new_obj = visitor->IsMarked(obj); - if (new_obj == nullptr) { - new_obj = runtime->GetClearedJniWeakGlobal(); - } - *entry = GcRoot<mirror::Object>(new_obj); - } - } -} - void JavaVMExt::TrimGlobals() { WriterMutexLock mu(Thread::Current(), *Locks::jni_globals_lock_); globals_.Trim(); |