diff options
author | Andreas Gampe <agampe@google.com> | 2018-01-02 11:53:35 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2018-01-02 17:17:15 -0800 |
commit | 2a5d7283bba919eadb92ac311c1d563a14098ab5 (patch) | |
tree | 832ebaf8fe26cc8ccf0b738cc4547aed7493ffe8 /compiler/driver/compiler_options.cc | |
parent | e8f74caabfb6885ee5ad3a811222083877ca595e (diff) |
ART: Emit runtime read barrier checks only in slow-debug
Move runtime read barrier check emission to slow-debug to have
better control over when this instrumentation is done.
Bug: 35644369
Bug: 68025088
Test: m test-art-host
Test: manual inspection of core image code
Change-Id: I69b3b6f243c30813a741fe9e0a460f1543c6bc5d
Diffstat (limited to 'compiler/driver/compiler_options.cc')
-rw-r--r-- | compiler/driver/compiler_options.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index c0a9a05aa6..1780b1d7ed 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -20,6 +20,7 @@ #include "android-base/stringprintf.h" +#include "base/runtime_debug.h" #include "base/variant_map.h" #include "cmdline_parser.h" #include "compiler_options_map-inl.h" @@ -68,17 +69,16 @@ CompilerOptions::~CompilerOptions() { // because we don't want to include the PassManagerOptions definition from the header file. } +namespace { + +bool kEmitRuntimeReadBarrierChecks = kIsDebugBuild && + RegisterRuntimeDebugFlag(&kEmitRuntimeReadBarrierChecks); + +} // namespace + bool CompilerOptions::EmitRunTimeChecksInDebugMode() const { - // Run-time checks (e.g. Marking Register checks) are only emitted - // in debug mode, and - // - when running on device; or - // - when running on host, but only - // - when compiling the core image (which is used only for testing); or - // - when JIT compiling (only relevant for non-native methods). - // This is to prevent these checks from being emitted into pre-opted - // boot image or apps, as these are compiled with dex2oatd. - return kIsDebugBuild && - (kIsTargetBuild || IsCoreImage() || Runtime::Current()->UseJitCompilation()); + // Run-time checks (e.g. Marking Register checks) are only emitted in slow-debug mode. + return kEmitRuntimeReadBarrierChecks; } bool CompilerOptions::ParseDumpInitFailures(const std::string& option, std::string* error_msg) { |