Add resolve method.
Change-Id: I19210e4b0429b92bc725d47e1b4016fa89de54e9
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index a077682..a09b68e 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -2295,6 +2295,35 @@
}
+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();