summaryrefslogtreecommitdiffstats
path: root/dex2oat/dex2oat.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2016-03-23 06:42:05 +0000
committerNicolas Geoffray <ngeoffray@google.com>2016-03-23 06:42:05 +0000
commit845e5064580bd37ad5014f7aa0d078be7265464d (patch)
tree1e621756ba6a1fd345f2fb468eed88cdc81886e7 /dex2oat/dex2oat.cc
parenta62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931 (diff)
downloadandroid_art-845e5064580bd37ad5014f7aa0d078be7265464d.tar.gz
android_art-845e5064580bd37ad5014f7aa0d078be7265464d.tar.bz2
android_art-845e5064580bd37ad5014f7aa0d078be7265464d.zip
Revert "Use compiler filter to determine oat file status."
Bots are red. Tentative reverting as this is likely the offender. Bug: 27689078 This reverts commit a62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931. Change-Id: I3ec6947a5a4be878ff81f26f17dc36a209734e2a
Diffstat (limited to 'dex2oat/dex2oat.cc')
-rw-r--r--dex2oat/dex2oat.cc42
1 files changed, 24 insertions, 18 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index ec6f96f599..ede0bdad6a 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -257,14 +257,11 @@ NO_RETURN static void Usage(const char* fmt, ...) {
"|verify-at-runtime"
"|verify-profile"
"|interpret-only"
- "|time"
- "|space-profile"
"|space"
"|balanced"
- "|speed-profile"
"|speed"
- "|everything-profile"
- "|everything):");
+ "|everything"
+ "|time):");
UsageError(" select compiler filter.");
UsageError(" verify-profile requires a --profile(-fd) to also be passed in.");
UsageError(" Example: --compiler-filter=everything");
@@ -801,6 +798,10 @@ class Dex2Oat FINAL {
Usage("Profile file should not be specified with both --profile-file-fd and --profile-file");
}
+ if (compiler_options_->VerifyOnlyProfile() && !have_profile_file && !have_profile_fd) {
+ Usage("verify-profile compiler filter must be used with a profile file or fd");
+ }
+
if (!parser_options->oat_symbols.empty()) {
oat_unstripped_ = std::move(parser_options->oat_symbols);
}
@@ -833,14 +834,14 @@ class Dex2Oat FINAL {
// time here, which is orthogonal to space.
if (compiler_options_->inline_depth_limit_ == CompilerOptions::kUnsetInlineDepthLimit) {
compiler_options_->inline_depth_limit_ =
- (compiler_options_->compiler_filter_ == CompilerFilter::kSpace)
+ (compiler_options_->compiler_filter_ == CompilerOptions::kSpace)
// Implementation of the space filter: limit inlining depth.
? CompilerOptions::kSpaceFilterInlineDepthLimit
: CompilerOptions::kDefaultInlineDepthLimit;
}
if (compiler_options_->inline_max_code_units_ == CompilerOptions::kUnsetInlineMaxCodeUnits) {
compiler_options_->inline_max_code_units_ =
- (compiler_options_->compiler_filter_ == CompilerFilter::kSpace)
+ (compiler_options_->compiler_filter_ == CompilerOptions::kSpace)
// Implementation of the space filter: limit inlining max code units.
? CompilerOptions::kSpaceFilterInlineMaxCodeUnits
: CompilerOptions::kDefaultInlineMaxCodeUnits;
@@ -1028,8 +1029,11 @@ class Dex2Oat FINAL {
key_value_store_->Put(
OatHeader::kNativeDebuggableKey,
compiler_options_->GetNativeDebuggable() ? OatHeader::kTrueValue : OatHeader::kFalseValue);
- key_value_store_->Put(OatHeader::kCompilerFilter,
- CompilerFilter::NameOfFilter(compiler_options_->GetCompilerFilter()));
+ if (compiler_options_->IsExtractOnly()) {
+ key_value_store_->Put(OatHeader::kCompilationType, OatHeader::kExtractOnlyValue);
+ } else if (UseProfileGuidedCompilation()) {
+ key_value_store_->Put(OatHeader::kCompilationType, OatHeader::kProfileGuideCompiledValue);
+ }
}
// Parse the arguments from the command line. In case of an unrecognized option or impossible
@@ -1318,7 +1322,13 @@ class Dex2Oat FINAL {
return false;
}
- if (CompilerFilter::DependsOnImageChecksum(compiler_options_->GetCompilerFilter())) {
+ if (compiler_options_->IsExtractOnly()) {
+ // ExtractOnly oat files only contain non-quickened DEX code and are
+ // therefore independent of the image file.
+ image_file_location_oat_checksum_ = 0u;
+ image_file_location_oat_data_begin_ = 0u;
+ image_patch_delta_ = 0;
+ } else {
TimingLogger::ScopedTiming t3("Loading image checksum", timings_);
std::vector<gc::space::ImageSpace*> image_spaces =
Runtime::Current()->GetHeap()->GetBootImageSpaces();
@@ -1335,10 +1345,6 @@ class Dex2Oat FINAL {
if (!image_file_location.empty()) {
key_value_store_->Put(OatHeader::kImageLocationKey, image_file_location);
}
- } else {
- image_file_location_oat_checksum_ = 0u;
- image_file_location_oat_data_begin_ = 0u;
- image_patch_delta_ = 0;
}
// Open dex files for class path.
@@ -1450,7 +1456,7 @@ class Dex2Oat FINAL {
num_methods += dex_file->NumMethodIds();
}
if (num_methods <= compiler_options_->GetNumDexMethodsThreshold()) {
- compiler_options_->SetCompilerFilter(CompilerFilter::kSpeed);
+ compiler_options_->SetCompilerFilter(CompilerOptions::kSpeed);
VLOG(compiler) << "Below method threshold, compiling anyways";
}
}
@@ -1851,7 +1857,7 @@ class Dex2Oat FINAL {
}
bool UseProfileGuidedCompilation() const {
- return CompilerFilter::DependsOnProfile(compiler_options_->GetCompilerFilter());
+ return !profile_file_.empty() || (profile_file_fd_ != kInvalidFd);
}
bool LoadProfile() {
@@ -1859,7 +1865,7 @@ class Dex2Oat FINAL {
profile_compilation_info_.reset(new ProfileCompilationInfo());
ScopedFlock flock;
- bool success = true;
+ bool success = false;
std::string error;
if (profile_file_fd_ != -1) {
// The file doesn't need to be flushed so don't check the usage.
@@ -1868,7 +1874,7 @@ class Dex2Oat FINAL {
if (flock.Init(&file, &error)) {
success = profile_compilation_info_->Load(profile_file_fd_);
}
- } else if (profile_file_ != "") {
+ } else {
if (flock.Init(profile_file_.c_str(), O_RDONLY, /* block */ true, &error)) {
success = profile_compilation_info_->Load(flock.GetFile()->Fd());
}