diff options
Diffstat (limited to 'runtime/art_method-inl.h')
-rw-r--r-- | runtime/art_method-inl.h | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h index 9da4a39017..ac22f07a34 100644 --- a/runtime/art_method-inl.h +++ b/runtime/art_method-inl.h @@ -60,12 +60,6 @@ inline ObjPtr<mirror::Class> ArtMethod::GetDeclaringClass() { if (kIsDebugBuild) { if (!IsRuntimeMethod()) { CHECK(result != nullptr) << this; - if (kCheckDeclaringClassState) { - if (!(result->IsIdxLoaded() || result->IsErroneous())) { - LOG(FATAL_WITHOUT_ABORT) << "Class status: " << result->GetStatus(); - LOG(FATAL) << result->PrettyClass(); - } - } } else { CHECK(result == nullptr) << this; } @@ -94,16 +88,6 @@ inline uint16_t ArtMethod::GetMethodIndexDuringLinking() { return method_index_; } -template <ReadBarrierOption kReadBarrierOption> -inline uint32_t ArtMethod::GetDexMethodIndex() { - if (kCheckDeclaringClassState) { - CHECK(IsRuntimeMethod() || - GetDeclaringClass<kReadBarrierOption>()->IsIdxLoaded() || - GetDeclaringClass<kReadBarrierOption>()->IsErroneous()); - } - return GetDexMethodIndexUnchecked(); -} - inline ObjPtr<mirror::Class> ArtMethod::LookupResolvedClassFromTypeIndex(dex::TypeIndex type_idx) { ScopedAssertNoThreadSuspension ants(__FUNCTION__); ObjPtr<mirror::Class> type = @@ -196,14 +180,7 @@ inline const char* ArtMethod::GetShorty() { 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() { @@ -329,7 +306,7 @@ inline mirror::ClassLoader* ArtMethod::GetClassLoader() { template <ReadBarrierOption kReadBarrierOption> inline mirror::DexCache* ArtMethod::GetDexCache() { - if (LIKELY(!IsObsolete<kReadBarrierOption>())) { + if (LIKELY(!IsObsolete())) { ObjPtr<mirror::Class> klass = GetDeclaringClass<kReadBarrierOption>(); return klass->GetDexCache<kDefaultVerifyFlags, kReadBarrierOption>(); } else { @@ -382,12 +359,12 @@ inline ObjPtr<mirror::Class> ArtMethod::ResolveReturnType() { template <ReadBarrierOption kReadBarrierOption> inline bool ArtMethod::HasSingleImplementation() { - if (IsFinal<kReadBarrierOption>() || GetDeclaringClass<kReadBarrierOption>()->IsFinal()) { + if (IsFinal() || GetDeclaringClass<kReadBarrierOption>()->IsFinal()) { // We don't set kAccSingleImplementation for these cases since intrinsic // can use the flag also. return true; } - return (GetAccessFlags<kReadBarrierOption>() & kAccSingleImplementation) != 0; + return (GetAccessFlags() & kAccSingleImplementation) != 0; } inline HiddenApiAccessFlags::ApiList ArtMethod::GetHiddenApiAccessFlags() @@ -529,9 +506,9 @@ inline void ArtMethod::UpdateObjectsForImageRelocation(const Visitor& visitor) { } } -template <ReadBarrierOption kReadBarrierOption, typename Visitor> +template <typename Visitor> inline void ArtMethod::UpdateEntrypoints(const Visitor& visitor, PointerSize pointer_size) { - if (IsNative<kReadBarrierOption>()) { + if (IsNative()) { const void* old_native_code = GetEntryPointFromJniPtrSize(pointer_size); const void* new_native_code = visitor(old_native_code); if (old_native_code != new_native_code) { |