< prev index next >

src/hotspot/share/classfile/verifier.hpp

Print this page
*** 38,11 ***
   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,13 ---
   public:
    enum {
      STACKMAP_ATTRIBUTE_MAJOR_VERSION    = 50,
      INVOKEDYNAMIC_MAJOR_VERSION         = 51,
      NO_RELAX_ACCESS_CTRL_CHECK_VERSION  = 52,
!     DYNAMICCONSTANT_MAJOR_VERSION       = 55,
+     VALUE_TYPES_MAJOR_VERSION           = 67,
+     JAVA_PREVIEW_MINOR_VERSION          = 65535,
    };
  
    // Verify the bytecodes for a class.
    static bool verify(InstanceKlass* klass, bool should_verify_class, TRAPS);
  

*** 153,10 ***
--- 155,11 ---
      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_INLINE_TYPE,    // Mismatched inline type
      NO_FAULT,             // No error
      UNKNOWN
    } FaultType;
  
    int _bci;

*** 216,10 ***
--- 219,13 ---
      return ErrorContext(bci, MISSING_STACKMAP);
    }
    static ErrorContext bad_stackmap(int index, StackMapFrame* frame) {
      return ErrorContext(0, BAD_STACKMAP, TypeOrigin::frame(frame));
    }
+   static ErrorContext bad_inline_type(int bci, TypeOrigin type, TypeOrigin exp) {
+     return ErrorContext(bci, WRONG_INLINE_TYPE, type, exp);
+   }
  
    bool is_valid() const { return _fault != NO_FAULT; }
    int bci() const { return _bci; }
  
    void reset_frames() {

*** 346,11 ***
    // 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, int bci, TRAPS);
    void verify_anewarray(int bci, u2 index, const constantPoolHandle& cp,
        StackMapFrame* current_frame, TRAPS);
--- 352,11 ---
    // 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, int bci, TRAPS);
    void verify_anewarray(int bci, u2 index, const constantPoolHandle& cp,
        StackMapFrame* current_frame, TRAPS);

*** 443,11 ***
  
    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
--- 449,12 ---
  
    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);
+     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

*** 481,12 ***
        {
          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();
--- 488,11 ---
        {
          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();
< prev index next >