summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2016-05-04 10:08:07 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-05-04 10:08:07 +0000
commit43aa3318f9ada1d2f3b99aa6a659685a99fc9c45 (patch)
tree2fcc82facf7f5cde81d0ebc7213c5e7bec320897
parentc5818f6e388781cb52551c48b6d9bd941b66e942 (diff)
parent022dd86f9c1fd63dfd7e052a876289387393a78f (diff)
Merge "Check if a class is verified before visiting profiling info."
-rw-r--r--runtime/art_method-inl.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index 6449efad78..7647ad6e57 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -456,13 +456,18 @@ void ArtMethod::VisitRoots(RootVisitorType& visitor, size_t pointer_size) {
interface_method->VisitRoots(visitor, pointer_size);
}
visitor.VisitRoot(declaring_class_.AddressWithoutBarrier());
- // Runtime methods and native methods use the same field as the profiling info for
- // storing their own data (jni entrypoint for native methods, and ImtConflictTable for
- // some runtime methods).
- if (!IsNative() && !IsRuntimeMethod()) {
- ProfilingInfo* profiling_info = GetProfilingInfo(pointer_size);
- if (profiling_info != nullptr) {
- profiling_info->VisitRoots(visitor);
+ // We know we don't have profiling information if the class hasn't been verified. Note
+ // that this check also ensures the IsNative call can be made, as IsNative expects a fully
+ // created class (and not a retired one).
+ if (klass->IsVerified()) {
+ // Runtime methods and native methods use the same field as the profiling info for
+ // storing their own data (jni entrypoint for native methods, and ImtConflictTable for
+ // some runtime methods).
+ if (!IsNative() && !IsRuntimeMethod()) {
+ ProfilingInfo* profiling_info = GetProfilingInfo(pointer_size);
+ if (profiling_info != nullptr) {
+ profiling_info->VisitRoots(visitor);
+ }
}
}
}