Mercurial > hg > truffle
comparison src/share/vm/classfile/classFileParser.cpp @ 18007:364b73402247
Merge
author | asaha |
---|---|
date | Thu, 22 May 2014 11:09:06 -0700 |
parents | b6a2ba7d3ea7 f0d759a6a230 |
children | f73af4455d7d |
comparison
equal
deleted
inserted
replaced
17920:382a82b0a3e7 | 18007:364b73402247 |
---|---|
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(); |
2768 | 2778 |
2769 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) { | 2779 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) { |
2770 ClassFileStream* cfs = stream(); | 2780 ClassFileStream* cfs = stream(); |
2771 u1* current_start = cfs->current(); | 2781 u1* current_start = cfs->current(); |
2772 | 2782 |
2773 cfs->guarantee_more(2, CHECK); // length | |
2774 int attribute_array_length = cfs->get_u2_fast(); | |
2775 | |
2776 guarantee_property(_max_bootstrap_specifier_index < attribute_array_length, | |
2777 "Short length on BootstrapMethods in class file %s", | |
2778 CHECK); | |
2779 | |
2780 guarantee_property(attribute_byte_length > sizeof(u2), | 2783 guarantee_property(attribute_byte_length > sizeof(u2), |
2781 "Invalid BootstrapMethods attribute length %u in class file %s", | 2784 "Invalid BootstrapMethods attribute length %u in class file %s", |
2782 attribute_byte_length, | 2785 attribute_byte_length, |
2786 CHECK); | |
2787 | |
2788 cfs->guarantee_more(attribute_byte_length, CHECK); | |
2789 | |
2790 int attribute_array_length = cfs->get_u2_fast(); | |
2791 | |
2792 guarantee_property(_max_bootstrap_specifier_index < attribute_array_length, | |
2793 "Short length on BootstrapMethods in class file %s", | |
2783 CHECK); | 2794 CHECK); |
2784 | 2795 |
2785 // The attribute contains a counted array of counted tuples of shorts, | 2796 // The attribute contains a counted array of counted tuples of shorts, |
2786 // represending bootstrap specifiers: | 2797 // represending bootstrap specifiers: |
2787 // length*{bootstrap_method_index, argument_count*{argument_index}} | 2798 // length*{bootstrap_method_index, argument_count*{argument_index}} |