< prev index next >

src/hotspot/share/oops/oop.cpp

Print this page
*** 28,14 ***
--- 28,16 ---
  #include "gc/shared/collectedHeap.inline.hpp"
  #include "gc/shared/gc_globals.hpp"
  #include "memory/resourceArea.hpp"
  #include "memory/universe.hpp"
  #include "oops/access.inline.hpp"
+ #include "oops/compressedKlass.inline.hpp"
  #include "oops/compressedOops.inline.hpp"
  #include "oops/oop.inline.hpp"
  #include "oops/verifyOopClosure.hpp"
  #include "runtime/handles.inline.hpp"
+ #include "runtime/interfaceSupport.inline.hpp"
  #include "runtime/javaThread.hpp"
  #include "runtime/synchronizer.hpp"
  #include "utilities/macros.hpp"
  
  void oopDesc::print_on(outputStream* st) const {

*** 110,11 ***
  
    // Header verification: the mark is typically non-zero. If we're
    // at a safepoint, it must not be zero.
    // Outside of a safepoint, the header could be changing (for example,
    // another thread could be inflating a lock on this object).
!   if (ignore_mark_word) {
      return true;
    }
    if (obj->mark().value() != 0) {
      return true;
    }
--- 112,11 ---
  
    // Header verification: the mark is typically non-zero. If we're
    // at a safepoint, it must not be zero.
    // Outside of a safepoint, the header could be changing (for example,
    // another thread could be inflating a lock on this object).
!   if (ignore_mark_word || UseFastLocking) {
      return true;
    }
    if (obj->mark().value() != 0) {
      return true;
    }

*** 142,31 ***
  bool oopDesc::is_stackChunk_noinline()  const { return is_stackChunk();  }
  bool oopDesc::is_array_noinline()       const { return is_array();       }
  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(DumpSharedSpaces, "Used by CDS only. Do not abuse!");
-   assert(UseCompressedClassPointers, "must be");
-   _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 NULL;
!     return (void*)CompressedKlassPointers::decode_raw(narrow_klass);
!   } else {
!     return obj->_metadata._klass;
!   }
  }
  
  void* oopDesc::load_oop_raw(oop obj, int offset) {
    uintptr_t addr = (uintptr_t)(void*)obj + (uint)offset;
    if (UseCompressedOops) {
--- 144,19 ---
  bool oopDesc::is_stackChunk_noinline()  const { return is_stackChunk();  }
  bool oopDesc::is_array_noinline()       const { return is_array();       }
  bool oopDesc::is_objArray_noinline()    const { return is_objArray();    }
  bool oopDesc::is_typeArray_noinline()   const { return is_typeArray();   }
  
  void* oopDesc::load_klass_raw(oop obj) {
!   // TODO: Remove method altogether and replace with calls to obj->klass() ?
!   // OTOH, we may eventually get rid of locking in header, and then no
!   // longer have to deal with that anymore.
! #ifdef _LP64
!   return obj->klass();
! #else
!   return obj->_klass;
+ #endif
  }
  
  void* oopDesc::load_oop_raw(oop obj, int offset) {
    uintptr_t addr = (uintptr_t)(void*)obj + (uint)offset;
    if (UseCompressedOops) {
< prev index next >