// Sets f1, ordering with previous writes. void ConstantPoolCacheEntry::release_set_f1(oop f1) { // Use barriers as in oop_store assert(f1 != NULL, ""); oop* f1_addr = (oop*) &_f1; update_barrier_set_pre(f1_addr, f1); OrderAccess::release_store_ptr((intptr_t*)f1_addr, f1); update_barrier_set((void*) f1_addr, f1); }
template <class T> inline void oop_store(T* p, oop v) { if (always_do_update_barrier) { oop_store((volatile T*)p, v); } else { update_barrier_set_pre(p, v); oopDesc::encode_store_heap_oop(p, v); update_barrier_set(p, v); } }
template <class T> void oop_store(volatile T* p, oop v) { update_barrier_set_pre((T*)p, v); // cast away volatile // Used by release_obj_field_put, so use release_store_ptr. oopDesc::release_encode_store_heap_oop(p, v); // When using CMS we must mark the card corresponding to p as dirty // with release sematics to prevent that CMS sees the dirty card but // not the new value v at p due to reordering of the two // stores. Note that CMS has a concurrent precleaning phase, where // it reads the card table while the Java threads are running. update_barrier_set((void*)p, v, true /* release */); // cast away type }
template <class T> void oop_store(T* p, oop v) { if (always_do_update_barrier) { oop_store((volatile T*)p, v); } else { update_barrier_set_pre(p, v); oopDesc::encode_store_heap_oop(p, v); // always_do_update_barrier == false => // Either we are at a safepoint (in GC) or CMS is not used. In both // cases it's unnecessary to mark the card as dirty with release sematics. update_barrier_set((void*)p, v, false /* release */); // cast away type } }
template <class T> inline void oop_store(volatile T* p, oop v) { update_barrier_set_pre((void*)p, v); // Used by release_obj_field_put, so use release_store_ptr. oopDesc::release_encode_store_heap_oop(p, v); update_barrier_set((void*)p, v); }