hotspot/src/share/vm/oops/klass.hpp
changeset 23515 f4872ef5df09
parent 22908 8c4f06f6ea15
child 23999 22eb7be3d99d
equal deleted inserted replaced
23514:8cc4189d9a2a 23515:f4872ef5df09
    53 // normal oops don't have any virtual functions.  Instead, they
    53 // normal oops don't have any virtual functions.  Instead, they
    54 // forward all "virtual" functions to their klass, which does have
    54 // forward all "virtual" functions to their klass, which does have
    55 // a vtbl and does the C++ dispatch depending on the object's
    55 // a vtbl and does the C++ dispatch depending on the object's
    56 // actual type.  (See oop.inline.hpp for some of the forwarding code.)
    56 // actual type.  (See oop.inline.hpp for some of the forwarding code.)
    57 // ALL FUNCTIONS IMPLEMENTING THIS DISPATCH ARE PREFIXED WITH "oop_"!
    57 // ALL FUNCTIONS IMPLEMENTING THIS DISPATCH ARE PREFIXED WITH "oop_"!
    58 
       
    59 //  Klass layout:
       
    60 //    [C++ vtbl ptr  ] (contained in Metadata)
       
    61 //    [layout_helper ]
       
    62 //    [super_check_offset   ] for fast subtype checks
       
    63 //    [name          ]
       
    64 //    [secondary_super_cache] for fast subtype checks
       
    65 //    [secondary_supers     ] array of 2ndary supertypes
       
    66 //    [primary_supers 0]
       
    67 //    [primary_supers 1]
       
    68 //    [primary_supers 2]
       
    69 //    ...
       
    70 //    [primary_supers 7]
       
    71 //    [java_mirror   ]
       
    72 //    [super         ]
       
    73 //    [subklass      ] first subclass
       
    74 //    [next_sibling  ] link to chain additional subklasses
       
    75 //    [next_link     ]
       
    76 //    [class_loader_data]
       
    77 //    [modifier_flags]
       
    78 //    [access_flags  ]
       
    79 //    [last_biased_lock_bulk_revocation_time] (64 bits)
       
    80 //    [prototype_header]
       
    81 //    [biased_lock_revocation_count]
       
    82 //    [_modified_oops]
       
    83 //    [_accumulated_modified_oops]
       
    84 //    [trace_id]
       
    85 
       
    86 
    58 
    87 // Forward declarations.
    59 // Forward declarations.
    88 template <class T> class Array;
    60 template <class T> class Array;
    89 template <class T> class GrowableArray;
    61 template <class T> class GrowableArray;
    90 class ClassLoaderData;
    62 class ClassLoaderData;
   255 
   227 
   256   // Note: for instances layout_helper() may include padding.
   228   // Note: for instances layout_helper() may include padding.
   257   // Use InstanceKlass::contains_field_offset to classify field offsets.
   229   // Use InstanceKlass::contains_field_offset to classify field offsets.
   258 
   230 
   259   // sub/superklass links
   231   // sub/superklass links
       
   232   Klass* subklass() const              { return _subklass; }
       
   233   Klass* next_sibling() const          { return _next_sibling; }
   260   InstanceKlass* superklass() const;
   234   InstanceKlass* superklass() const;
   261   Klass* subklass() const;
       
   262   Klass* next_sibling() const;
       
   263   void append_to_sibling_list();           // add newly created receiver to superklass' subklass list
   235   void append_to_sibling_list();           // add newly created receiver to superklass' subklass list
   264 
   236 
   265   void set_next_link(Klass* k) { _next_link = k; }
   237   void set_next_link(Klass* k) { _next_link = k; }
   266   Klass* next_link() const { return _next_link; }   // The next klass defined by the class loader.
   238   Klass* next_link() const { return _next_link; }   // The next klass defined by the class loader.
   267 
   239 
   279   void accumulate_modified_oops()        { if (has_modified_oops()) _accumulated_modified_oops = 1; }
   251   void accumulate_modified_oops()        { if (has_modified_oops()) _accumulated_modified_oops = 1; }
   280   void clear_accumulated_modified_oops() { _accumulated_modified_oops = 0; }
   252   void clear_accumulated_modified_oops() { _accumulated_modified_oops = 0; }
   281   bool has_accumulated_modified_oops()   { return _accumulated_modified_oops == 1; }
   253   bool has_accumulated_modified_oops()   { return _accumulated_modified_oops == 1; }
   282 
   254 
   283  protected:                                // internal accessors
   255  protected:                                // internal accessors
   284   Klass* subklass_oop() const            { return _subklass; }
       
   285   Klass* next_sibling_oop() const        { return _next_sibling; }
       
   286   void     set_subklass(Klass* s);
   256   void     set_subklass(Klass* s);
   287   void     set_next_sibling(Klass* s);
   257   void     set_next_sibling(Klass* s);
   288 
   258 
   289  public:
   259  public:
   290 
   260