diff options
author | Brian Carlstrom <bdc@google.com> | 2011-11-03 01:24:44 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2011-11-03 01:49:40 -0700 |
commit | b2062cfb7266fc52b7f03f00d26f0883f04986ae (patch) | |
tree | 886e0f675c5c9aadd4680b41d73abbd6e8e06163 /src | |
parent | 5d4bdc29737a693027daaf6ed3f0792368eb4bae (diff) | |
download | art-b2062cfb7266fc52b7f03f00d26f0883f04986ae.zip art-b2062cfb7266fc52b7f03f00d26f0883f04986ae.tar.gz art-b2062cfb7266fc52b7f03f00d26f0883f04986ae.tar.bz2 |
Avoid SetResolvedDirectMethod on failure to ResolveMethod
Change-Id: I03b579a43ba4004b6441d5123f1ce402feb77624
Diffstat (limited to 'src')
-rw-r--r-- | src/runtime_support.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/runtime_support.cc b/src/runtime_support.cc index 9653d28..7ae5da5 100644 --- a/src/runtime_support.cc +++ b/src/runtime_support.cc @@ -401,25 +401,26 @@ void* UnresolvedDirectMethodTrampolineFromCode(int32_t method_idx, Method** sp, } // 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())) { + // Update CodeAndDirectMethod table + Method* caller = *caller_sp; + DexCache* dex_cache = caller->GetDeclaringClass()->GetDexCache(); + dex_cache->GetCodeAndDirectMethods()->SetResolvedDirectMethod(method_idx, called); // We got this far, ensure that the declaring class is initialized linker->EnsureInitialized(called->GetDeclaringClass(), true); } void* code; if (UNLIKELY(thread->IsExceptionPending())) { - // Something went wrong, go into deliver exception with the pending exception in r0 + // Something went wrong in ResolveMethod or EnsureInitialized, + // go into deliver exception with the pending exception in r0 code = reinterpret_cast<void*>(art_deliver_exception_from_code); - regs[0] = reinterpret_cast<uintptr_t>(thread->GetException()); + regs[0] = reinterpret_cast<uintptr_t>(thread->GetException()); thread->ClearException(); } else { // Expect class to at least be initializing CHECK(called->GetDeclaringClass()->IsInitializing()); // Set up entry into main method - regs[0] = reinterpret_cast<uintptr_t>(called); + regs[0] = reinterpret_cast<uintptr_t>(called); code = const_cast<void*>(called->GetCode()); } return code; |