summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter_common.h
diff options
context:
space:
mode:
author Orion Hodson <oth@google.com> 2017-09-22 16:17:41 +0100
committer Orion Hodson <oth@google.com> 2017-10-02 16:08:18 +0100
commit2e59994c3c586d8b753e4b14a94c81bce3dba1a9 (patch)
treeab749ce709732821c7c00c81eb76afef032fd888 /runtime/interpreter/interpreter_common.h
parent865a0503515f78611dce103bd04b7c66c051d304 (diff)
ART: support for const-method-{handle,type}
Adds support for const-method-handle and const-method-type bytecodes. Bug: 66562269 Test: art/test/run-test --host 979 Test: art/test/dexdump/run-all-tests Change-Id: I812eaf0f2439d6126b4287483fe2348366cacf90
Diffstat (limited to 'runtime/interpreter/interpreter_common.h')
-rw-r--r--runtime/interpreter/interpreter_common.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h
index 50bd7e73cd..fafb2a36f7 100644
--- a/runtime/interpreter/interpreter_common.h
+++ b/runtime/interpreter/interpreter_common.h
@@ -202,6 +202,25 @@ static inline bool DoInvoke(Thread* self,
}
}
+static inline mirror::MethodHandle* ResolveMethodHandle(uint32_t method_handle_index,
+ ArtMethod* referrer)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
+ ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
+ return class_linker->ResolveMethodHandle(method_handle_index, referrer);
+}
+
+static inline mirror::MethodType* ResolveMethodType(Thread* self,
+ uint32_t method_type_index,
+ ArtMethod* referrer)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
+ ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
+ const DexFile* dex_file = referrer->GetDexFile();
+ StackHandleScope<2> hs(self);
+ Handle<mirror::DexCache> dex_cache(hs.NewHandle(referrer->GetDexCache()));
+ Handle<mirror::ClassLoader> class_loader(hs.NewHandle(referrer->GetClassLoader()));
+ return class_linker->ResolveMethodType(*dex_file, method_type_index, dex_cache, class_loader);
+}
+
// Performs a signature polymorphic invoke (invoke-polymorphic/invoke-polymorphic-range).
template<bool is_range>
bool DoInvokePolymorphic(Thread* self,