summaryrefslogtreecommitdiff
path: root/runtime/mirror/class.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2017-01-31 08:58:55 -0800
committer Andreas Gampe <agampe@google.com> 2017-02-03 10:03:52 -0800
commit90b936ddda63139ff46a6755c3b83ad6e4ab4ac5 (patch)
treec7ce2c3004eecc16ab41ed7cde105c3019638d4b /runtime/mirror/class.cc
parentb78a8af993e877d74c5938f65f95feaf2fa01321 (diff)
ART: Refactor verify_object.h
Move the actual VerifyObject check into a new cc file, as we commonly don't enable the check at all. This allows to cut the -inl include from almost all current users. This also exposes missing -inl includes. Also fix up some of our old mess where .h defined functions require -inl.h defined functions. Test: m Change-Id: I3dd821bbe2015564a29bf1ed9be00f7a7276ad61
Diffstat (limited to 'runtime/mirror/class.cc')
-rw-r--r--runtime/mirror/class.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index f08d4daf95..1b8f3f83e7 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -1345,5 +1345,26 @@ std::string Class::PrettyClassAndClassLoader() {
return result;
}
+template<VerifyObjectFlags kVerifyFlags> void Class::GetAccessFlagsDCheck() {
+ // Check class is loaded/retired or this is java.lang.String that has a
+ // circularity issue during loading the names of its members
+ DCHECK(IsIdxLoaded<kVerifyFlags>() || IsRetired<kVerifyFlags>() ||
+ IsErroneous<static_cast<VerifyObjectFlags>(kVerifyFlags & ~kVerifyThis)>() ||
+ this == String::GetJavaLangString())
+ << "IsIdxLoaded=" << IsIdxLoaded<kVerifyFlags>()
+ << " IsRetired=" << IsRetired<kVerifyFlags>()
+ << " IsErroneous=" <<
+ IsErroneous<static_cast<VerifyObjectFlags>(kVerifyFlags & ~kVerifyThis)>()
+ << " IsString=" << (this == String::GetJavaLangString())
+ << " status= " << GetStatus<kVerifyFlags>()
+ << " descriptor=" << PrettyDescriptor();
+}
+// Instantiate the common cases.
+template void Class::GetAccessFlagsDCheck<kVerifyNone>();
+template void Class::GetAccessFlagsDCheck<kVerifyThis>();
+template void Class::GetAccessFlagsDCheck<kVerifyReads>();
+template void Class::GetAccessFlagsDCheck<kVerifyWrites>();
+template void Class::GetAccessFlagsDCheck<kVerifyAll>();
+
} // namespace mirror
} // namespace art