2042 u2 max_locals = 0;
2043 u4 code_length = 0;
2044 u1* code_start = 0;
2045 u2 exception_table_length = 0;
2046 u2* exception_table_start = NULL;
2047 Array<int>* exception_handlers = Universe::the_empty_int_array();
2048 u2 checked_exceptions_length = 0;
2049 u2* checked_exceptions_start = NULL;
2050 CompressedLineNumberWriteStream* linenumber_table = NULL;
2051 int linenumber_table_length = 0;
2052 int total_lvt_length = 0;
2053 u2 lvt_cnt = 0;
2054 u2 lvtt_cnt = 0;
2055 bool lvt_allocated = false;
2056 u2 max_lvt_cnt = INITIAL_MAX_LVT_NUMBER;
2057 u2 max_lvtt_cnt = INITIAL_MAX_LVT_NUMBER;
2058 u2* localvariable_table_length;
2059 u2** localvariable_table_start;
2060 u2* localvariable_type_table_length;
2061 u2** localvariable_type_table_start;
2062 u2 method_parameters_length = 0;
2063 u1* method_parameters_data = NULL;
2064 bool method_parameters_seen = false;
2065 bool parsed_code_attribute = false;
2066 bool parsed_checked_exceptions_attribute = false;
2067 bool parsed_stackmap_attribute = false;
2068 // stackmap attribute - JDK1.5
2069 u1* stackmap_data = NULL;
2070 int stackmap_data_length = 0;
2071 u2 generic_signature_index = 0;
2072 MethodAnnotationCollector parsed_annotations;
2073 u1* runtime_visible_annotations = NULL;
2074 int runtime_visible_annotations_length = 0;
2075 u1* runtime_invisible_annotations = NULL;
2076 int runtime_invisible_annotations_length = 0;
2077 u1* runtime_visible_parameter_annotations = NULL;
2078 int runtime_visible_parameter_annotations_length = 0;
2079 u1* runtime_invisible_parameter_annotations = NULL;
2080 int runtime_invisible_parameter_annotations_length = 0;
2081 u1* runtime_visible_type_annotations = NULL;
2082 int runtime_visible_type_annotations_length = 0;
2261 guarantee_property(method_attribute_length == calculated_attribute_length,
2262 "Code segment has wrong length in class file %s", CHECK_(nullHandle));
2263 }
2264 } else if (method_attribute_name == vmSymbols::tag_exceptions()) {
2265 // Parse Exceptions attribute
2266 if (parsed_checked_exceptions_attribute) {
2267 classfile_parse_error("Multiple Exceptions attributes in class file %s", CHECK_(nullHandle));
2268 }
2269 parsed_checked_exceptions_attribute = true;
2270 checked_exceptions_start =
2271 parse_checked_exceptions(&checked_exceptions_length,
2272 method_attribute_length,
2273 CHECK_(nullHandle));
2274 } else if (method_attribute_name == vmSymbols::tag_method_parameters()) {
2275 // reject multiple method parameters
2276 if (method_parameters_seen) {
2277 classfile_parse_error("Multiple MethodParameters attributes in class file %s", CHECK_(nullHandle));
2278 }
2279 method_parameters_seen = true;
2280 method_parameters_length = cfs->get_u1_fast();
2281 if (method_attribute_length != (method_parameters_length * 4u) + 1u) {
2282 classfile_parse_error(
2283 "Invalid MethodParameters method attribute length %u in class file",
2284 method_attribute_length, CHECK_(nullHandle));
2285 }
2286 method_parameters_data = cfs->get_u1_buffer();
2287 cfs->skip_u2_fast(method_parameters_length);
2288 cfs->skip_u2_fast(method_parameters_length);
2289 // ignore this attribute if it cannot be reflected
2290 if (!SystemDictionary::Parameter_klass_loaded())
2291 method_parameters_length = 0;
2292 } else if (method_attribute_name == vmSymbols::tag_synthetic()) {
2293 if (method_attribute_length != 0) {
2294 classfile_parse_error(
2295 "Invalid Synthetic method attribute length %u in class file %s",
2296 method_attribute_length, CHECK_(nullHandle));
2297 }
2298 // Should we check that there hasn't already been a synthetic attribute?
2299 access_flags.set_is_synthetic();
2300 } else if (method_attribute_name == vmSymbols::tag_deprecated()) { // 4276120
2301 if (method_attribute_length != 0) {
2302 classfile_parse_error(
2303 "Invalid Deprecated method attribute length %u in class file %s",
2304 method_attribute_length, CHECK_(nullHandle));
2305 }
2306 } else if (_major_version >= JAVA_1_5_VERSION) {
2307 if (method_attribute_name == vmSymbols::tag_signature()) {
2308 if (method_attribute_length != 2) {
2309 classfile_parse_error(
2310 "Invalid Signature attribute length %u in class file %s",
2311 method_attribute_length, CHECK_(nullHandle));
|
2042 u2 max_locals = 0;
2043 u4 code_length = 0;
2044 u1* code_start = 0;
2045 u2 exception_table_length = 0;
2046 u2* exception_table_start = NULL;
2047 Array<int>* exception_handlers = Universe::the_empty_int_array();
2048 u2 checked_exceptions_length = 0;
2049 u2* checked_exceptions_start = NULL;
2050 CompressedLineNumberWriteStream* linenumber_table = NULL;
2051 int linenumber_table_length = 0;
2052 int total_lvt_length = 0;
2053 u2 lvt_cnt = 0;
2054 u2 lvtt_cnt = 0;
2055 bool lvt_allocated = false;
2056 u2 max_lvt_cnt = INITIAL_MAX_LVT_NUMBER;
2057 u2 max_lvtt_cnt = INITIAL_MAX_LVT_NUMBER;
2058 u2* localvariable_table_length;
2059 u2** localvariable_table_start;
2060 u2* localvariable_type_table_length;
2061 u2** localvariable_type_table_start;
2062 int method_parameters_length = -1;
2063 u1* method_parameters_data = NULL;
2064 bool method_parameters_seen = false;
2065 bool parsed_code_attribute = false;
2066 bool parsed_checked_exceptions_attribute = false;
2067 bool parsed_stackmap_attribute = false;
2068 // stackmap attribute - JDK1.5
2069 u1* stackmap_data = NULL;
2070 int stackmap_data_length = 0;
2071 u2 generic_signature_index = 0;
2072 MethodAnnotationCollector parsed_annotations;
2073 u1* runtime_visible_annotations = NULL;
2074 int runtime_visible_annotations_length = 0;
2075 u1* runtime_invisible_annotations = NULL;
2076 int runtime_invisible_annotations_length = 0;
2077 u1* runtime_visible_parameter_annotations = NULL;
2078 int runtime_visible_parameter_annotations_length = 0;
2079 u1* runtime_invisible_parameter_annotations = NULL;
2080 int runtime_invisible_parameter_annotations_length = 0;
2081 u1* runtime_visible_type_annotations = NULL;
2082 int runtime_visible_type_annotations_length = 0;
2261 guarantee_property(method_attribute_length == calculated_attribute_length,
2262 "Code segment has wrong length in class file %s", CHECK_(nullHandle));
2263 }
2264 } else if (method_attribute_name == vmSymbols::tag_exceptions()) {
2265 // Parse Exceptions attribute
2266 if (parsed_checked_exceptions_attribute) {
2267 classfile_parse_error("Multiple Exceptions attributes in class file %s", CHECK_(nullHandle));
2268 }
2269 parsed_checked_exceptions_attribute = true;
2270 checked_exceptions_start =
2271 parse_checked_exceptions(&checked_exceptions_length,
2272 method_attribute_length,
2273 CHECK_(nullHandle));
2274 } else if (method_attribute_name == vmSymbols::tag_method_parameters()) {
2275 // reject multiple method parameters
2276 if (method_parameters_seen) {
2277 classfile_parse_error("Multiple MethodParameters attributes in class file %s", CHECK_(nullHandle));
2278 }
2279 method_parameters_seen = true;
2280 method_parameters_length = cfs->get_u1_fast();
2281 const u2 real_length = (method_parameters_length * 4u) + 1u;
2282 if (method_attribute_length != real_length) {
2283 classfile_parse_error(
2284 "Invalid MethodParameters method attribute length %u in class file",
2285 method_attribute_length, CHECK_(nullHandle));
2286 }
2287 method_parameters_data = cfs->get_u1_buffer();
2288 cfs->skip_u2_fast(method_parameters_length);
2289 cfs->skip_u2_fast(method_parameters_length);
2290 // ignore this attribute if it cannot be reflected
2291 if (!SystemDictionary::Parameter_klass_loaded())
2292 method_parameters_length = -1;
2293 } else if (method_attribute_name == vmSymbols::tag_synthetic()) {
2294 if (method_attribute_length != 0) {
2295 classfile_parse_error(
2296 "Invalid Synthetic method attribute length %u in class file %s",
2297 method_attribute_length, CHECK_(nullHandle));
2298 }
2299 // Should we check that there hasn't already been a synthetic attribute?
2300 access_flags.set_is_synthetic();
2301 } else if (method_attribute_name == vmSymbols::tag_deprecated()) { // 4276120
2302 if (method_attribute_length != 0) {
2303 classfile_parse_error(
2304 "Invalid Deprecated method attribute length %u in class file %s",
2305 method_attribute_length, CHECK_(nullHandle));
2306 }
2307 } else if (_major_version >= JAVA_1_5_VERSION) {
2308 if (method_attribute_name == vmSymbols::tag_signature()) {
2309 if (method_attribute_length != 2) {
2310 classfile_parse_error(
2311 "Invalid Signature attribute length %u in class file %s",
2312 method_attribute_length, CHECK_(nullHandle));
|