From 849d09a81907f16d8ccc6019b8baf86a304b730c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 21 Nov 2022 16:50:32 +0100 Subject: Split local reference table out of `IndirectReferenceTable`. In preparation for rewriting the representation of local JNI references, split their implementation out of the shared `IndirectReferenceTable` which shall be used only for global and weak global references going forward. Make the new `LocalReferenceTable` always resizable (remove the enum `ResizableCapacity`) and rename the memory mappings for LRT to "local ref table". Remove `IndirectReferenceTable` code that was needed only for local references, make these tables non-resizable. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 172332525 Change-Id: I87f02c93694577d1b577c4114fa86c2cd23b4c97 --- runtime/thread.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/thread.cc') diff --git a/runtime/thread.cc b/runtime/thread.cc index a8b0e17c69..751bd09e24 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -2768,9 +2768,9 @@ ObjPtr Thread::DecodeJObject(jobject obj) const { bool expect_null = false; // The "kinds" below are sorted by the frequency we expect to encounter them. if (kind == kLocal) { - IndirectReferenceTable& locals = tlsPtr_.jni_env->locals_; + jni::LocalReferenceTable& locals = tlsPtr_.jni_env->locals_; // Local references do not need a read barrier. - result = locals.Get(ref); + result = locals.Get(ref); } else if (kind == kJniTransition) { // The `jclass` for a static method points to the CompressedReference<> in the // `ArtMethod::declaring_class_`. Other `jobject` arguments point to spilled stack -- cgit v1.2.3-59-g8ed1b