< prev index next >

src/hotspot/share/classfile/classFileParser.hpp

Print this page
@@ -72,10 +72,12 @@
    OopMapBlocksBuilder* oop_map_blocks;
    int _instance_size;
    int _nonstatic_field_size;
    int _static_field_size;
    bool  _has_nonstatic_fields;
+   bool  _is_naturally_atomic;
+   bool _has_inline_fields;
  };
  
  // Parser for for .class files
  //
  // The bytes describing the class file structure is read from a Stream object

@@ -125,12 +127,14 @@
    Array<Method*>* _methods;
    Array<u2>* _inner_classes;
    Array<u2>* _nest_members;
    u2 _nest_host;
    Array<u2>* _permitted_subclasses;
+   Array<u2>* _preload_classes;
    Array<RecordComponent*>* _record_components;
    Array<InstanceKlass*>* _local_interfaces;
+   GrowableArray<u2>* _local_interface_indexes;
    Array<InstanceKlass*>* _transitive_interfaces;
    Annotations* _combined_annotations;
    AnnotationArray* _class_annotations;
    AnnotationArray* _class_type_annotations;
    Array<AnnotationArray*>* _fields_annotations;

@@ -139,10 +143,11 @@
    InstanceKlass* _klass_to_deallocate; // an InstanceKlass* to be destroyed
  
    ClassAnnotationCollector* _parsed_annotations;
    FieldAllocationCount* _fac;
    FieldLayoutInfo* _field_info;
+   Array<InlineKlass*>* _inline_type_field_klasses;
    const intArray* _method_ordering;
    GrowableArray<Method*>* _all_mirandas;
  
    enum { fixed_buffer_size = 128 };
    u_char _linenumbertable_buffer[fixed_buffer_size];

@@ -151,10 +156,14 @@
    int _vtable_size;
    int _itable_size;
  
    int _num_miranda_methods;
  
+   int _alignment;
+   int _first_field_offset;
+   int _exact_size_in_bytes;
+ 
    Handle _protection_domain;
    AccessFlags _access_flags;
  
    // for tracing and notifications
    Publicity _pub_level;

@@ -188,10 +197,18 @@
    bool _has_nonstatic_concrete_methods;
    bool _declares_nonstatic_concrete_methods;
    bool _has_final_method;
    bool _has_contended_fields;
  
+   bool _has_inline_type_fields;
+   bool _has_nonstatic_fields;
+   bool _is_empty_inline_type;
+   bool _is_naturally_atomic;
+   bool _is_declared_atomic;
+   bool _carries_value_modifier;      // Has ACC_VALUE mddifier or one of its super types has
+   bool _carries_identity_modifier;   // Has ACC_IDENTITY modifier or one of its super types has
+ 
    // precomputed flags
    bool _has_finalizer;
    bool _has_empty_finalizer;
    bool _has_vanilla_constructor;
    int _max_bootstrap_specifier_index;  // detects BSS values

@@ -235,10 +252,11 @@
    // Interface parsing
    void parse_interfaces(const ClassFileStream* const stream,
                          const int itfs_len,
                          ConstantPool* const cp,
                          bool* has_nonstatic_concrete_methods,
+                         bool* is_declared_atomic,
                          TRAPS);
  
    const InstanceKlass* parse_super_class(ConstantPool* const cp,
                                           const int super_class_index,
                                           const bool need_verify,

@@ -254,26 +272,30 @@
                                u2* const generic_signature_index_addr,
                                FieldAnnotationCollector* parsed_annotations,
                                TRAPS);
  
    void parse_fields(const ClassFileStream* const cfs,
-                     bool is_interface,
+                     AccessFlags class_access_flags,
                      FieldAllocationCount* const fac,
                      ConstantPool* cp,
                      const int cp_size,
                      u2* const java_fields_count_ptr,
                      TRAPS);
  
    // Method parsing
    Method* parse_method(const ClassFileStream* const cfs,
                         bool is_interface,
+                        bool is_value_class,
+                        bool is_abstract_class,
                         const ConstantPool* cp,
                         AccessFlags* const promoted_flags,
                         TRAPS);
  
    void parse_methods(const ClassFileStream* const cfs,
                       bool is_interface,
+                      bool is_value_class,
+                      bool is_abstract_class,
                       AccessFlags* const promoted_flags,
                       bool* const has_final_method,
                       bool* const declares_nonstatic_concrete_methods,
                       TRAPS);
  

