8270041: Consolidate oopDesc::cas_forward_to() and oopDesc::forward_to_atomic()
Reviewed-by: stefank, kbarrett
This commit is contained in:
parent
b40e8f0f9e
commit
f4be211ae2
@ -351,7 +351,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markWord obj_mark) {
|
||||
// this started. If it is the same (i.e., no forwarding
|
||||
// pointer has been installed), then this thread owns
|
||||
// it.
|
||||
if (obj->cas_forward_to(obj, obj_mark)) {
|
||||
if (obj->forward_to_atomic(obj, obj_mark) == NULL) {
|
||||
// We won any races, we "own" this object.
|
||||
assert(obj == obj->forwardee(), "Sanity");
|
||||
|
||||
|
@ -246,7 +246,6 @@ class oopDesc {
|
||||
void verify_forwardee(oop forwardee) NOT_DEBUG_RETURN;
|
||||
|
||||
inline void forward_to(oop p);
|
||||
inline bool cas_forward_to(oop p, markWord compare, atomic_memory_order order = memory_order_conservative);
|
||||
|
||||
// Like "forward_to", but inserts the forwarding pointer atomically.
|
||||
// Exactly one thread succeeds in inserting the forwarding pointer, and
|
||||
|
@ -278,14 +278,6 @@ void oopDesc::forward_to(oop p) {
|
||||
set_mark(m);
|
||||
}
|
||||
|
||||
// Used by parallel scavengers
|
||||
bool oopDesc::cas_forward_to(oop p, markWord compare, atomic_memory_order order) {
|
||||
verify_forwardee(p);
|
||||
markWord m = markWord::encode_pointer_as_mark(p);
|
||||
assert(m.decode_pointer() == p, "encoding must be reversable");
|
||||
return cas_set_mark(m, compare, order) == compare;
|
||||
}
|
||||
|
||||
oop oopDesc::forward_to_atomic(oop p, markWord compare, atomic_memory_order order) {
|
||||
verify_forwardee(p);
|
||||
markWord m = markWord::encode_pointer_as_mark(p);
|
||||
|
Loading…
Reference in New Issue
Block a user