< prev index next >

src/hotspot/share/oops/oop.cpp

Print this page
*** 156,11 ***
  bool oopDesc::is_objArray_noinline()    const { return is_objArray();    }
  bool oopDesc::is_typeArray_noinline()   const { return is_typeArray();   }
  
  bool oopDesc::has_klass_gap() {
    // Only has a klass gap when compressed class pointers are used.
!   return UseCompressedClassPointers;
  }
  
  #if INCLUDE_CDS_JAVA_HEAP
  void oopDesc::set_narrow_klass(narrowKlass nk) {
    assert(CDSConfig::is_dumping_heap(), "Used by CDS only. Do not abuse!");
--- 156,12 ---
  bool oopDesc::is_objArray_noinline()    const { return is_objArray();    }
  bool oopDesc::is_typeArray_noinline()   const { return is_typeArray();   }
  
  bool oopDesc::has_klass_gap() {
    // Only has a klass gap when compressed class pointers are used.
!   // Except when using compact headers.
+   return UseCompressedClassPointers && !UseCompactObjectHeaders;
  }
  
  #if INCLUDE_CDS_JAVA_HEAP
  void oopDesc::set_narrow_klass(narrowKlass nk) {
    assert(CDSConfig::is_dumping_heap(), "Used by CDS only. Do not abuse!");

*** 168,11 ***
    _metadata._compressed_klass = nk;
  }
  #endif
  
  void* oopDesc::load_klass_raw(oop obj) {
!   if (UseCompressedClassPointers) {
      narrowKlass narrow_klass = obj->_metadata._compressed_klass;
      if (narrow_klass == 0) return nullptr;
      return (void*)CompressedKlassPointers::decode_raw(narrow_klass);
    } else {
      return obj->_metadata._klass;
--- 169,13 ---
    _metadata._compressed_klass = nk;
  }
  #endif
  
  void* oopDesc::load_klass_raw(oop obj) {
!   if (UseCompactObjectHeaders) {
+     return obj->klass();
+   } else if (UseCompressedClassPointers) {
      narrowKlass narrow_klass = obj->_metadata._compressed_klass;
      if (narrow_klass == 0) return nullptr;
      return (void*)CompressedKlassPointers::decode_raw(narrow_klass);
    } else {
      return obj->_metadata._klass;
< prev index next >