summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Chang Xing <chxing@google.com> 2017-06-05 13:06:23 -0700
committer Chang Xing <chxing@google.com> 2017-06-05 18:10:03 -0700
commit8f987427cedef5d07783254ac16632ce02fd8f75 (patch)
tree1d89e4ad359f21469beb0f6e52721eea28292d94 /compiler/driver/compiler_driver.cc
parent4f101e5b6ae214a73bdd912374f5dc565d336e47 (diff)
Fixed installation time regression when compile.
Fixed the installation time regression problems happens at compilation time caused by the recursive initialization which blocked the fast-fail test for classes that can't be initialized during installation. Solved by ruling out this situation. Check for app image before resolving the dependencies, fall back to ordinary initialize process if profile does not exist. Bug: 62296843 Test: test-art-host -j64 Change-Id: I773406f11fd5dced8da5f0fe228b45d95eca936b
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 0097f55e53..93f678c64a 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2292,9 +2292,18 @@ class InitializeClassVisitor : public CompilationVisitor {
ObjectLock<mirror::Class> lock(soa.Self(), h_klass);
// Attempt to initialize allowing initialization of parent classes but still not static
// fields.
- bool is_superclass_initialized = InitializeDependencies(klass, class_loader, soa.Self());
- if (is_superclass_initialized) {
+ bool is_superclass_initialized = true;
+ if (!manager_->GetCompiler()->GetCompilerOptions().IsAppImage()) {
+ // If not an app image case, the compiler won't initialize too much things and do a fast
+ // fail, don't check dependencies.
manager_->GetClassLinker()->EnsureInitialized(soa.Self(), klass, false, true);
+ } else {
+ // For app images, do the initialization recursively and resolve types encountered to make
+ // sure the compiler runs without error.
+ is_superclass_initialized = InitializeDependencies(klass, class_loader, soa.Self());
+ if (is_superclass_initialized) {
+ manager_->GetClassLinker()->EnsureInitialized(soa.Self(), klass, false, true);
+ }
}
old_status = klass->GetStatus();
// If superclass cannot be initialized, no need to proceed.