< prev index next >

src/share/vm/oops/klass.hpp

Print this page




 335   static BasicType layout_helper_element_type(jint lh) {
 336     assert(lh < (jint)_lh_neutral_value, "must be array");
 337     int btvalue = (lh >> _lh_element_type_shift) & _lh_element_type_mask;
 338     assert(btvalue >= T_BOOLEAN && btvalue <= T_OBJECT, "sanity");
 339     return (BasicType) btvalue;
 340   }
 341   static int layout_helper_log2_element_size(jint lh) {
 342     assert(lh < (jint)_lh_neutral_value, "must be array");
 343     int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask;
 344     assert(l2esz <= LogBitsPerLong,
 345            "sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh);
 346     return l2esz;
 347   }
 348   static jint array_layout_helper(jint tag, int hsize, BasicType etype, int log2_esize) {
 349     return (tag        << _lh_array_tag_shift)
 350       |    (hsize      << _lh_header_size_shift)
 351       |    ((int)etype << _lh_element_type_shift)
 352       |    (log2_esize << _lh_log2_element_size_shift);
 353   }
 354   static jint instance_layout_helper(jint size, bool slow_path_flag) {
 355     return (size << LogHeapWordSize)
 356       |    (slow_path_flag ? _lh_instance_slow_path_bit : 0);
 357   }
 358   static int layout_helper_to_size_helper(jint lh) {
 359     assert(lh > (jint)_lh_neutral_value, "must be instance");
 360     // Note that the following expression discards _lh_instance_slow_path_bit.
 361     return lh >> LogHeapWordSize;
 362   }
 363   // Out-of-line version computes everything based on the etype:
 364   static jint array_layout_helper(BasicType etype);
 365 
 366   // What is the maximum number of primary superclasses any klass can have?
 367 #ifdef PRODUCT
 368   static juint primary_super_limit()         { return _primary_super_limit; }
 369 #else
 370   static juint primary_super_limit() {
 371     assert(FastSuperclassLimit <= _primary_super_limit, "parameter oob");
 372     return FastSuperclassLimit;
 373   }
 374 #endif
 375 
 376   // vtables
 377   virtual klassVtable* vtable() const = 0;
 378   virtual int vtable_length() const = 0;
 379 
 380   // subclass check
 381   bool is_subclass_of(const Klass* k) const;




 335   static BasicType layout_helper_element_type(jint lh) {
 336     assert(lh < (jint)_lh_neutral_value, "must be array");
 337     int btvalue = (lh >> _lh_element_type_shift) & _lh_element_type_mask;
 338     assert(btvalue >= T_BOOLEAN && btvalue <= T_OBJECT, "sanity");
 339     return (BasicType) btvalue;
 340   }
 341   static int layout_helper_log2_element_size(jint lh) {
 342     assert(lh < (jint)_lh_neutral_value, "must be array");
 343     int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask;
 344     assert(l2esz <= LogBitsPerLong,
 345            "sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh);
 346     return l2esz;
 347   }
 348   static jint array_layout_helper(jint tag, int hsize, BasicType etype, int log2_esize) {
 349     return (tag        << _lh_array_tag_shift)
 350       |    (hsize      << _lh_header_size_shift)
 351       |    ((int)etype << _lh_element_type_shift)
 352       |    (log2_esize << _lh_log2_element_size_shift);
 353   }
 354   static jint instance_layout_helper(jint size, bool slow_path_flag) {
 355     return (size << LogBytesPerWord)
 356       |    (slow_path_flag ? _lh_instance_slow_path_bit : 0);
 357   }
 358   static int layout_helper_to_size_helper(jint lh) {
 359     assert(lh > (jint)_lh_neutral_value, "must be instance");
 360     // Note that the following expression discards _lh_instance_slow_path_bit.
 361     return lh >> LogBytesPerWord;
 362   }
 363   // Out-of-line version computes everything based on the etype:
 364   static jint array_layout_helper(BasicType etype);
 365 
 366   // What is the maximum number of primary superclasses any klass can have?
 367 #ifdef PRODUCT
 368   static juint primary_super_limit()         { return _primary_super_limit; }
 369 #else
 370   static juint primary_super_limit() {
 371     assert(FastSuperclassLimit <= _primary_super_limit, "parameter oob");
 372     return FastSuperclassLimit;
 373   }
 374 #endif
 375 
 376   // vtables
 377   virtual klassVtable* vtable() const = 0;
 378   virtual int vtable_length() const = 0;
 379 
 380   // subclass check
 381   bool is_subclass_of(const Klass* k) const;


< prev index next >