From 87170e764119d23caf5f0b319f8bf2ab6b4e974b Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Sun, 7 Feb 2016 12:48:28 +0000 Subject: [PATCH] Always visit ProfilingInfo, the counter could be reset. The counter could be reset or overflow, but we may have inline caches populated. bug:26775558 (cherry picked from commit ef404468d727332b088e6d461d0cf2f0ce0a897a) Change-Id: Ib0cc8da05aa75d50c0474a1ddcb88cd60ae34707 --- runtime/art_method-inl.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h index 28540c843..cc45c385b 100644 --- a/runtime/art_method-inl.h +++ b/runtime/art_method-inl.h @@ -463,9 +463,11 @@ void ArtMethod::VisitRoots(RootVisitorType& visitor, size_t pointer_size) { } visitor.VisitRootIfNonNull(declaring_class_.AddressWithoutBarrier()); - ProfilingInfo* profiling_info = GetProfilingInfo(pointer_size); - if (hotness_count_ != 0 && !IsNative() && profiling_info != nullptr) { - profiling_info->VisitRoots(visitor); + if (!IsNative()) { + ProfilingInfo* profiling_info = GetProfilingInfo(pointer_size); + if (profiling_info != nullptr) { + profiling_info->VisitRoots(visitor); + } } } -- 2.11.0