929 if (attribute_length != 2) { |
929 if (attribute_length != 2) { |
930 classfile_parse_error( |
930 classfile_parse_error( |
931 "Wrong size %u for field's Signature attribute in class file %s", |
931 "Wrong size %u for field's Signature attribute in class file %s", |
932 attribute_length, CHECK); |
932 attribute_length, CHECK); |
933 } |
933 } |
934 generic_signature_index = cfs->get_u2(CHECK); |
934 generic_signature_index = parse_generic_signature_attribute(CHECK); |
935 } else if (attribute_name == vmSymbols::tag_runtime_visible_annotations()) { |
935 } else if (attribute_name == vmSymbols::tag_runtime_visible_annotations()) { |
936 runtime_visible_annotations_length = attribute_length; |
936 runtime_visible_annotations_length = attribute_length; |
937 runtime_visible_annotations = cfs->get_u1_buffer(); |
937 runtime_visible_annotations = cfs->get_u1_buffer(); |
938 assert(runtime_visible_annotations != NULL, "null visible annotations"); |
938 assert(runtime_visible_annotations != NULL, "null visible annotations"); |
939 parse_annotations(runtime_visible_annotations, |
939 parse_annotations(runtime_visible_annotations, |
2303 if (method_attribute_length != 2) { |
2303 if (method_attribute_length != 2) { |
2304 classfile_parse_error( |
2304 classfile_parse_error( |
2305 "Invalid Signature attribute length %u in class file %s", |
2305 "Invalid Signature attribute length %u in class file %s", |
2306 method_attribute_length, CHECK_(nullHandle)); |
2306 method_attribute_length, CHECK_(nullHandle)); |
2307 } |
2307 } |
2308 cfs->guarantee_more(2, CHECK_(nullHandle)); // generic_signature_index |
2308 generic_signature_index = parse_generic_signature_attribute(CHECK_(nullHandle)); |
2309 generic_signature_index = cfs->get_u2_fast(); |
|
2310 } else if (method_attribute_name == vmSymbols::tag_runtime_visible_annotations()) { |
2309 } else if (method_attribute_name == vmSymbols::tag_runtime_visible_annotations()) { |
2311 runtime_visible_annotations_length = method_attribute_length; |
2310 runtime_visible_annotations_length = method_attribute_length; |
2312 runtime_visible_annotations = cfs->get_u1_buffer(); |
2311 runtime_visible_annotations = cfs->get_u1_buffer(); |
2313 assert(runtime_visible_annotations != NULL, "null visible annotations"); |
2312 assert(runtime_visible_annotations != NULL, "null visible annotations"); |
2314 parse_annotations(runtime_visible_annotations, |
2313 parse_annotations(runtime_visible_annotations, |
2614 } |
2613 } |
2615 } |
2614 } |
2616 return method_ordering; |
2615 return method_ordering; |
2617 } |
2616 } |
2618 |
2617 |
|
2618 // Parse generic_signature attribute for methods and fields |
|
2619 u2 ClassFileParser::parse_generic_signature_attribute(TRAPS) { |
|
2620 ClassFileStream* cfs = stream(); |
|
2621 cfs->guarantee_more(2, CHECK_0); // generic_signature_index |
|
2622 u2 generic_signature_index = cfs->get_u2_fast(); |
|
2623 check_property( |
|
2624 valid_symbol_at(generic_signature_index), |
|
2625 "Invalid Signature attribute at constant pool index %u in class file %s", |
|
2626 generic_signature_index, CHECK_0); |
|
2627 return generic_signature_index; |
|
2628 } |
2619 |
2629 |
2620 void ClassFileParser::parse_classfile_sourcefile_attribute(TRAPS) { |
2630 void ClassFileParser::parse_classfile_sourcefile_attribute(TRAPS) { |
2621 ClassFileStream* cfs = stream(); |
2631 ClassFileStream* cfs = stream(); |
2622 cfs->guarantee_more(2, CHECK); // sourcefile_index |
2632 cfs->guarantee_more(2, CHECK); // sourcefile_index |
2623 u2 sourcefile_index = cfs->get_u2_fast(); |
2633 u2 sourcefile_index = cfs->get_u2_fast(); |