summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2020-02-20 17:07:55 +0000
committerVladimir Marko <vmarko@google.com>2020-02-24 14:16:09 +0000
commitf639bf4c6b542553f727dc1a3262d9a4fd887fe5 (patch)
tree3f9b226a7a546665a7da18a375e48576251fcd53 /dex2oat/driver/compiler_driver.cc
parent26f7d102394748f8ec5f8c5342bf55e21bfb8ba5 (diff)
downloadart-f639bf4c6b542553f727dc1a3262d9a4fd887fe5.tar.gz
Avoid dex2dex initialization if not compiling.
Reduces the compilation time for the boot image extension in memory by ~0.1s. Also record timing for ImageWriter::PreloadDexCaches() and and fix naming for CompilerDriver::SetVerifiedDexFile() timing to not be confused with VerifyDexFile(). Test: aosp_taimen-userdebug boots; adb root && \ adb shell stop && \ adb shell setprop dalvik.vm.boot-image \ 'boot.art:/nonx/boot-framework.art!/system/etc/boot-image.prof' && \ adb shell 'setprop dalvik.vm.extra-opts \ "-Ximage-compiler-option --dump-timings"' && \ adb shell start # Starts correctly # Check dex2oat timing in logcat Bug: 119800099 Change-Id: I72d1916164906cab593c1437eeb4b3aa094b8493
Diffstat (limited to 'dex2oat/driver/compiler_driver.cc')
-rw-r--r--dex2oat/driver/compiler_driver.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc
index 525cfab231..6792a595a9 100644
--- a/dex2oat/driver/compiler_driver.cc
+++ b/dex2oat/driver/compiler_driver.cc
@@ -852,7 +852,11 @@ void CompilerDriver::PreCompile(jobject class_loader,
VLOG(compiler) << "Before precompile " << GetMemoryUsageString(false);
compiled_classes_.AddDexFiles(GetCompilerOptions().GetDexFilesForOatFile());
- dex_to_dex_compiler_.SetDexFiles(GetCompilerOptions().GetDexFilesForOatFile());
+
+ if (GetCompilerOptions().IsAnyCompilationEnabled()) {
+ TimingLogger::ScopedTiming t2("Dex2Dex SetDexFiles", timings);
+ dex_to_dex_compiler_.SetDexFiles(GetCompilerOptions().GetDexFilesForOatFile());
+ }
// Precompile:
// 1) Load image classes.
@@ -2093,7 +2097,7 @@ void CompilerDriver::SetVerifiedDexFile(jobject class_loader,
ThreadPool* thread_pool,
size_t thread_count,
TimingLogger* timings) {
- TimingLogger::ScopedTiming t("Verify Dex File", timings);
+ TimingLogger::ScopedTiming t("Set Verified Dex File", timings);
if (!compiled_classes_.HaveDexFile(&dex_file)) {
compiled_classes_.AddDexFile(&dex_file);
}