< prev index next >
src/hotspot/share/classfile/classFileParser.cpp
Print this page
*** 663,673 ****
sig_index, CHECK);
guarantee_property(name->utf8_length() != 0,
"Illegal zero length constant pool entry at %d in class %s",
name_index, CHECK);
! if (sig->char_at(0) == JVM_SIGNATURE_FUNC) {
// Format check method name and signature
verify_legal_method_name(name, CHECK);
verify_legal_method_signature(name, sig, CHECK);
} else {
// Format check field name and signature
--- 663,673 ----
sig_index, CHECK);
guarantee_property(name->utf8_length() != 0,
"Illegal zero length constant pool entry at %d in class %s",
name_index, CHECK);
! if (Signature::is_method(sig)) {
// Format check method name and signature
verify_legal_method_name(name, CHECK);
verify_legal_method_signature(name, sig, CHECK);
} else {
// Format check field name and signature
*** 688,700 ****
cp->signature_ref_index_at(name_and_type_ref_index);
const Symbol* const name = cp->symbol_at(name_ref_index);
const Symbol* const signature = cp->symbol_at(signature_ref_index);
if (_need_verify) {
// CONSTANT_Dynamic's name and signature are verified above, when iterating NameAndType_info.
! // Need only to be sure signature is non-zero length and the right type.
! if (signature->utf8_length() == 0 ||
! signature->char_at(0) == JVM_SIGNATURE_FUNC) {
throwIllegalSignature("CONSTANT_Dynamic", name, signature, CHECK);
}
}
break;
}
--- 688,699 ----
cp->signature_ref_index_at(name_and_type_ref_index);
const Symbol* const name = cp->symbol_at(name_ref_index);
const Symbol* const signature = cp->symbol_at(signature_ref_index);
if (_need_verify) {
// CONSTANT_Dynamic's name and signature are verified above, when iterating NameAndType_info.
! // Need only to be sure signature is the right type.
! if (Signature::is_method(signature)) {
throwIllegalSignature("CONSTANT_Dynamic", name, signature, CHECK);
}
}
break;
}
*** 714,734 ****
const Symbol* const signature = cp->symbol_at(signature_ref_index);
if (tag == JVM_CONSTANT_Fieldref) {
if (_need_verify) {
// Field name and signature are verified above, when iterating NameAndType_info.
// Need only to be sure signature is non-zero length and the right type.
! if (signature->utf8_length() == 0 ||
! signature->char_at(0) == JVM_SIGNATURE_FUNC) {
throwIllegalSignature("Field", name, signature, CHECK);
}
}
} else {
if (_need_verify) {
// Method name and signature are verified above, when iterating NameAndType_info.
// Need only to be sure signature is non-zero length and the right type.
! if (signature->utf8_length() == 0 ||
! signature->char_at(0) != JVM_SIGNATURE_FUNC) {
throwIllegalSignature("Method", name, signature, CHECK);
}
}
// 4509014: If a class method name begins with '<', it must be "<init>"
const unsigned int name_len = name->utf8_length();
--- 713,731 ----
const Symbol* const signature = cp->symbol_at(signature_ref_index);
if (tag == JVM_CONSTANT_Fieldref) {
if (_need_verify) {
// Field name and signature are verified above, when iterating NameAndType_info.
// Need only to be sure signature is non-zero length and the right type.
! if (Signature::is_method(signature)) {
throwIllegalSignature("Field", name, signature, CHECK);
}
}
} else {
if (_need_verify) {
// Method name and signature are verified above, when iterating NameAndType_info.
// Need only to be sure signature is non-zero length and the right type.
! if (!Signature::is_method(signature)) {
throwIllegalSignature("Method", name, signature, CHECK);
}
}
// 4509014: If a class method name begins with '<', it must be "<init>"
const unsigned int name_len = name->utf8_length();
*** 1721,1731 ****
field->initialize(JVM_ACC_FIELD_INTERNAL,
injected[n].name_index,
injected[n].signature_index,
0);
! const BasicType type = FieldType::basic_type(injected[n].signature());
// Remember how many oops we encountered and compute allocation type
const FieldAllocationType atype = fac->update(false, type);
field->set_allocation_type(atype);
index++;
--- 1718,1728 ----
field->initialize(JVM_ACC_FIELD_INTERNAL,
injected[n].name_index,
injected[n].signature_index,
0);
! const BasicType type = Signature::basic_type(injected[n].signature());
// Remember how many oops we encountered and compute allocation type
const FieldAllocationType atype = fac->update(false, type);
field->set_allocation_type(atype);
index++;
*** 2794,2818 ****
// Fill in information from fixed part (access_flags already set)
m->set_constants(_cp);
m->set_name_index(name_index);
m->set_signature_index(signature_index);
!
! ResultTypeFinder rtf(cp->symbol_at(signature_index));
! m->constMethod()->set_result_type(rtf.type());
!
! if (args_size >= 0) {
! m->set_size_of_parameters(args_size);
! } else {
! m->compute_size_of_parameters(THREAD);
! }
! #ifdef ASSERT
! if (args_size >= 0) {
! m->compute_size_of_parameters(THREAD);
! assert(args_size == m->size_of_parameters(), "");
! }
! #endif
// Fill in code attribute information
m->set_max_stack(max_stack);
m->set_max_locals(max_locals);
if (stackmap_data != NULL) {
--- 2791,2802 ----
// Fill in information from fixed part (access_flags already set)
m->set_constants(_cp);
m->set_name_index(name_index);
m->set_signature_index(signature_index);
! m->compute_from_signature(cp->symbol_at(signature_index));
! assert(args_size < 0 || args_size == m->size_of_parameters(), "");
// Fill in code attribute information
m->set_max_stack(max_stack);
m->set_max_locals(max_locals);
if (stackmap_data != NULL) {
< prev index next >