summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2023-03-17 08:20:33 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2023-03-17 17:24:25 +0000
commit4b9b4025d35a1e65c9c564ef814b76632fddad13 (patch)
tree55038d60c571f8051a0c7e2b81352db50b5e3687 /dex2oat/driver/compiler_driver.cc
parent240c51b114bedf1ec03f40fb87d6301fd1ea2ab9 (diff)
Only special case boot image extension for class initialization.
Special case for the mainline extension, which didn't use to get its classes initialized. Bug: 274077782 Test: test.py Change-Id: I1bb92d262c8bedb0ffefd5fa322fa8155d10ceb7
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