ART: Add support for runtime debug checks
Add support for runtime-switchable debug flags. These flags are only
enabled in debug mode, and a constexpr false in release mode. This
allows to distinguish fast from slow checks, for example.
To simplify usage, two macros should be used. DECLARE_RUNTIME_DEBUG_FLAG
defines a static class member or constexpr as the flag. DEFINE_RUNTIME_DEBUG_FLAG
defines the static storage and registers it, if needed. See the
documentation in logging.h.
As is, runtime checks are disabled by default. Pass -XX:SlowDebug=true
to enable them on startup.
Add logging_test. Fix up tests and scripts to enable slow debug checks.
Bug: 35644369
Test: m test-art-host
Change-Id: Icc1cb0bb921d863514c55abef794c5c96f8af801
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index f925994..5a4a26a 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -404,6 +404,7 @@
options.push_back(std::make_pair("-Xcheck:jni", nullptr));
options.push_back(std::make_pair(min_heap_string, nullptr));
options.push_back(std::make_pair(max_heap_string, nullptr));
+ options.push_back(std::make_pair("-XX:SlowDebug=true", nullptr));
callbacks_.reset(new NoopCompilerCallbacks());