runtime: Add -Xverify:softfail and ART_TEST_INTERPRETER_ACCESS_CHECKS
Use ART_TEST_INTERPRETER_ACCESS_CHECKS=true to run all the tests through
the interpreter with access checks enabled. The normal interpreter tests
do not currently enable access checks, which means that a large part of
the interpreter codebase is untested.
The verifier will force every class into a soft fail mode if
-Xverify:softfail is used, thereby ensuring that if used along with the
interpreter (-Xint) that the interpret is always in access checks mode.
This is used alongside with --compile-filter=verify-at-runtime to
prevent the AOT compiler from putting down any code.
Change-Id: I35a10ed8c43d76fa96133cf01fdad497da387200
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 3b0ca9e..c5aece5 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -185,7 +185,7 @@
system_class_loader_(nullptr),
dump_gc_performance_on_shutdown_(false),
preinitialization_transaction_(nullptr),
- verify_(false),
+ verify_(verifier::VerifyMode::kNone),
allow_dex_file_fallback_(true),
target_sdk_version_(0),
implicit_null_checks_(false),
@@ -1757,4 +1757,12 @@
imt_unimplemented_method_ = method;
}
+bool Runtime::IsVerificationEnabled() const {
+ return verify_ == verifier::VerifyMode::kEnable;
+}
+
+bool Runtime::IsVerificationSoftFail() const {
+ return verify_ == verifier::VerifyMode::kSoftFail;
+}
+
} // namespace art