< prev index next >

src/hotspot/share/oops/oop.cpp

Print this page
@@ -152,11 +152,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.
-   return UseCompressedClassPointers;
+   // 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!");

@@ -164,11 +165,13 @@
    _metadata._compressed_klass = nk;
  }
  #endif
  
  void* oopDesc::load_klass_raw(oop obj) {
-   if (UseCompressedClassPointers) {
+   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 >