< prev index next >
src/hotspot/share/classfile/verifier.hpp
Print this page
*** 37,47 ****
public:
enum {
STACKMAP_ATTRIBUTE_MAJOR_VERSION = 50,
INVOKEDYNAMIC_MAJOR_VERSION = 51,
NO_RELAX_ACCESS_CTRL_CHECK_VERSION = 52,
! DYNAMICCONSTANT_MAJOR_VERSION = 55
};
// Verify the bytecodes for a class.
static bool verify(InstanceKlass* klass, bool should_verify_class, TRAPS);
--- 37,47 ----
public:
enum {
STACKMAP_ATTRIBUTE_MAJOR_VERSION = 50,
INVOKEDYNAMIC_MAJOR_VERSION = 51,
NO_RELAX_ACCESS_CTRL_CHECK_VERSION = 52,
! DYNAMICCONSTANT_MAJOR_VERSION = 55,
};
// Verify the bytecodes for a class.
static bool verify(InstanceKlass* klass, bool should_verify_class, TRAPS);
*** 151,160 ****
--- 151,161 ----
STACK_SIZE_MISMATCH, // Frames have different stack sizes
STACK_OVERFLOW, // Attempt to push onto a full expression stack
STACK_UNDERFLOW, // Attempt to pop and empty expression stack
MISSING_STACKMAP, // No stackmap for this location and there should be
BAD_STACKMAP, // Format error in stackmap
+ WRONG_VALUE_TYPE, // Mismatched value type
NO_FAULT, // No error
UNKNOWN
} FaultType;
int _bci;
*** 214,223 ****
--- 215,227 ----
return ErrorContext(bci, MISSING_STACKMAP);
}
static ErrorContext bad_stackmap(int index, StackMapFrame* frame) {
return ErrorContext(0, BAD_STACKMAP, TypeOrigin::frame(frame));
}
+ static ErrorContext bad_value_type(u2 bci, TypeOrigin type, TypeOrigin exp) {
+ return ErrorContext(bci, WRONG_VALUE_TYPE, type, exp);
+ }
bool is_valid() const { return _fault != NO_FAULT; }
int bci() const { return _bci; }
void reset_frames() {
*** 400,410 ****
int change_sig_to_verificationType(
SignatureStream* sig_type, VerificationType* inference_type, TRAPS);
VerificationType cp_index_to_type(int index, const constantPoolHandle& cp, TRAPS) {
! return VerificationType::reference_type(cp->klass_name_at(index));
}
// Keep a list of temporary symbols created during verification because
// their reference counts need to be decremented when the verifier object
// goes out of scope. Since these symbols escape the scope in which they're
--- 404,421 ----
int change_sig_to_verificationType(
SignatureStream* sig_type, VerificationType* inference_type, TRAPS);
VerificationType cp_index_to_type(int index, const constantPoolHandle& cp, TRAPS) {
! Symbol* name = cp->klass_name_at(index);
! if (name->is_Q_signature()) {
! // Remove the Q and ;
! // TBD need error msg if fundamental_name() returns NULL?
! Symbol* fund_name = name->fundamental_name(CHECK_(VerificationType::bogus_type()));
! return VerificationType::valuetype_type(fund_name);
! }
! return VerificationType::reference_type(name);
}
// Keep a list of temporary symbols created during verification because
// their reference counts need to be decremented when the verifier object
// goes out of scope. Since these symbols escape the scope in which they're
*** 433,444 ****
{
Symbol* name = sig_type->as_symbol(CHECK_0);
// Create another symbol to save as signature stream unreferences this symbol.
Symbol* name_copy = create_temporary_symbol(name);
assert(name_copy == name, "symbols don't match");
! *inference_type =
! VerificationType::reference_type(name_copy);
return 1;
}
case T_LONG:
*inference_type = VerificationType::long_type();
*++inference_type = VerificationType::long2_type();
--- 444,463 ----
{
Symbol* name = sig_type->as_symbol(CHECK_0);
// Create another symbol to save as signature stream unreferences this symbol.
Symbol* name_copy = create_temporary_symbol(name);
assert(name_copy == name, "symbols don't match");
! *inference_type = VerificationType::reference_type(name_copy);
! return 1;
! }
! case T_VALUETYPE:
! {
! Symbol* vname = sig_type->as_symbol(CHECK_0);
! // Create another symbol to save as signature stream unreferences this symbol.
! Symbol* vname_copy = create_temporary_symbol(vname);
! assert(vname_copy == vname, "symbols don't match");
! *inference_type = VerificationType::valuetype_type(vname_copy);
return 1;
}
case T_LONG:
*inference_type = VerificationType::long_type();
*++inference_type = VerificationType::long2_type();
< prev index next >