OSDN Git Service

Always visit ProfilingInfo, the counter could be reset.
authorNicolas Geoffray <ngeoffray@google.com>
Sun, 7 Feb 2016 12:48:28 +0000 (12:48 +0000)
committerMathieu Chartier <mathieuc@google.com>
Wed, 10 Feb 2016 23:01:06 +0000 (15:01 -0800)
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

index 28540c8..cc45c38 100644 (file)
@@ -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);
+    }
   }
 }