summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-09-15 17:55:06 -0700
committer Andreas Gampe <agampe@google.com> 2015-09-16 08:47:30 -0700
commit740667a1c5fa0188bb676c569064deb2c47c0825 (patch)
treebbfdc04e8f6a28ad8825f67dfabad6bc6094eeb3 /compiler/driver/compiler_driver.cc
parent1a1d77f7f8cdc892a59b1618b5bd8fea269354cb (diff)
ART: Skip compiler-driver compile loop for VerifyAtRuntime
We don't compile (not even dex-to-dex) anyways, so skip iterating over all methods. Shows a ~10% improvement of boot image compile time on Nexus 9. Shows a ~40% improvement for a common large app on the same device. Most of the remaining time is unzipping dex files. Bug: 24103765 Change-Id: I00931fd062a0a2297d1c7b90794302cb664571cc
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 4c1408a177..750e912da3 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -490,8 +490,18 @@ void CompilerDriver::CompileAll(jobject class_loader,
std::unique_ptr<ThreadPool> thread_pool(
new ThreadPool("Compiler driver thread pool", thread_count_ - 1));
VLOG(compiler) << "Before precompile " << GetMemoryUsageString(false);
+ // Precompile:
+ // 1) Load image classes
+ // 2) Resolve all classes
+ // 3) Attempt to verify all classes
+ // 4) Attempt to initialize image classes, and trivially initialized classes
PreCompile(class_loader, dex_files, thread_pool.get(), timings);
- Compile(class_loader, dex_files, thread_pool.get(), timings);
+ // Compile:
+ // 1) Compile all classes and methods enabled for compilation. May fall back to dex-to-dex
+ // compilation.
+ if (!GetCompilerOptions().VerifyAtRuntime()) {
+ Compile(class_loader, dex_files, thread_pool.get(), timings);
+ }
if (dump_stats_) {
stats_->Dump();
}