summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2017-12-15 09:30:39 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-12-15 09:30:39 +0000
commitc8d910399cfd33550c497cc3e1e05b0396903234 (patch)
treee059185813d4d28e3cfed47d5cc1f844f0188bfc /compiler/driver/compiler_driver.cc
parent192cf6e300316d3fbbead115b1ca50ed3dc2f4b3 (diff)
parentae7e83817e546848ef6b2949dd9065b153e14316 (diff)
Merge "Don't embed the dex code in the oat file if dex is uncompressed."
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 0631c0f12c..1c65df8bb5 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -402,6 +402,12 @@ static optimizer::DexToDexCompilationLevel 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::DexToDexCompilationLevel::kDontDexToDexCompile;
+ }
auto* const runtime = Runtime::Current();
DCHECK(driver.GetCompilerOptions().IsQuickeningCompilationEnabled());
const char* descriptor = dex_file.GetClassDescriptor(class_def);