diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/class_linker.cc | 2 | ||||
| -rw-r--r-- | src/compiler_llvm/runtime_support_llvm.cc | 2 | ||||
| -rw-r--r-- | src/object.cc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc index 4a38493acc..08792ebd4f 100644 --- a/src/class_linker.cc +++ b/src/class_linker.cc @@ -1353,7 +1353,6 @@ const OatFile::OatClass* ClassLinker::GetOatClass(const DexFile& dex_file, const } const OatFile::OatMethod ClassLinker::GetOatMethodFor(const Method* method) { - CHECK(Runtime::Current()->IsCompiler() || method->GetDeclaringClass()->IsInitializing()); // Although we overwrite the trampoline of non-static methods, we may get here via the resolution // method for direct methods (or virtual methods made direct). Class* declaring_class = method->GetDeclaringClass(); @@ -1384,6 +1383,7 @@ const OatFile::OatMethod ClassLinker::GetOatMethodFor(const Method* method) { // Special case to get oat code without overwriting a trampoline. const void* ClassLinker::GetOatCodeFor(const Method* method) { + CHECK(Runtime::Current()->IsCompiler() || method->GetDeclaringClass()->IsInitializing()); return GetOatMethodFor(method).GetCode(); } diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc index 36343f7f61..e7e2d8624c 100644 --- a/src/compiler_llvm/runtime_support_llvm.cc +++ b/src/compiler_llvm/runtime_support_llvm.cc @@ -604,7 +604,7 @@ Method* art_ensure_resolved_from_code(Method* called, } void art_ensure_link_from_code(Method* method) { - if (method->GetInvokeStub() == NULL && method->GetCode() == NULL) { + if (method->GetInvokeStub() == NULL || method->GetCode() == NULL) { Runtime::Current()->GetClassLinker()->LinkOatCodeFor(method); } } diff --git a/src/object.cc b/src/object.cc index 74195f8789..7fdff31423 100644 --- a/src/object.cc +++ b/src/object.cc @@ -573,7 +573,7 @@ void Method::Invoke(Thread* self, Object* receiver, JValue* args, JValue* result bool have_executable_code = (GetCode() != NULL); #if defined(ART_USE_LLVM_COMPILER) - if (stub == NULL && !have_executable_code) { + if (stub == NULL || !have_executable_code) { art_ensure_link_from_code(const_cast<Method*>(this)); stub = GetInvokeStub(); have_executable_code = (GetCode() != NULL); |