diff options
| author | 2017-06-13 00:18:09 +0000 | |
|---|---|---|
| committer | 2017-06-13 00:18:11 +0000 | |
| commit | 16d59b2b0ff202be99cbe24830e8a5080b774357 (patch) | |
| tree | 6f3399a81626257ffd5cd777fff16f7ccce011a8 /compiler/driver/compiler_driver.cc | |
| parent | a7548fee6122f594c6669e1dcfd7b1637ef19a47 (diff) | |
| parent | fd37f1dafbc1c9763b8ea30855120d2c22062732 (diff) | |
Merge "Revert "Revert "Fixed installation time regression when compile."""
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 0d0769fe98..cd1f466f0f 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -2293,9 +2293,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. |