From 5c803116e26ef40ad2a9c14d3411e21d149e0c9b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 13 Apr 2018 17:28:34 -0700 Subject: ART: Add profile-compile-check support Add --check-profiled-methods, which verifies that all methods mentioned in a profile for a guided compilation are actually compiled instead of being punted. As outcome it may log or abort dex2oat. TODO: Extend dex2oat_test Bug: 76145463 Test: mmma art Test: m test-art-host Change-Id: I956113b55796d0666db9dbfd387105a7d27b0868 --- compiler/driver/compiler_options.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'compiler/driver/compiler_options.h') diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 4a6bbfaae6..a760840b7f 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -43,6 +43,13 @@ class DexFile; enum class InstructionSet; class InstructionSetFeatures; +// Enum for CheckProfileMethodsCompiled. Outside CompilerOptions so it can be forward-declared. +enum class ProfileMethodsCheck : uint8_t { + kNone, + kLog, + kAbort, +}; + class CompilerOptions final { public: // Guide heuristics to determine whether to compile method if profile data not available. @@ -317,6 +324,10 @@ class CompilerOptions final { return resolve_startup_const_strings_; } + ProfileMethodsCheck CheckProfiledMethodsCompiled() const { + return check_profiled_methods_; + } + private: bool ParseDumpInitFailures(const std::string& option, std::string* error_msg); void ParseDumpCfgPasses(const StringPiece& option, UsageFn Usage); @@ -400,6 +411,10 @@ class CompilerOptions final { // profile. bool resolve_startup_const_strings_; + // When running profile-guided compilation, check that methods intended to be compiled end + // up compiled and are not punted. + ProfileMethodsCheck check_profiled_methods_; + RegisterAllocator::Strategy register_allocation_strategy_; // If not null, specifies optimization passes which will be run instead of defaults. -- cgit v1.2.3-59-g8ed1b