< prev index next >

src/hotspot/share/oops/oop.cpp

Print this page
@@ -154,11 +154,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(DumpSharedSpaces, "Used by CDS only. Do not abuse!");

@@ -166,11 +167,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 >