summaryrefslogtreecommitdiff
path: root/runtime/verifier/method_verifier.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2019-06-27 14:05:52 -0700
committer Andreas Gampe <agampe@google.com> 2019-06-29 00:58:23 +0000
commit43884b23d61dd9c2754ef4e716458f8306b07b94 (patch)
tree5466067e89d3d3d81e069abb43b93118ca5a48bf /runtime/verifier/method_verifier.h
parentf68b698e4774275e87bc73fa916faca4c6b11744 (diff)
ART: Coalesce verifier flags into bit struct
Makes it easier to add flags without increasing size or changing padding. Bug: 121245951 Test: m test-art-host Change-Id: I26d0491fb7eb26e441874188a8db9f276ce1aaf8
Diffstat (limited to 'runtime/verifier/method_verifier.h')
-rw-r--r--runtime/verifier/method_verifier.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index bd320ce2a2..e3d0901d3f 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -184,7 +184,7 @@ class MethodVerifier {
bool HasCheckCasts() const;
bool HasFailures() const;
bool HasInstructionThatWillThrow() const {
- return have_any_pending_runtime_throw_failure_;
+ return flags_.have_any_pending_runtime_throw_failure_;
}
virtual const RegType& ResolveCheckedClass(dex::TypeIndex class_idx)
@@ -315,19 +315,24 @@ class MethodVerifier {
std::vector<VerifyError> failures_;
// Error messages associated with failures.
std::vector<std::ostringstream*> failure_messages_;
- // Is there a pending hard failure?
- bool have_pending_hard_failure_;
- // Is there a pending runtime throw failure? A runtime throw failure is when an instruction
- // would fail at runtime throwing an exception. Such an instruction causes the following code
- // to be unreachable. This is set by Fail and used to ensure we don't process unreachable
- // instructions that would hard fail the verification.
- // Note: this flag is reset after processing each instruction.
- bool have_pending_runtime_throw_failure_;
- // Is there a pending experimental failure?
- bool have_pending_experimental_failure_;
-
- // A version of the above that is not reset and thus captures if there were *any* throw failures.
- bool have_any_pending_runtime_throw_failure_;
+ struct {
+ // Is there a pending hard failure?
+ bool have_pending_hard_failure_ : 1;
+
+ // Is there a pending runtime throw failure? A runtime throw failure is when an instruction
+ // would fail at runtime throwing an exception. Such an instruction causes the following code
+ // to be unreachable. This is set by Fail and used to ensure we don't process unreachable
+ // instructions that would hard fail the verification.
+ // Note: this flag is reset after processing each instruction.
+ bool have_pending_runtime_throw_failure_ : 1;
+
+ // Is there a pending experimental failure?
+ bool have_pending_experimental_failure_ : 1;
+
+ // A version of the above that is not reset and thus captures if there were *any* throw
+ // failures.
+ bool have_any_pending_runtime_throw_failure_ : 1;
+ } flags_;
// Info message log use primarily for verifier diagnostics.
std::ostringstream info_messages_;