2760 ClassFileStream* cfs = stream();
2761 u2 signature_index = cfs->get_u2(CHECK);
2762 check_property(
2763 valid_symbol_at(signature_index),
2764 "Invalid constant pool index %u in Signature attribute in class file %s",
2765 signature_index, CHECK);
2766 set_class_generic_signature_index(signature_index);
2767 }
2768
2769 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) {
2770 ClassFileStream* cfs = stream();
2771 u1* current_start = cfs->current();
2772
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),
2781 "Invalid BootstrapMethods attribute length %u in class file %s",
2782 attribute_byte_length,
2783 CHECK);
2784
2785 // The attribute contains a counted array of counted tuples of shorts,
2786 // represending bootstrap specifiers:
2787 // length*{bootstrap_method_index, argument_count*{argument_index}}
2788 int operand_count = (attribute_byte_length - sizeof(u2)) / sizeof(u2);
2789 // operand_count = number of shorts in attr, except for leading length
2790
2791 // The attribute is copied into a short[] array.
2792 // The array begins with a series of short[2] pairs, one for each tuple.
2793 int index_size = (attribute_array_length * 2);
2794
2795 Array<u2>* operands = MetadataFactory::new_array<u2>(_loader_data, index_size + operand_count, CHECK);
2796
2797 // Eagerly assign operands so they will be deallocated with the constant
2798 // pool if there is an error.
2799 _cp->set_operands(operands);
2800
|
2760 ClassFileStream* cfs = stream();
2761 u2 signature_index = cfs->get_u2(CHECK);
2762 check_property(
2763 valid_symbol_at(signature_index),
2764 "Invalid constant pool index %u in Signature attribute in class file %s",
2765 signature_index, CHECK);
2766 set_class_generic_signature_index(signature_index);
2767 }
2768
2769 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) {
2770 ClassFileStream* cfs = stream();
2771 u1* current_start = cfs->current();
2772
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),
2781 "Invalid BootstrapMethods attribute length %u in class file %s",
2782 attribute_byte_length,
2783 CHECK);
2784
2785 // The attribute contains a counted array of counted tuples of shorts,
2786 // represending bootstrap specifiers:
2787 // length*{bootstrap_method_index, argument_count*{argument_index}}
2788 int operand_count = (attribute_byte_length - sizeof(u2)) / sizeof(u2);
2789 // operand_count = number of shorts in attr, except for leading length
2790
2791 // The attribute is copied into a short[] array.
2792 // The array begins with a series of short[2] pairs, one for each tuple.
2793 int index_size = (attribute_array_length * 2);
2794
2795 Array<u2>* operands = MetadataFactory::new_array<u2>(_loader_data, index_size + operand_count, CHECK);
2796
2797 // Eagerly assign operands so they will be deallocated with the constant
2798 // pool if there is an error.
2799 _cp->set_operands(operands);
2800
|