@@ -324,10 +346,14 @@
  
    u2 parse_classfile_permitted_subclasses_attribute(const ClassFileStream* const cfs,
                                                      const u1* const permitted_subclasses_attribute_start,
                                                      TRAPS);
  
+   u2 parse_classfile_preload_attribute(const ClassFileStream* const cfs,
+                                                     const u1* const preload_attribute_start,
+                                                     TRAPS);
+ 
    u2 parse_classfile_record_attribute(const ClassFileStream* const cfs,
                                        const ConstantPool* cp,
                                        const u1* const record_attribute_start,
                                        TRAPS);
  

@@ -442,10 +468,15 @@
    void throwIllegalSignature(const char* type,
                               const Symbol* name,
                               const Symbol* sig,
                               TRAPS) const;
  
+   void throwInlineTypeLimitation(THREAD_AND_LOCATION_DECL,
+                                  const char* msg,
+                                  const Symbol* name = NULL,
+                                  const Symbol* sig  = NULL) const;
+ 
    void verify_constantvalue(const ConstantPool* const cp,
                              int constantvalue_index,
                              int signature_index,
                              TRAPS) const;
  

@@ -464,14 +495,16 @@
                                          const Symbol* signature,
                                          TRAPS) const;
  
    void verify_class_version(u2 major, u2 minor, Symbol* class_name, TRAPS);
  
-   void verify_legal_class_modifiers(jint flags, TRAPS) const;
-   void verify_legal_field_modifiers(jint flags, bool is_interface, TRAPS) const;
+   void verify_legal_class_modifiers(jint flags, const char* name, bool is_Object, TRAPS) const;
+   void verify_legal_field_modifiers(jint flags,
+                                     AccessFlags class_access_flags,
+                                     TRAPS) const;
    void verify_legal_method_modifiers(jint flags,
-                                      bool is_interface,
+                                      AccessFlags class_access_flags,
                                       const Symbol* name,
                                       TRAPS) const;
  
    void check_super_class_access(const InstanceKlass* this_klass,
                                  TRAPS);

@@ -525,10 +558,13 @@
                                 int annotation_default_length,
                                 TRAPS);
  
    void update_class_name(Symbol* new_name);
  
+   // Check if the class file supports inline types
+   bool supports_inline_types() const;
+ 
   public:
    ClassFileParser(ClassFileStream* stream,
                    Symbol* name,
                    ClassLoaderData* loader_data,
                    const ClassLoadInfo* cl_info,

@@ -552,10 +588,22 @@
  
    u2 this_class_index() const { return _this_class_index; }
  
    bool is_hidden() const { return _is_hidden; }
    bool is_interface() const { return _access_flags.is_interface(); }
+   bool is_inline_type() const { return _access_flags.is_value_class() && !_access_flags.is_interface() && !_access_flags.is_abstract(); }
+   bool is_value_class() const { return _access_flags.is_value_class(); }
+   bool is_abstract_class() const { return _access_flags.is_abstract(); }
+   bool is_identity_class() const { return _access_flags.is_identity_class(); }
+   bool is_value_capable_class() const;
+   bool has_inline_fields() const { return _has_inline_type_fields; }
+   bool carries_identity_modifier() const { return _carries_identity_modifier; }
+   void set_carries_identity_modifier() { _carries_identity_modifier = true; }
+   bool carries_value_modifier() const { return _carries_value_modifier; }
+   void set_carries_value_modifier() { _carries_value_modifier = true; }
+ 
+   u2 java_fields_count() const { return _java_fields_count; }
  
    ClassLoaderData* loader_data() const { return _loader_data; }
    const Symbol* class_name() const { return _class_name; }
    const InstanceKlass* super_klass() const { return _super_klass; }
  
< prev index next >