bool DexCompilationUnit::RequiresConstructorBarrier() const { // Constructor barriers are applicable only for <init> methods.
DCHECK(!IsStatic());
DCHECK(IsConstructor());
// We require a constructor barrier if there are final instance fields. if (GetCompilingClass().GetReference() != nullptr && !GetCompilingClass().IsNull()) { // Decoding class data can be slow, so iterate over fields of the compiling class if resolved.
ScopedObjectAccess soa(Thread::Current());
ObjPtr<mirror::Class> compiling_class = GetCompilingClass().Get(); for (size_t i = 0, size = compiling_class->NumFields(); i != size; ++i) {
ArtField* field = compiling_class->GetField(i); if (field->IsFinal() && !field->IsStatic()) { returntrue;
}
}
} else { // Iterate over field definitions in the class data.
ClassAccessor accessor(*GetDexFile(), GetClassDefIndex()); for (const ClassAccessor::Field& field : accessor.GetInstanceFields()) { if (field.IsFinal()) { returntrue;
}
}
} returnfalse;
}
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.