// Method annotations.
ObjPtr<mirror::Object> GetAnnotationDefaultValue(ArtMethod* method)
REQUIRES_SHARED(Locks::mutator_lock_);
ObjPtr<mirror::Object> GetAnnotationForMethod(ArtMethod* method,
Handle<mirror::Class> annotation_class)
REQUIRES_SHARED(Locks::mutator_lock_);
ObjPtr<mirror::ObjectArray<mirror::Object>> GetAnnotationsForMethod(ArtMethod* method)
REQUIRES_SHARED(Locks::mutator_lock_);
ObjPtr<mirror::ObjectArray<mirror::Class>> GetExceptionTypesForMethod(ArtMethod* method)
REQUIRES_SHARED(Locks::mutator_lock_);
ObjPtr<mirror::ObjectArray<mirror::Object>> GetParameterAnnotations(ArtMethod* method)
REQUIRES_SHARED(Locks::mutator_lock_);
uint32_t GetNumberOfAnnotatedMethodParameters(ArtMethod* method)
REQUIRES_SHARED(Locks::mutator_lock_);
ObjPtr<mirror::Object> GetAnnotationForMethodParameter(ArtMethod* method,
uint32_t parameter_idx,
Handle<mirror::Class> annotation_class)
REQUIRES_SHARED(Locks::mutator_lock_); bool GetParametersMetadataForMethod(
ArtMethod* method, /*out*/ MutableHandle<mirror::ObjectArray<mirror::String>>* names, /*out*/ MutableHandle<mirror::IntArray>* access_flags) REQUIRES_SHARED(Locks::mutator_lock_);
EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForMethod(
ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_); // Check whether `method` is annotated with `annotation_class`. // If `lookup_in_resolved_boot_classes` is true, look up any of the // method's annotations' classes in the bootstrap class loader's // resolved types; if it is false (default value), resolve them as a // side effect. bool IsMethodAnnotationPresent(ArtMethod* method,
Handle<mirror::Class> annotation_class,
DexFile::DexVisibility visibility = DexFile::DexVisibility::kRuntime)
REQUIRES_SHARED(Locks::mutator_lock_);
// Check whether a method from the `dex_file` with the given `method_index` // is annotated with @dalvik.annotation.optimization.FastNative or // @dalvik.annotation.optimization.CriticalNative with build visibility. // If yes, return the associated access flags, i.e. kAccFastNative or kAccCriticalNative.
EXPORT uint32_t GetNativeMethodAnnotationAccessFlags(const DexFile& dex_file, const dex::ClassDef& class_def,
uint32_t method_index); // An overload of `GetNativeMethodAnnotationAccessFlags()` that takes a `MethodAnnotationsItem`.
uint32_t GetNativeMethodAnnotationAccessFlags(const DexFile& dex_file, const dex::MethodAnnotationsItem& method_annotations); // Is the method from the `dex_file` with the given `field_index` // annotated with @dalvik.annotation.optimization.NeverCompile?
EXPORT bool MethodIsNeverCompile(const DexFile& dex_file, const dex::ClassDef& class_def,
uint32_t method_index); // An overload of `MethodIsNeverCompile()` that takes a `MethodAnnotationsItem`. bool MethodIsNeverCompile(const DexFile& dex_file, const dex::MethodAnnotationsItem& method_annotations); // Is the method from the `dex_file` with the given `field_index` // annotated with @dalvik.annotation.optimization.NeverInline? bool MethodIsNeverInline(const DexFile& dex_file, const dex::ClassDef& class_def,
uint32_t method_index); // Is the field from the `dex_file` with the given `field_index` // annotated with @dalvik.annotation.optimization.ReachabilitySensitive? bool FieldIsReachabilitySensitive(const DexFile& dex_file, const dex::ClassDef& class_def,
uint32_t field_index); // Is the method from the `dex_file` with the given `method_index` // annotated with @dalvik.annotation.optimization.ReachabilitySensitive? bool MethodIsReachabilitySensitive(const DexFile& dex_file, const dex::ClassDef& class_def,
uint32_t method_index); // Does the method from the `dex_file` with the given `method_index` contain an access to a field // annotated with @dalvik.annotation.optimization.ReachabilitySensitive, or a call to a method // with that annotation? // Class_def is the class defining the method. We consider only accessses to classes or methods // declared in the static type of the corresponding object. We may overlook accesses to annotated // fields or methods that are in neither class_def nor a containing (outer) class. bool MethodContainsRSensitiveAccess(const DexFile& dex_file, const dex::ClassDef& class_def,
uint32_t method_index); // Is the given class annotated with @dalvik.annotation.optimization.DeadReferenceSafe? bool HasDeadReferenceSafeAnnotation(const DexFile& dex_file, const dex::ClassDef& class_def);
// Map back from a PC to the line number in a method.
int32_t GetLineNumFromPC(const DexFile* dex_file, ArtMethod* method, uint32_t rel_pc)
REQUIRES_SHARED(Locks::mutator_lock_);
// Annotations iterator. class RuntimeEncodedStaticFieldValueIterator : public EncodedStaticFieldValueIterator { public: // A constructor meant to be called from runtime code.
RuntimeEncodedStaticFieldValueIterator(Handle<mirror::DexCache> dex_cache,
Handle<mirror::ClassLoader> class_loader,
ClassLinker* linker, const dex::ClassDef& class_def)
REQUIRES_SHARED(Locks::mutator_lock_)
: EncodedStaticFieldValueIterator(*dex_cache->GetDexFile(), class_def),
dex_cache_(dex_cache),
class_loader_(class_loader),
linker_(linker) {
}
protected: // Whether we found an error while visiting the annotations. If true, `error_msg_` will contain // the information about the error. bool has_error_ = false;
std::string error_msg_;
};
// Visit all annotation elements and array elements without creating // Arrays or Objects in the managed heap. void VisitClassAnnotations(Handle<mirror::Class> klass, AnnotationVisitor* visitor)
REQUIRES_SHARED(Locks::mutator_lock_);
} // namespace annotations
} // namespace art
#endif// ART_RUNTIME_DEX_DEX_FILE_ANNOTATIONS_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 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.