diff options
| author | 2017-08-11 10:26:39 +0000 | |
|---|---|---|
| committer | 2017-08-11 10:26:39 +0000 | |
| commit | 54636c0e85ad1bcd5798324c0484122364e99298 (patch) | |
| tree | 6ec47505bdb6dd232cf43b86eb9d2c438d2f052f /compiler/driver/compiler_options.cc | |
| parent | abafaf83838301b83832c33324d683e7f77aff76 (diff) | |
| parent | 2b03a1f24600c8c9558fb13d3f8bca1ef0f8ee40 (diff) | |
Merge "Instrument ARM64 generated code to check the Marking Register."
Diffstat (limited to 'compiler/driver/compiler_options.cc')
| -rw-r--r-- | compiler/driver/compiler_options.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index 3cacc2cad7..538845de19 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -18,6 +18,8 @@ #include <fstream> +#include "runtime.h" + namespace art { CompilerOptions::CompilerOptions() @@ -30,6 +32,7 @@ CompilerOptions::CompilerOptions() inline_max_code_units_(kUnsetInlineMaxCodeUnits), no_inline_from_(nullptr), boot_image_(false), + core_image_(false), app_image_(false), top_k_profile_threshold_(kDefaultTopKProfileThreshold), debuggable_(false), @@ -55,6 +58,19 @@ CompilerOptions::~CompilerOptions() { // because we don't want to include the PassManagerOptions definition from the header file. } +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()); +} + void CompilerOptions::ParseHugeMethodMax(const StringPiece& option, UsageFn Usage) { ParseUintOption(option, "--huge-method-max", &huge_method_threshold_, Usage); } |