summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/class_linker.cc3
-rw-r--r--src/runtime_support.cc4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 61af24d44a..7ca0361229 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -2626,9 +2626,6 @@ Method* ClassLinker::ResolveMethod(const DexFile& dex_file,
}
if (resolved != NULL) {
dex_cache->SetResolvedMethod(method_idx, resolved);
- if (is_direct && resolved->GetCode() != NULL) {
- dex_cache->GetCodeAndDirectMethods()->SetResolvedDirectMethod(method_idx, resolved);
- }
} else {
ThrowNoSuchMethodError(is_direct ? "direct" : "virtual", klass, name, signature);
}
diff --git a/src/runtime_support.cc b/src/runtime_support.cc
index a8243e20aa..9b32d69ad8 100644
--- a/src/runtime_support.cc
+++ b/src/runtime_support.cc
@@ -399,6 +399,10 @@ void* UnresolvedDirectMethodTrampolineFromCode(int32_t method_idx, void* sp, Thr
}
// Resolve method filling in dex cache
Method* called = linker->ResolveMethod(method_idx, *caller_sp, true);
+ // Update CodeAndDirectMethod table
+ Method* caller = *caller_sp;
+ DexCache* dex_cache = caller->GetDeclaringClass()->GetDexCache();
+ dex_cache->GetCodeAndDirectMethods()->SetResolvedDirectMethod(method_idx, called);
if (LIKELY(!thread->IsExceptionPending())) {
// We got this far, ensure that the declaring class is initialized
linker->EnsureInitialized(called->GetDeclaringClass(), true);