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)
committerNicolas Geoffray <ngeoffray@google.com>
Sun, 7 Feb 2016 12:48:28 +0000 (12:48 +0000)
The counter could be reset or overflow, but we may have
inline caches populated.

bug:26775558
Change-Id: I0566b6b4a7bf8dfb3411492c0413eafbf39da7c3

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);
+    }
   }
 }