src/share/vm/oops/klass.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File webrev Sdiff src/share/vm/oops

src/share/vm/oops/klass.hpp

Print this page




 287   static ByteSize primary_supers_offset()        { return in_ByteSize(offset_of(Klass, _primary_supers)); }
 288   static ByteSize secondary_super_cache_offset() { return in_ByteSize(offset_of(Klass, _secondary_super_cache)); }
 289   static ByteSize secondary_supers_offset()      { return in_ByteSize(offset_of(Klass, _secondary_supers)); }
 290   static ByteSize java_mirror_offset()           { return in_ByteSize(offset_of(Klass, _java_mirror)); }
 291   static ByteSize modifier_flags_offset()        { return in_ByteSize(offset_of(Klass, _modifier_flags)); }
 292   static ByteSize layout_helper_offset()         { return in_ByteSize(offset_of(Klass, _layout_helper)); }
 293   static ByteSize access_flags_offset()          { return in_ByteSize(offset_of(Klass, _access_flags)); }
 294 
 295   // Unpacking layout_helper:
 296   enum {
 297     _lh_neutral_value           = 0,  // neutral non-array non-instance value
 298     _lh_instance_slow_path_bit  = 0x01,
 299     _lh_log2_element_size_shift = BitsPerByte*0,
 300     _lh_log2_element_size_mask  = BitsPerLong-1,
 301     _lh_element_type_shift      = BitsPerByte*1,
 302     _lh_element_type_mask       = right_n_bits(BitsPerByte),  // shifted mask
 303     _lh_header_size_shift       = BitsPerByte*2,
 304     _lh_header_size_mask        = right_n_bits(BitsPerByte),  // shifted mask
 305     _lh_array_tag_bits          = 2,
 306     _lh_array_tag_shift         = BitsPerInt - _lh_array_tag_bits,
 307     _lh_array_tag_type_value    = ~0x00,  // 0xC0000000 >> 30
 308     _lh_array_tag_obj_value     = ~0x01   // 0x80000000 >> 30
 309   };
 310 


 311   static int layout_helper_size_in_bytes(jint lh) {
 312     assert(lh > (jint)_lh_neutral_value, "must be instance");
 313     return (int) lh & ~_lh_instance_slow_path_bit;
 314   }
 315   static bool layout_helper_needs_slow_path(jint lh) {
 316     assert(lh > (jint)_lh_neutral_value, "must be instance");
 317     return (lh & _lh_instance_slow_path_bit) != 0;
 318   }
 319   static bool layout_helper_is_instance(jint lh) {
 320     return (jint)lh > (jint)_lh_neutral_value;
 321   }
 322   static bool layout_helper_is_array(jint lh) {
 323     return (jint)lh < (jint)_lh_neutral_value;
 324   }
 325   static bool layout_helper_is_typeArray(jint lh) {
 326     // _lh_array_tag_type_value == (lh >> _lh_array_tag_shift);
 327     return (juint)lh >= (juint)(_lh_array_tag_type_value << _lh_array_tag_shift);
 328   }
 329   static bool layout_helper_is_objArray(jint lh) {
 330     // _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);




 287   static ByteSize primary_supers_offset()        { return in_ByteSize(offset_of(Klass, _primary_supers)); }
 288   static ByteSize secondary_super_cache_offset() { return in_ByteSize(offset_of(Klass, _secondary_super_cache)); }
 289   static ByteSize secondary_supers_offset()      { return in_ByteSize(offset_of(Klass, _secondary_supers)); }
 290   static ByteSize java_mirror_offset()           { return in_ByteSize(offset_of(Klass, _java_mirror)); }
 291   static ByteSize modifier_flags_offset()        { return in_ByteSize(offset_of(Klass, _modifier_flags)); }
 292   static ByteSize layout_helper_offset()         { return in_ByteSize(offset_of(Klass, _layout_helper)); }
 293   static ByteSize access_flags_offset()          { return in_ByteSize(offset_of(Klass, _access_flags)); }
 294 
 295   // Unpacking layout_helper:
 296   enum {
 297     _lh_neutral_value           = 0,  // neutral non-array non-instance value
 298     _lh_instance_slow_path_bit  = 0x01,
 299     _lh_log2_element_size_shift = BitsPerByte*0,
 300     _lh_log2_element_size_mask  = BitsPerLong-1,
 301     _lh_element_type_shift      = BitsPerByte*1,
 302     _lh_element_type_mask       = right_n_bits(BitsPerByte),  // shifted mask
 303     _lh_header_size_shift       = BitsPerByte*2,
 304     _lh_header_size_mask        = right_n_bits(BitsPerByte),  // shifted mask
 305     _lh_array_tag_bits          = 2,
 306     _lh_array_tag_shift         = BitsPerInt - _lh_array_tag_bits,

 307     _lh_array_tag_obj_value     = ~0x01   // 0x80000000 >> 30
 308   };
 309 
 310   static const unsigned int _lh_array_tag_type_value = 0Xffffffff; // ~0x00,  // 0xC0000000 >> 30
 311 
 312   static int layout_helper_size_in_bytes(jint lh) {
 313     assert(lh > (jint)_lh_neutral_value, "must be instance");
 314     return (int) lh & ~_lh_instance_slow_path_bit;
 315   }
 316   static bool layout_helper_needs_slow_path(jint lh) {
 317     assert(lh > (jint)_lh_neutral_value, "must be instance");
 318     return (lh & _lh_instance_slow_path_bit) != 0;
 319   }
 320   static bool layout_helper_is_instance(jint lh) {
 321     return (jint)lh > (jint)_lh_neutral_value;
 322   }
 323   static bool layout_helper_is_array(jint lh) {
 324     return (jint)lh < (jint)_lh_neutral_value;
 325   }
 326   static bool layout_helper_is_typeArray(jint lh) {
 327     // _lh_array_tag_type_value == (lh >> _lh_array_tag_shift);
 328     return (juint)lh >= (juint)(_lh_array_tag_type_value << _lh_array_tag_shift);
 329   }
 330   static bool layout_helper_is_objArray(jint lh) {
 331     // _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);


src/share/vm/oops/klass.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File