summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/method_compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler_llvm/method_compiler.cc')
-rw-r--r--src/compiler_llvm/method_compiler.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index a0776825c9..a09b68ee45 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -2295,6 +2295,35 @@ void MethodCompiler::EmitInsn_IPut(uint32_t dex_pc,
}
+Method* MethodCompiler::ResolveMethod(uint32_t method_idx) {
+ Thread* thread = Thread::Current();
+
+ // Save the exception state
+ Throwable* old_exception = NULL;
+ if (thread->IsExceptionPending()) {
+ old_exception = thread->GetException();
+ thread->ClearException();
+ }
+
+ // Resolve the method through the class linker
+ Method* method = class_linker_->ResolveMethod(*dex_file_, method_idx,
+ dex_cache_, class_loader_,
+ /* is_direct= */ false);
+
+ if (method == NULL) {
+ // Ignore the exception raised during the method resolution
+ thread->ClearException();
+ }
+
+ // Restore the exception state
+ if (old_exception != NULL) {
+ thread->SetException(old_exception);
+ }
+
+ return method;
+}
+
+
Field* MethodCompiler::ResolveField(uint32_t field_idx) {
Thread* thread = Thread::Current();