summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dex2oat/driver/compiler_driver.cc')
-rw-r--r--dex2oat/driver/compiler_driver.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc
index 3ad696b125..23bbe14efe 100644
--- a/dex2oat/driver/compiler_driver.cc
+++ b/dex2oat/driver/compiler_driver.cc
@@ -2179,13 +2179,16 @@ class InitializeClassVisitor : public CompilationVisitor {
bool too_many_encoded_fields = (!is_boot_image && !is_boot_image_extension) &&
klass->NumStaticFields() > kMaxEncodedFields;
+ bool have_profile = (compiler_options.GetProfileCompilationInfo() != nullptr) &&
+ !compiler_options.GetProfileCompilationInfo()->IsEmpty();
// If the class was not initialized, we can proceed to see if we can initialize static
// fields. Limit the max number of encoded fields.
if (!klass->IsInitialized() &&
(is_app_image || is_boot_image || is_boot_image_extension) &&
try_initialize_with_superclasses && !too_many_encoded_fields &&
compiler_options.IsImageClass(descriptor) &&
- compiler_options.IsAotCompilationEnabled()) {
+ // TODO(b/274077782): remove this test.
+ (have_profile || !is_boot_image_extension)) {
bool can_init_static_fields = false;
if (is_boot_image || is_boot_image_extension) {
// We need to initialize static fields, we only do this for image classes that aren't