Always visit ProfilingInfo, the counter could be reset.
The counter could be reset or overflow, but we may have
inline caches populated.
bug:26775558
Change-Id: I0566b6b4a7bf8dfb3411492c0413eafbf39da7c3
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 28540c8..cc45c38 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -463,9 +463,11 @@
}
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);
+ }
}
}