< prev index next >
src/hotspot/share/gc/z/zBarrier.inline.hpp
Print this page
*** 35,45 ****
uintptr_t addr = ZOop::to_address(o);
retry:
// Fast path
if (fast_path(addr)) {
! return ZOop::from_address(addr);
}
// Slow path
const uintptr_t good_addr = slow_path(addr);
--- 35,45 ----
uintptr_t addr = ZOop::to_address(o);
retry:
// Fast path
if (fast_path(addr)) {
! return ZOop::to_oop(addr);
}
// Slow path
const uintptr_t good_addr = slow_path(addr);
*** 54,75 ****
addr = prev_addr;
goto retry;
}
}
! return ZOop::from_address(good_addr);
}
template <ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path>
inline oop ZBarrier::weak_barrier(volatile oop* p, oop o) {
const uintptr_t addr = ZOop::to_address(o);
// Fast path
if (fast_path(addr)) {
// Return the good address instead of the weak good address
// to ensure that the currently active heap view is used.
! return ZOop::from_address(ZAddress::good_or_null(addr));
}
// Slow path
uintptr_t good_addr = slow_path(addr);
--- 54,75 ----
addr = prev_addr;
goto retry;
}
}
! return ZOop::to_oop(good_addr);
}
template <ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path>
inline oop ZBarrier::weak_barrier(volatile oop* p, oop o) {
const uintptr_t addr = ZOop::to_address(o);
// Fast path
if (fast_path(addr)) {
// Return the good address instead of the weak good address
// to ensure that the currently active heap view is used.
! return ZOop::to_oop(ZAddress::good_or_null(addr));
}
// Slow path
uintptr_t good_addr = slow_path(addr);
*** 93,103 ****
// to ensure that the currently active heap view is used.
good_addr = ZAddress::good_or_null(prev_addr);
}
}
! return ZOop::from_address(good_addr);
}
template <ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path>
inline void ZBarrier::root_barrier(oop* p, oop o) {
const uintptr_t addr = ZOop::to_address(o);
--- 93,103 ----
// to ensure that the currently active heap view is used.
good_addr = ZAddress::good_or_null(prev_addr);
}
}
! return ZOop::to_oop(good_addr);
}
template <ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path>
inline void ZBarrier::root_barrier(oop* p, oop o) {
const uintptr_t addr = ZOop::to_address(o);
*** 115,125 ****
// which ensures we are never racing with mutators modifying roots while
// we are healing them. It's also safe in case multiple GC threads try
// to heal the same root if it is aligned, since they would always heal
// the root in the same way and it does not matter in which order it
// happens. For misaligned oops, there needs to be mutual exclusion.
! *p = ZOop::from_address(good_addr);
}
inline bool ZBarrier::is_null_fast_path(uintptr_t addr) {
return ZAddress::is_null(addr);
}
--- 115,125 ----
// which ensures we are never racing with mutators modifying roots while
// we are healing them. It's also safe in case multiple GC threads try
// to heal the same root if it is aligned, since they would always heal
// the root in the same way and it does not matter in which order it
// happens. For misaligned oops, there needs to be mutual exclusion.
! *p = ZOop::to_oop(good_addr);
}
inline bool ZBarrier::is_null_fast_path(uintptr_t addr) {
return ZAddress::is_null(addr);
}
< prev index next >