mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8154736: enhancement of cmpxchg and copy_to_survivor for ppc64
Reviewed-by: eosterlund, mdoerr, kbarrett
This commit is contained in:
parent
e4fc10b3c0
commit
1213297257
3 changed files with 21 additions and 9 deletions
|
@ -71,8 +71,8 @@ markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
|
|||
return HeapAccess<>::atomic_cmpxchg_at(new_mark, as_oop(), mark_offset_in_bytes(), old_mark);
|
||||
}
|
||||
|
||||
markOop oopDesc::cas_set_mark_raw(markOop new_mark, markOop old_mark) {
|
||||
return Atomic::cmpxchg(new_mark, &_mark, old_mark);
|
||||
markOop oopDesc::cas_set_mark_raw(markOop new_mark, markOop old_mark, atomic_memory_order order) {
|
||||
return Atomic::cmpxchg(new_mark, &_mark, old_mark, order);
|
||||
}
|
||||
|
||||
void oopDesc::init_mark() {
|
||||
|
@ -342,14 +342,14 @@ void oopDesc::forward_to(oop p) {
|
|||
}
|
||||
|
||||
// Used by parallel scavengers
|
||||
bool oopDesc::cas_forward_to(oop p, markOop compare) {
|
||||
bool oopDesc::cas_forward_to(oop p, markOop compare, atomic_memory_order order) {
|
||||
assert(check_obj_alignment(p),
|
||||
"forwarding to something not aligned");
|
||||
assert(Universe::heap()->is_in_reserved(p),
|
||||
"forwarding to something not in heap");
|
||||
markOop m = markOopDesc::encode_pointer_as_mark(p);
|
||||
assert(m->decode_pointer() == p, "encoding must be reversable");
|
||||
return cas_set_mark_raw(m, compare) == compare;
|
||||
return cas_set_mark_raw(m, compare, order) == compare;
|
||||
}
|
||||
|
||||
oop oopDesc::forward_to_atomic(oop p) {
|
||||
|
@ -381,6 +381,14 @@ oop oopDesc::forwardee() const {
|
|||
return (oop) mark_raw()->decode_pointer();
|
||||
}
|
||||
|
||||
// Note that the forwardee is not the same thing as the displaced_mark.
|
||||
// The forwardee is used when copying during scavenge and mark-sweep.
|
||||
// It does need to clear the low two locking- and GC-related bits.
|
||||
oop oopDesc::forwardee_acquire() const {
|
||||
markOop m = OrderAccess::load_acquire(&_mark);
|
||||
return (oop) m->decode_pointer();
|
||||
}
|
||||
|
||||
// The following method needs to be MT safe.
|
||||
uint oopDesc::age() const {
|
||||
assert(!is_forwarded(), "Attempt to read age from forwarded mark");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue