< prev index next >

src/hotspot/share/classfile/javaClasses.hpp

Print this page
*** 211,10 ***
--- 211,11 ---
    static Symbol* as_symbol(oop java_string);
    static Symbol* as_symbol_or_null(oop java_string);
  
    // Tester
    static inline bool is_instance(oop obj);
+   static inline bool is_instance_without_asserts(oop obj);
  
    // Debugging
    static void print(oop java_string, outputStream* st, int max_length = MaxStringPrintSize);
    friend class JavaClasses;
    friend class StringTable;

*** 250,17 ***
--- 251,19 ---
    static int _init_lock_offset;
    static int _signers_offset;
    static int _class_loader_offset;
    static int _module_offset;
    static int _component_mirror_offset;
+ 
    static int _name_offset;
    static int _source_file_offset;
    static int _classData_offset;
    static int _classRedefinedCount_offset;
    static int _reflectionData_offset;
    static int _modifiers_offset;
    static int _is_primitive_offset;
+   static int _is_identity_offset;
    static int _raw_access_flags_offset;
  
    static bool _offsets_computed;
  
    static GrowableArray<Klass*>* _fixup_mirror_list;

*** 271,10 ***
--- 274,11 ---
    static void set_class_loader(oop java_class, oop class_loader);
    static void set_component_mirror(oop java_class, oop comp_mirror);
    static void initialize_mirror_fields(InstanceKlass* ik, Handle mirror, Handle protection_domain,
                                         Handle classData, TRAPS);
    static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
+   static void set_is_identity(oop java_class, bool value);
  
    static void set_modifiers(oop java_class, u2 value);
    static void set_raw_access_flags(oop java_class, u2 value);
    static void set_is_primitive(oop java_class);
    static void release_set_array_klass(oop java_class, Klass* klass);

*** 318,10 ***
--- 322,11 ---
    static Klass* array_klass_acquire(oop java_class);
  
    // compiler support for class operations
    static int klass_offset()                { CHECK_INIT(_klass_offset); }
    static int array_klass_offset()          { CHECK_INIT(_array_klass_offset); }
+ 
    // Support for classRedefinedCount field
    static int classRedefinedCount(oop the_class_mirror);
    static void set_classRedefinedCount(oop the_class_mirror, int value);
  
    // Support for embedded per-class oops

*** 659,12 ***
    static void set_stacktrace(oop throwable, oop st_element_array);
    static oop unassigned_stacktrace();
  
   public:
    // Backtrace
!   static oop backtrace(oop throwable);
!   static void set_backtrace(oop throwable, oop value);
    static int depth(oop throwable);
    static void set_depth(oop throwable, int value);
    // Message
    static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); }
    static oop message(oop throwable);
--- 664,12 ---
    static void set_stacktrace(oop throwable, oop st_element_array);
    static oop unassigned_stacktrace();
  
   public:
    // Backtrace
!   static refArrayOop backtrace(oop throwable);
!   static void set_backtrace(oop throwable, refArrayOop value);
    static int depth(oop throwable);
    static void set_depth(oop throwable, int value);
    // Message
    static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); }
    static oop message(oop throwable);

*** 685,11 ***
    // Fill in current stack trace, can cause GC
    static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
    static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
  
    // Programmatic access to stack trace
!   static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
  
    // For recreating class initialization error exceptions.
    static Handle create_initialization_error(JavaThread* current, Handle throwable);
  
    // Printing
--- 690,11 ---
    // Fill in current stack trace, can cause GC
    static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
    static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
  
    // Programmatic access to stack trace
!   static void get_stack_trace_elements(int depth, Handle backtrace, refArrayHandle stack_trace, TRAPS);
  
    // For recreating class initialization error exceptions.
    static Handle create_initialization_error(JavaThread* current, Handle throwable);
  
    // Printing

*** 829,11 ***
    static int _clazz_offset;
    static int _name_offset;
    static int _type_offset;
    static int _slot_offset;
    static int _modifiers_offset;
!   static int _trusted_final_offset;
    static int _signature_offset;
    static int _annotations_offset;
  
    static void compute_offsets();
  
--- 834,11 ---
    static int _clazz_offset;
    static int _name_offset;
    static int _type_offset;
    static int _slot_offset;
    static int _modifiers_offset;
!   static int _flags_offset;
    static int _signature_offset;
    static int _annotations_offset;
  
    static void compute_offsets();
  

*** 857,11 ***
    static void set_slot(oop reflect, int value);
  
    static int modifiers(oop field);
    static void set_modifiers(oop field, int value);
  
!   static void set_trusted_final(oop field);
  
    static void set_signature(oop constructor, oop value);
    static void set_annotations(oop constructor, oop value);
  
    // Debugging
--- 862,11 ---
    static void set_slot(oop reflect, int value);
  
    static int modifiers(oop field);
    static void set_modifiers(oop field, int value);
  
!   static void set_flags(oop field, int value);
  
    static void set_signature(oop constructor, oop value);
    static void set_annotations(oop constructor, oop value);
  
    // Debugging

*** 979,12 ***
  
  // This could be separated out into 8 individual classes.
  
  class java_lang_boxing_object: AllStatic {
   private:
!   static int _value_offset;
-   static int _long_value_offset;
  
    static void compute_offsets();
    static oop initialize_and_allocate(BasicType type, TRAPS);
   public:
    // Allocation. Returns a boxed value, or null for invalid type.
--- 984,11 ---
  
  // This could be separated out into 8 individual classes.
  
  class java_lang_boxing_object: AllStatic {
   private:
!   static int* _offsets;
  
    static void compute_offsets();
    static oop initialize_and_allocate(BasicType type, TRAPS);
   public:
    // Allocation. Returns a boxed value, or null for invalid type.

*** 997,11 ***
    static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; }
    static void print(oop box, outputStream* st)     { jvalue value;  print(get_value(box, &value), &value, st); }
    static void print(BasicType type, jvalue* value, outputStream* st);
  
    static int value_offset(BasicType type) {
!     return is_double_word_type(type) ? _long_value_offset : _value_offset;
    }
  
    static void serialize_offsets(SerializeClosure* f);
  
    // Debugging
--- 1001,13 ---
    static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; }
    static void print(oop box, outputStream* st)     { jvalue value;  print(get_value(box, &value), &value, st); }
    static void print(BasicType type, jvalue* value, outputStream* st);
  
    static int value_offset(BasicType type) {
!     assert(type >= T_BOOLEAN && type <= T_LONG, "BasicType out of range");
+     assert(_offsets != nullptr, "Uninitialized offsets");
+     return _offsets[type - T_BOOLEAN];
    }
  
    static void serialize_offsets(SerializeClosure* f);
  
    // Debugging

*** 1197,13 ***
  
   public:
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  
    // Accessors
!   static objArrayOop inputStorage(oop entry);
!   static objArrayOop outputStorage(oop entry);
!   static objArrayOop volatileStorage(oop entry);
    static jint        stackAlignment(oop entry);
    static jint        shadowSpace(oop entry);
    static oop         scratch1(oop entry);
    static oop         scratch2(oop entry);
  };
--- 1203,13 ---
  
   public:
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  
    // Accessors
!   static refArrayOop inputStorage(oop entry);
!   static refArrayOop outputStorage(oop entry);
!   static refArrayOop volatileStorage(oop entry);
    static jint        stackAlignment(oop entry);
    static jint        shadowSpace(oop entry);
    static oop         scratch1(oop entry);
    static oop         scratch2(oop entry);
  };

*** 1247,12 ***
  
   public:
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  
    // Accessors
!   static objArrayOop argRegs(oop entry);
!   static objArrayOop retRegs(oop entry);
  
    // Testers
    static bool is_subclass(Klass* klass) {
      return vmClasses::CallConv_klass() != nullptr &&
        klass->is_subclass_of(vmClasses::CallConv_klass());
--- 1253,12 ---
  
   public:
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  
    // Accessors
!   static refArrayOop argRegs(oop entry);
!   static refArrayOop retRegs(oop entry);
  
    // Testers
    static bool is_subclass(Klass* klass) {
      return vmClasses::CallConv_klass() != nullptr &&
        klass->is_subclass_of(vmClasses::CallConv_klass());

*** 1345,18 ***
    static bool is_method(oop obj);
  
    // Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
    enum {
      MN_IS_METHOD             = 0x00010000, // method (not constructor)
!     MN_IS_CONSTRUCTOR        = 0x00020000, // constructor
      MN_IS_FIELD              = 0x00040000, // field
      MN_IS_TYPE               = 0x00080000, // nested type
      MN_CALLER_SENSITIVE      = 0x00100000, // @CallerSensitive annotation detected
      MN_TRUSTED_FINAL         = 0x00200000, // trusted final field
      MN_HIDDEN_MEMBER         = 0x00400000, // @Hidden annotation detected
      MN_REFERENCE_KIND_SHIFT  = 24, // refKind
!     MN_REFERENCE_KIND_MASK   = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT,
      MN_NESTMATE_CLASS        = 0x00000001,
      MN_HIDDEN_CLASS          = 0x00000002,
      MN_STRONG_LOADER_LINK    = 0x00000004,
      MN_ACCESS_VM_ANNOTATIONS = 0x00000008,
      // Lookup modes
--- 1351,21 ---
    static bool is_method(oop obj);
  
    // Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
    enum {
      MN_IS_METHOD             = 0x00010000, // method (not constructor)
!     MN_IS_OBJECT_CONSTRUCTOR = 0x00020000, // constructor
      MN_IS_FIELD              = 0x00040000, // field
      MN_IS_TYPE               = 0x00080000, // nested type
      MN_CALLER_SENSITIVE      = 0x00100000, // @CallerSensitive annotation detected
      MN_TRUSTED_FINAL         = 0x00200000, // trusted final field
      MN_HIDDEN_MEMBER         = 0x00400000, // @Hidden annotation detected
+     MN_NULL_RESTRICTED_FIELD = 0x00800000, // null-restricted field
      MN_REFERENCE_KIND_SHIFT  = 24, // refKind
!     MN_REFERENCE_KIND_MASK   = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT, // 4 bits
+     MN_LAYOUT_SHIFT          = 28, // field layout
+     MN_LAYOUT_MASK           = 0x70000000 >> MN_LAYOUT_SHIFT, // 3 bits
      MN_NESTMATE_CLASS        = 0x00000001,
      MN_HIDDEN_CLASS          = 0x00000002,
      MN_STRONG_LOADER_LINK    = 0x00000004,
      MN_ACCESS_VM_ANNOTATIONS = 0x00000008,
      // Lookup modes

*** 1387,11 ***
  
   public:
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
    // Accessors
    static oop            rtype(oop mt);
!   static objArrayOop    ptypes(oop mt);
  
    static oop            ptype(oop mt, int index);
    static int            ptype_count(oop mt);
  
    static int            ptype_slot_count(oop mt);  // extra counts for long/double
--- 1396,11 ---
  
   public:
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
    // Accessors
    static oop            rtype(oop mt);
!   static refArrayOop    ptypes(oop mt);
  
    static oop            ptype(oop mt, int index);
    static int            ptype_count(oop mt);
  
    static int            ptype_slot_count(oop mt);  // extra counts for long/double

*** 1812,55 ***
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static objArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Long_LongCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static objArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Character_CharacterCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static objArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Short_ShortCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static objArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Byte_ByteCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static objArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
- 
  // Interface to java.lang.InternalError objects
  
  #define INTERNALERROR_INJECTED_FIELDS(macro)                      \
    macro(java_lang_InternalError, during_unsafe_access, bool_signature, false)
  
--- 1821,54 ---
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static refArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Long_LongCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static refArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Character_CharacterCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static refArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Short_ShortCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static refArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  class java_lang_Byte_ByteCache : AllStatic {
   private:
    static int _static_cache_offset;
   public:
    static Symbol* symbol();
    static void compute_offsets(InstanceKlass* k);
!   static refArrayOop  cache(InstanceKlass *k);
    static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
  };
  
  // Interface to java.lang.InternalError objects
  
  #define INTERNALERROR_INJECTED_FIELDS(macro)                      \
    macro(java_lang_InternalError, during_unsafe_access, bool_signature, false)
  
< prev index next >