< prev index next >

src/hotspot/share/oops/oop.inline.hpp

Print this page




  44 // We need a separate file to avoid circular references
  45 
  46 markWord oopDesc::mark() const {
  47   uintptr_t v = HeapAccess<MO_VOLATILE>::load_at(as_oop(), mark_offset_in_bytes());
  48   return markWord(v);
  49 }
  50 
  51 markWord oopDesc::mark_raw() const {
  52   return Atomic::load(&_mark);
  53 }
  54 
  55 markWord* oopDesc::mark_addr_raw() const {
  56   return (markWord*) &_mark;
  57 }
  58 
  59 void oopDesc::set_mark(markWord m) {
  60   HeapAccess<MO_VOLATILE>::store_at(as_oop(), mark_offset_in_bytes(), m.value());
  61 }
  62 
  63 void oopDesc::set_mark_raw(markWord m) {
  64   Atomic::store(m, &_mark);
  65 }
  66 
  67 void oopDesc::set_mark_raw(HeapWord* mem, markWord m) {
  68   *(markWord*)(((char*)mem) + mark_offset_in_bytes()) = m;
  69 }
  70 
  71 void oopDesc::release_set_mark(markWord m) {
  72   HeapAccess<MO_RELEASE>::store_at(as_oop(), mark_offset_in_bytes(), m.value());
  73 }
  74 
  75 markWord oopDesc::cas_set_mark(markWord new_mark, markWord old_mark) {
  76   uintptr_t v = HeapAccess<>::atomic_cmpxchg_at(new_mark.value(), as_oop(), mark_offset_in_bytes(), old_mark.value());
  77   return markWord(v);
  78 }
  79 
  80 markWord oopDesc::cas_set_mark_raw(markWord new_mark, markWord old_mark, atomic_memory_order order) {
  81   return Atomic::cmpxchg(new_mark, &_mark, old_mark, order);
  82 }
  83 
  84 void oopDesc::init_mark() {




  44 // We need a separate file to avoid circular references
  45 
  46 markWord oopDesc::mark() const {
  47   uintptr_t v = HeapAccess<MO_VOLATILE>::load_at(as_oop(), mark_offset_in_bytes());
  48   return markWord(v);
  49 }
  50 
  51 markWord oopDesc::mark_raw() const {
  52   return Atomic::load(&_mark);
  53 }
  54 
  55 markWord* oopDesc::mark_addr_raw() const {
  56   return (markWord*) &_mark;
  57 }
  58 
  59 void oopDesc::set_mark(markWord m) {
  60   HeapAccess<MO_VOLATILE>::store_at(as_oop(), mark_offset_in_bytes(), m.value());
  61 }
  62 
  63 void oopDesc::set_mark_raw(markWord m) {
  64   Atomic::store(&_mark, m);
  65 }
  66 
  67 void oopDesc::set_mark_raw(HeapWord* mem, markWord m) {
  68   *(markWord*)(((char*)mem) + mark_offset_in_bytes()) = m;
  69 }
  70 
  71 void oopDesc::release_set_mark(markWord m) {
  72   HeapAccess<MO_RELEASE>::store_at(as_oop(), mark_offset_in_bytes(), m.value());
  73 }
  74 
  75 markWord oopDesc::cas_set_mark(markWord new_mark, markWord old_mark) {
  76   uintptr_t v = HeapAccess<>::atomic_cmpxchg_at(new_mark.value(), as_oop(), mark_offset_in_bytes(), old_mark.value());
  77   return markWord(v);
  78 }
  79 
  80 markWord oopDesc::cas_set_mark_raw(markWord new_mark, markWord old_mark, atomic_memory_order order) {
  81   return Atomic::cmpxchg(new_mark, &_mark, old_mark, order);
  82 }
  83 
  84 void oopDesc::init_mark() {


< prev index next >