aboutsummaryrefslogtreecommitdiff
path: root/type_dex.h
diff options
context:
space:
mode:
authorCalder Kitagawa <ckitagawa@chromium.org>2018-06-12 14:37:39 +0000
committerEdward Lesmes <ehmaldonado@google.com>2021-07-23 22:51:37 +0000
commit1b25709592fb250dd0abeffbbae15206597ec3a2 (patch)
tree0d2f42efece59b5d55a3c66b82ab7a77c6c5aea6 /type_dex.h
parent6b80ac7f4fbd9558e55a335340c23d5d43bbec41 (diff)
downloadzucchini-1b25709592fb250dd0abeffbbae15206597ec3a2.tar.gz
[Zucchini]: Support DEX AnnotationsDirectoryItem
Adds support for AnnotationsDirectoryItem references. These take a similar form to variable length reference lists; however, the header for the list is not just the size of one list but rather three sublists and also contains a reference to class annotations within the header. The CL adds a parser for these items and a few types. The ReferenceReader is reused from the CachedItemListReferenceReader. There isn't a noticeable change in generation or apply time but the memory footprint can potentially be much larger as each annotation can produce on average a few offsets and there can be thousands of instances. Bug: 847571 Change-Id: I04afe4c6e35c66c0c9157ed3ac3e5bf338931f03 Reviewed-on: https://chromium-review.googlesource.com/1095645 Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org> Reviewed-by: agrieve <agrieve@chromium.org> Reviewed-by: Greg Thompson <grt@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#566420} NOKEYCHECK=True GitOrigin-RevId: 966646525b939a8fd52a993894bbb3822d9cb674
Diffstat (limited to 'type_dex.h')
-rw-r--r--type_dex.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/type_dex.h b/type_dex.h
index 508d331..432a031 100644
--- a/type_dex.h
+++ b/type_dex.h
@@ -227,6 +227,36 @@ struct AnnotationOffItem {
uint32_t annotation_off;
};
+// field_annotation
+struct FieldAnnotation {
+ uint32_t field_idx;
+ uint32_t annotations_off;
+};
+
+// method_annotation
+struct MethodAnnotation {
+ uint32_t method_idx;
+ uint32_t annotations_off;
+};
+
+// parameter_annotation
+struct ParameterAnnotation {
+ uint32_t method_idx;
+ uint32_t annotations_off;
+};
+
+// annotations_directory_item
+struct AnnotationsDirectoryItem {
+ uint32_t class_annotations_off;
+ uint32_t fields_size;
+ uint32_t annotated_methods_size;
+ uint32_t annotated_parameters_size;
+ // FieldAnnotation field_annotations[fields_size];
+ // MethodAnnotation method_annotations[annotated_methods_size];
+ // ParameterAnnotation parameter_annotations[annotated_parameters_size];
+ // All *Annotation are 8 bytes each.
+};
+
// try_item
struct TryItem {
uint32_t start_addr;