Skip to content

Commit 14cc870

Browse files
GodinEvgeny Mandrikov
authored andcommitted
8066774: Rename the annotations arrays names in ClassFileParser
Reviewed-by: shade, coleenp, dholmes
1 parent 0edf6c1 commit 14cc870

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,16 +3552,16 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
35523552
cfs->skip_u1(attribute_length, CHECK);
35533553
}
35543554
}
3555-
_annotations = assemble_annotations(runtime_visible_annotations,
3556-
runtime_visible_annotations_length,
3557-
runtime_invisible_annotations,
3558-
runtime_invisible_annotations_length,
3559-
CHECK);
3560-
_type_annotations = assemble_annotations(runtime_visible_type_annotations,
3561-
runtime_visible_type_annotations_length,
3562-
runtime_invisible_type_annotations,
3563-
runtime_invisible_type_annotations_length,
3564-
CHECK);
3555+
_class_annotations = assemble_annotations(runtime_visible_annotations,
3556+
runtime_visible_annotations_length,
3557+
runtime_invisible_annotations,
3558+
runtime_invisible_annotations_length,
3559+
CHECK);
3560+
_class_type_annotations = assemble_annotations(runtime_visible_type_annotations,
3561+
runtime_visible_type_annotations_length,
3562+
runtime_invisible_type_annotations,
3563+
runtime_invisible_type_annotations_length,
3564+
CHECK);
35653565

35663566
if (parsed_innerclasses_attribute || parsed_enclosingmethod_attribute) {
35673567
const u2 num_of_classes = parse_classfile_inner_classes_attribute(
@@ -3615,17 +3615,17 @@ void ClassFileParser::apply_parsed_class_attributes(InstanceKlass* k) {
36153615
// Create the Annotations object that will
36163616
// hold the annotations array for the Klass.
36173617
void ClassFileParser::create_combined_annotations(TRAPS) {
3618-
if (_annotations == NULL &&
3619-
_type_annotations == NULL &&
3618+
if (_class_annotations == NULL &&
3619+
_class_type_annotations == NULL &&
36203620
_fields_annotations == NULL &&
36213621
_fields_type_annotations == NULL) {
36223622
// Don't create the Annotations object unnecessarily.
36233623
return;
36243624
}
36253625

36263626
Annotations* const annotations = Annotations::allocate(_loader_data, CHECK);
3627-
annotations->set_class_annotations(_annotations);
3628-
annotations->set_class_type_annotations(_type_annotations);
3627+
annotations->set_class_annotations(_class_annotations);
3628+
annotations->set_class_type_annotations(_class_type_annotations);
36293629
annotations->set_fields_annotations(_fields_annotations);
36303630
annotations->set_fields_type_annotations(_fields_type_annotations);
36313631

@@ -3635,8 +3635,8 @@ void ClassFileParser::create_combined_annotations(TRAPS) {
36353635

36363636
// The annotations arrays below has been transfered the
36373637
// _combined_annotations so these fields can now be cleared.
3638-
_annotations = NULL;
3639-
_type_annotations = NULL;
3638+
_class_annotations = NULL;
3639+
_class_type_annotations = NULL;
36403640
_fields_annotations = NULL;
36413641
_fields_type_annotations = NULL;
36423642
}
@@ -5790,8 +5790,8 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
57905790
_local_interfaces(NULL),
57915791
_transitive_interfaces(NULL),
57925792
_combined_annotations(NULL),
5793-
_annotations(NULL),
5794-
_type_annotations(NULL),
5793+
_class_annotations(NULL),
5794+
_class_type_annotations(NULL),
57955795
_fields_annotations(NULL),
57965796
_fields_type_annotations(NULL),
57975797
_klass(NULL),
@@ -5895,7 +5895,7 @@ void ClassFileParser::clear_class_metadata() {
58955895
_nest_members = NULL;
58965896
_local_interfaces = NULL;
58975897
_combined_annotations = NULL;
5898-
_annotations = _type_annotations = NULL;
5898+
_class_annotations = _class_type_annotations = NULL;
58995899
_fields_annotations = _fields_type_annotations = NULL;
59005900
}
59015901

@@ -5937,15 +5937,15 @@ ClassFileParser::~ClassFileParser() {
59375937

59385938
// If the _combined_annotations pointer is non-NULL,
59395939
// then the other annotations fields should have been cleared.
5940-
assert(_annotations == NULL, "Should have been cleared");
5941-
assert(_type_annotations == NULL, "Should have been cleared");
5940+
assert(_class_annotations == NULL, "Should have been cleared");
5941+
assert(_class_type_annotations == NULL, "Should have been cleared");
59425942
assert(_fields_annotations == NULL, "Should have been cleared");
59435943
assert(_fields_type_annotations == NULL, "Should have been cleared");
59445944
} else {
59455945
// If the annotations arrays were not installed into the Annotations object,
59465946
// then they have to be deallocated explicitly.
5947-
MetadataFactory::free_array<u1>(_loader_data, _annotations);
5948-
MetadataFactory::free_array<u1>(_loader_data, _type_annotations);
5947+
MetadataFactory::free_array<u1>(_loader_data, _class_annotations);
5948+
MetadataFactory::free_array<u1>(_loader_data, _class_type_annotations);
59495949
Annotations::free_contents(_loader_data, _fields_annotations);
59505950
Annotations::free_contents(_loader_data, _fields_type_annotations);
59515951
}

src/hotspot/share/classfile/classFileParser.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ class ClassFileParser {
101101
Array<InstanceKlass*>* _local_interfaces;
102102
Array<InstanceKlass*>* _transitive_interfaces;
103103
Annotations* _combined_annotations;
104-
AnnotationArray* _annotations;
105-
AnnotationArray* _type_annotations;
104+
AnnotationArray* _class_annotations;
105+
AnnotationArray* _class_type_annotations;
106106
Array<AnnotationArray*>* _fields_annotations;
107107
Array<AnnotationArray*>* _fields_type_annotations;
108108
InstanceKlass* _klass; // InstanceKlass* once created.

0 commit comments

Comments
 (0)