diff options
| author | 2017-11-30 09:16:37 +0000 | |
|---|---|---|
| committer | 2017-11-30 09:16:37 +0000 | |
| commit | 61bca574a474c26e302bdbc0b23d3c311d218fc6 (patch) | |
| tree | cbcfcee8846c8f9298b64f52e3523d2268e179ca /runtime/art_method.cc | |
| parent | da1ea1403227713c81e53e5334106f89d20767ed (diff) | |
| parent | 8f8bd8bfce0f2433bc66ac90a471e5f58cd2e2cc (diff) | |
Merge "Revert "Revert "Revert "JIT JNI stubs.""""
am: 8f8bd8bfce
Change-Id: Ie74a0ae3c130a4bde4fec8f92373d5a9df17663b
Diffstat (limited to 'runtime/art_method.cc')
| -rw-r--r-- | runtime/art_method.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/runtime/art_method.cc b/runtime/art_method.cc index bdbc4509f3..fa0c501e31 100644 --- a/runtime/art_method.cc +++ b/runtime/art_method.cc @@ -587,6 +587,11 @@ const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) { CHECK(existing_entry_point != nullptr) << PrettyMethod() << "@" << this; ClassLinker* class_linker = runtime->GetClassLinker(); + if (class_linker->IsQuickGenericJniStub(existing_entry_point)) { + // The generic JNI does not have any method header. + return nullptr; + } + if (existing_entry_point == GetQuickProxyInvokeHandler()) { DCHECK(IsProxyMethod() && !IsConstructor()); // The proxy entry point does not have any method header. @@ -594,8 +599,7 @@ const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) { } // Check whether the current entry point contains this pc. - if (!class_linker->IsQuickGenericJniStub(existing_entry_point) && - !class_linker->IsQuickResolutionStub(existing_entry_point) && + if (!class_linker->IsQuickResolutionStub(existing_entry_point) && !class_linker->IsQuickToInterpreterBridge(existing_entry_point)) { OatQuickMethodHeader* method_header = OatQuickMethodHeader::FromEntryPoint(existing_entry_point); @@ -628,13 +632,19 @@ const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) { OatFile::OatMethod oat_method = FindOatMethodFor(this, class_linker->GetImagePointerSize(), &found); if (!found) { - if (IsNative()) { - // We are running the GenericJNI stub. The entrypoint may point - // to different entrypoints or to a JIT-compiled JNI stub. - DCHECK(class_linker->IsQuickGenericJniStub(existing_entry_point) || - class_linker->IsQuickResolutionStub(existing_entry_point) || - existing_entry_point == GetQuickInstrumentationEntryPoint() || - (jit != nullptr && jit->GetCodeCache()->ContainsPc(existing_entry_point))); + if (class_linker->IsQuickResolutionStub(existing_entry_point)) { + // We are running the generic jni stub, but the entry point of the method has not + // been updated yet. + DCHECK_EQ(pc, 0u) << "Should be a downcall"; + DCHECK(IsNative()); + return nullptr; + } + if (existing_entry_point == GetQuickInstrumentationEntryPoint()) { + // We are running the generic jni stub, but the method is being instrumented. + // NB We would normally expect the pc to be zero but we can have non-zero pc's if + // instrumentation is installed or removed during the call which is using the generic jni + // trampoline. + DCHECK(IsNative()); return nullptr; } // Only for unit tests. |