summaryrefslogtreecommitdiff
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-06-01 16:53:12 +0100
committer Vladimir Marko <vmarko@google.com> 2018-06-04 17:52:35 +0100
commit18090d118bfb04620aeef719e2d7780c26298bf8 (patch)
tree040e5195f0278c9bc846d5543c0e36771ffc5b48 /runtime/class_linker.h
parent9ddef18ae95859a985e7a0de7e22999fcbc28e07 (diff)
Refactor String resolution.
Use the same pattern as type resolution and avoid some unnecessary read barriers in the fast path. Consolidate naming between ArtField and ArtMethod. Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: Iea69129085f61f04a4add09edd0eadbb7ac9ecb2
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index 58ce6eb25c..85817ac6ac 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -203,6 +203,16 @@ class ClassLinker {
REQUIRES(!Locks::classlinker_classes_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
+ // Resolve a String with the given index from the DexFile associated with the given `referrer`,
+ // storing the result in the DexCache. The `referrer` is used to identify the target DexCache
+ // to use for resolution.
+ ObjPtr<mirror::String> ResolveString(dex::StringIndex string_idx,
+ ArtField* referrer)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+ ObjPtr<mirror::String> ResolveString(dex::StringIndex string_idx,
+ ArtMethod* referrer)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
// Resolve a String with the given index from the DexFile associated with the given DexCache,
// storing the result in the DexCache.
ObjPtr<mirror::String> ResolveString(dex::StringIndex string_idx,
@@ -885,6 +895,19 @@ class ClassLinker {
ObjPtr<mirror::ClassLoader> class_loader)
REQUIRES_SHARED(Locks::mutator_lock_);
+ // Implementation of ResolveString() called when the string was not found in the dex cache.
+ ObjPtr<mirror::String> DoResolveString(dex::StringIndex string_idx,
+ ObjPtr<mirror::DexCache> dex_cache)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+ ObjPtr<mirror::String> DoResolveString(dex::StringIndex string_idx,
+ Handle<mirror::DexCache> dex_cache)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
+ // Implementation of LookupString() called when the string was not found in the dex cache.
+ ObjPtr<mirror::String> DoLookupString(dex::StringIndex string_idx,
+ ObjPtr<mirror::DexCache> dex_cache)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
// Implementation of ResolveType() called when the type was not found in the dex cache.
ObjPtr<mirror::Class> DoResolveType(dex::TypeIndex type_idx,
ObjPtr<mirror::Class> referrer)