diff options
author | 2018-01-08 12:41:19 +0000 | |
---|---|---|
committer | 2018-01-23 14:38:35 +0000 | |
commit | f30752709e1131ae1a4c16f22cc7a0960c198e77 (patch) | |
tree | c671f0ac704f7a702fed77295a1d5fe690425394 /compiler/driver/compiler_driver.cc | |
parent | 2e1791b74406fba9930bbe5dfa5358d2d2c07e1a (diff) |
Revert "Revert "Don't embed the dex code in the oat file if dex is uncompressed.""
Bug: 63920015
Bug: 70854754
Test: oat_writer_test.cc, test.py
Revert was due to userdebug/user differences, which is fixed with:
https://googleplex-android-review.googlesource.com/#/c/platform/build/+/3434091/
This CL also fixes oatdump when the dex code is not in the .vdex file.
This reverts commit e166e67666bf4b23e4ed0a98f5e2bb3cae9cee7d.
Change-Id: Iec924be2ff8f03cf2ebe306e7a0018241f33beb0
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 27cfe19dda..60537fd5c8 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -384,6 +384,12 @@ static optimizer::DexToDexCompiler::CompilationLevel GetDexToDexCompilationLevel Thread* self, const CompilerDriver& driver, Handle<mirror::ClassLoader> class_loader, const DexFile& dex_file, const DexFile::ClassDef& class_def) REQUIRES_SHARED(Locks::mutator_lock_) { + // When the dex file is uncompressed in the APK, we do not generate a copy in the .vdex + // file. As a result, dex2oat will map the dex file read-only, and we only need to check + // that to know if we can do quickening. + if (dex_file.GetContainer() != nullptr && dex_file.GetContainer()->IsReadOnly()) { + return optimizer::DexToDexCompiler::CompilationLevel::kDontDexToDexCompile; + } auto* const runtime = Runtime::Current(); DCHECK(driver.GetCompilerOptions().IsQuickeningCompilationEnabled()); const char* descriptor = dex_file.GetClassDescriptor(class_def); |