diff options
author | 2016-02-04 00:34:43 +0000 | |
---|---|---|
committer | 2016-02-04 00:34:43 +0000 | |
commit | 867d63b65f653d27dc7ea87e924f47148cec22a7 (patch) | |
tree | 2038bbb25fe121bdcf3653cc32211c6e2cb88936 /runtime/mirror/class.h | |
parent | 6006e2ce92fd86fdf028cd7b3afe972815b0e0f3 (diff) | |
parent | df707e406877e9c0426dd051c00933ebb331673e (diff) |
Merge "runtime: Don't skip verification for -Xverify:soft-fail"
Diffstat (limited to 'runtime/mirror/class.h')
-rw-r--r-- | runtime/mirror/class.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 1dae1946a8..79adfb65b1 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -287,14 +287,19 @@ class MANAGED Class FINAL : public Object { return (GetAccessFlags() & kAccSynthetic) != 0; } - // Returns true if the class can avoid access checks. - bool IsPreverified() SHARED_REQUIRES(Locks::mutator_lock_) { - return (GetAccessFlags() & kAccPreverified) != 0; + // Returns true if the class had run the verifier at least once. + // This does not necessarily mean that access checks are avoidable, + // since the class methods might still need to be run with access checks. + // If this bit returns false, then the methods are not to be trusted with skipping access checks. + bool WasVerificationAttempted() SHARED_REQUIRES(Locks::mutator_lock_) { + return (GetAccessFlags() & kAccSkipAccessChecks) != 0; } - void SetPreverified() SHARED_REQUIRES(Locks::mutator_lock_) { + // Mark the class as having gone through a verification attempt. + // Mutually exclusive from whether or not each method is allowed to skip access checks. + void SetVerificationAttempted() SHARED_REQUIRES(Locks::mutator_lock_) { uint32_t flags = GetField32(OFFSET_OF_OBJECT_MEMBER(Class, access_flags_)); - SetAccessFlags(flags | kAccPreverified); + SetAccessFlags(flags | kAccVerificationAttempted); } template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags> @@ -1136,8 +1141,8 @@ class MANAGED Class FINAL : public Object { void VisitNativeRoots(Visitor& visitor, size_t pointer_size) SHARED_REQUIRES(Locks::mutator_lock_); - // When class is verified, set the kAccPreverified flag on each method. - void SetPreverifiedFlagOnAllMethods(size_t pointer_size) + // When class is verified, set the kAccSkipAccessChecks flag on each method. + void SetSkipAccessChecksFlagOnAllMethods(size_t pointer_size) SHARED_REQUIRES(Locks::mutator_lock_); // Get the descriptor of the class. In a few cases a std::string is required, rather than |