Only enable isolated compilation if requested
Isolated compilation saves memory but takes much longer,
so enable it only if requested.
Test: adb install
Bug: 190277710
Change-Id: Ia1bffb37ff25f80f7b6173fd42e6bd6ffff68e45
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 592182f..7ca0bf2 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1821,14 +1821,14 @@
}
bool ShouldCompileDexFilesIndividually() const {
- // Compile individually if we are specifically asked to, or
+ // Compile individually if we are allowed to, and
// 1. not building an image, and
// 2. not verifying a vdex file, and
// 3. using multidex, and
// 4. not doing any AOT compilation.
// This means extract, no-vdex verify, and quicken, will use the individual compilation
// mode (to reduce RAM used by the compiler).
- return compile_individually_ ||
+ return compile_individually_ &&
(!IsImage() && !update_input_vdex_ &&
compiler_options_->dex_files_for_oat_file_.size() > 1 &&
!CompilerFilter::IsAotCompilationEnabled(compiler_options_->GetCompilerFilter()));