summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2024-11-28 16:28:04 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2025-01-16 11:36:58 +0000
commit990cf07523a5c6ae437a0bd0cc80fb63320def5e (patch)
tree7d7160e014b14368c6cd8dcfcbfe9e2996f19e51 /dex2oat/driver/compiler_driver.cc
parentae13bd8a14183069642a5eed4793cf34f5a2eadc (diff)
Merge sFields and iFields.
Test: test.py Change-Id: Ib97fca637a8866a41a4389b150c6000d9fb6d99b
Diffstat (limited to 'dex2oat/driver/compiler_driver.cc')
-rw-r--r--dex2oat/driver/compiler_driver.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc
index bbb70e4ef1..fc2d94a342 100644
--- a/dex2oat/driver/compiler_driver.cc
+++ b/dex2oat/driver/compiler_driver.cc
@@ -1404,10 +1404,9 @@ class ClinitImageUpdate {
} else if (can_include_in_image) {
// Check whether the class is initialized and has a clinit or static fields.
// Such classes must be kept too.
- if (klass->IsInitialized()) {
+ if (klass->IsInitialized() && !klass->IsArrayClass()) {
PointerSize pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
- if (klass->FindClassInitializer(pointer_size) != nullptr ||
- klass->NumStaticFields() != 0) {
+ if (klass->FindClassInitializer(pointer_size) != nullptr || klass->HasStaticFields()) {
DCHECK(!Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass->GetDexCache()))
<< klass->PrettyDescriptor();
data_->image_classes_.push_back(data_->hs_.NewHandle(klass));
@@ -2275,8 +2274,9 @@ class InitializeClassVisitor : public CompilationVisitor {
// cannot be initialized, no need to proceed.
old_status = klass->GetStatus();
+ ClassAccessor accessor(klass->GetDexFile(), klass->GetDexClassDefIndex());
bool too_many_encoded_fields = (!is_boot_image && !is_boot_image_extension) &&
- klass->NumStaticFields() > kMaxEncodedFields;
+ accessor.NumStaticFields() > kMaxEncodedFields;
bool have_profile = (compiler_options.GetProfileCompilationInfo() != nullptr) &&
!compiler_options.GetProfileCompilationInfo()->IsEmpty();