< prev index next >

src/hotspot/share/classfile/verifier.hpp

Print this page

        

*** 38,48 **** 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); --- 38,48 ---- 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);
*** 152,161 **** --- 152,162 ---- 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;
*** 215,224 **** --- 216,228 ---- 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() {
*** 346,356 **** // bytecode or loop. bool ends_in_athrow(u4 start_bc_offset); void verify_invoke_instructions( RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame, ! bool in_try_block, bool* this_uninit, VerificationType return_type, const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS); VerificationType get_newarray_type(u2 index, u2 bci, TRAPS); void verify_anewarray(u2 bci, u2 index, const constantPoolHandle& cp, StackMapFrame* current_frame, TRAPS); --- 350,360 ---- // bytecode or loop. bool ends_in_athrow(u4 start_bc_offset); void verify_invoke_instructions( RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame, ! bool in_try_block, bool* this_uninit, const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS); VerificationType get_newarray_type(u2 index, u2 bci, TRAPS); void verify_anewarray(u2 bci, u2 index, const constantPoolHandle& cp, StackMapFrame* current_frame, TRAPS);
*** 447,457 **** int change_sig_to_verificationType( SignatureStream* sig_type, VerificationType* inference_type); 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 --- 451,468 ---- int change_sig_to_verificationType( SignatureStream* sig_type, VerificationType* inference_type); 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
*** 486,497 **** { Symbol* name = sig_type->as_symbol(); // 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(); --- 497,516 ---- { Symbol* name = sig_type->as_symbol(); // 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(); ! // 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 >