Revert "Revert "Revert "JIT JNI stubs."""
Still seeing occasional failures on 667-jit-jni-stub
Bug: 65574695
Bug: 69843562
This reverts commit e7441631a11e2e07ce863255a59ee4de29c6a56f.
Change-Id: I3db751679ef7bdf31c933208aaffe4fac749a14b
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 31abf94..50913de 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -95,12 +95,10 @@
return method_index_;
}
-template <ReadBarrierOption kReadBarrierOption>
inline uint32_t ArtMethod::GetDexMethodIndex() {
if (kCheckDeclaringClassState) {
- CHECK(IsRuntimeMethod() ||
- GetDeclaringClass<kReadBarrierOption>()->IsIdxLoaded() ||
- GetDeclaringClass<kReadBarrierOption>()->IsErroneous());
+ CHECK(IsRuntimeMethod() || GetDeclaringClass()->IsIdxLoaded() ||
+ GetDeclaringClass()->IsErroneous());
}
return GetDexMethodIndexUnchecked();
}
@@ -204,14 +202,7 @@
inline const char* ArtMethod::GetShorty(uint32_t* out_length) {
DCHECK(!IsProxyMethod());
const DexFile* dex_file = GetDexFile();
- // Don't do a read barrier in the DCHECK() inside GetDexMethodIndex() as GetShorty()
- // can be called when the declaring class is about to be unloaded and cannot be added
- // to the mark stack (subsequent GC assertion would fail).
- // It is safe to avoid the read barrier as the ArtMethod is constructed with a declaring
- // Class already satisfying the DCHECK() inside GetDexMethodIndex(), so even if that copy
- // of declaring class becomes a from-space object, it shall satisfy the DCHECK().
- return dex_file->GetMethodShorty(dex_file->GetMethodId(GetDexMethodIndex<kWithoutReadBarrier>()),
- out_length);
+ return dex_file->GetMethodShorty(dex_file->GetMethodId(GetDexMethodIndex()), out_length);
}
inline const Signature ArtMethod::GetSignature() {
@@ -328,7 +319,7 @@
template <ReadBarrierOption kReadBarrierOption>
inline mirror::DexCache* ArtMethod::GetDexCache() {
- if (LIKELY(!IsObsolete<kReadBarrierOption>())) {
+ if (LIKELY(!IsObsolete())) {
mirror::Class* klass = GetDeclaringClass<kReadBarrierOption>();
return klass->GetDexCache<kDefaultVerifyFlags, kReadBarrierOption>();
} else {