src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.hpp

Print this page




  56 #else
  57               narrowOop _narrow_next;
  58     LP64_ONLY(narrowOop _pad;)
  59 #endif
  60   } Data;
  61 
  62   union {
  63     intptr_t _next;
  64     Data     _data;
  65   };
  66  public:
  67   inline PromotedObject* next() const {
  68     assert(!((FreeChunk*)this)->is_free(), "Error");
  69     PromotedObject* res;
  70     if (UseCompressedOops) {
  71       // The next pointer is a compressed oop stored in the top 32 bits
  72       res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next);
  73     } else {
  74       res = (PromotedObject*)(_next & next_mask);
  75     }
  76     assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Not an oop?");
  77     return res;
  78   }
  79   inline void setNext(PromotedObject* x) {
  80     assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, "
  81            "or insufficient alignment of objects");
  82     if (UseCompressedOops) {
  83       assert(_data._narrow_next == 0, "Overwrite?");
  84       _data._narrow_next = oopDesc::encode_heap_oop(oop(x));
  85     } else {
  86       _next |= (intptr_t)x;
  87     }
  88     assert(!((FreeChunk*)this)->is_free(), "Error");
  89   }
  90   inline void setPromotedMark() {
  91     _next |= promoted_mask;
  92     assert(!((FreeChunk*)this)->is_free(), "Error");
  93   }
  94   inline bool hasPromotedMark() const {
  95     assert(!((FreeChunk*)this)->is_free(), "Error");
  96     return (_next & promoted_mask) == promoted_mask;




  56 #else
  57               narrowOop _narrow_next;
  58     LP64_ONLY(narrowOop _pad;)
  59 #endif
  60   } Data;
  61 
  62   union {
  63     intptr_t _next;
  64     Data     _data;
  65   };
  66  public:
  67   inline PromotedObject* next() const {
  68     assert(!((FreeChunk*)this)->is_free(), "Error");
  69     PromotedObject* res;
  70     if (UseCompressedOops) {
  71       // The next pointer is a compressed oop stored in the top 32 bits
  72       res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next);
  73     } else {
  74       res = (PromotedObject*)(_next & next_mask);
  75     }
  76     assert(oop(res)->is_oop_or_null(true /* ignore mark word */), err_msg("Not an oop? (" PTR_FORMAT ")", p2i(res)));
  77     return res;
  78   }
  79   inline void setNext(PromotedObject* x) {
  80     assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, "
  81            "or insufficient alignment of objects");
  82     if (UseCompressedOops) {
  83       assert(_data._narrow_next == 0, "Overwrite?");
  84       _data._narrow_next = oopDesc::encode_heap_oop(oop(x));
  85     } else {
  86       _next |= (intptr_t)x;
  87     }
  88     assert(!((FreeChunk*)this)->is_free(), "Error");
  89   }
  90   inline void setPromotedMark() {
  91     _next |= promoted_mask;
  92     assert(!((FreeChunk*)this)->is_free(), "Error");
  93   }
  94   inline bool hasPromotedMark() const {
  95     assert(!((FreeChunk*)this)->is_free(), "Error");
  96     return (_next & promoted_mask) == promoted_mask;