< prev index next >
src/hotspot/share/classfile/classFileParser.cpp
Print this page
@@ -2446,21 +2446,14 @@
CHECK_NULL);
}
parsed_code_attribute = true;
// Stack size, locals size, and code size
- if (_major_version == 45 && _minor_version <= 2) {
- cfs->guarantee_more(4, CHECK_NULL);
- max_stack = cfs->get_u1_fast();
- max_locals = cfs->get_u1_fast();
- code_length = cfs->get_u2_fast();
- } else {
cfs->guarantee_more(8, CHECK_NULL);
max_stack = cfs->get_u2_fast();
max_locals = cfs->get_u2_fast();
code_length = cfs->get_u4_fast();
- }
if (_need_verify) {
guarantee_property(args_size <= max_locals,
"Arguments can't fit into locals in class file %s",
CHECK_NULL);
guarantee_property(code_length > 0 && code_length <= MAX_CODE_SIZE,
@@ -2487,17 +2480,12 @@
cfs->guarantee_more(2, CHECK_NULL); // code_attributes_count
u2 code_attributes_count = cfs->get_u2_fast();
unsigned int calculated_attribute_length = 0;
- if (_major_version > 45 || (_major_version == 45 && _minor_version > 2)) {
calculated_attribute_length =
sizeof(max_stack) + sizeof(max_locals) + sizeof(code_length);
- } else {
- // max_stack, locals and length are smaller in pre-version 45.2 classes
- calculated_attribute_length = sizeof(u1) + sizeof(u1) + sizeof(u2);
- }
calculated_attribute_length +=
code_length +
sizeof(exception_table_length) +
sizeof(code_attributes_count) +
exception_table_length *
< prev index next >