< prev index next >
src/hotspot/share/gc/cms/parNewGeneration.cpp
Print this page
rev 52211 : [mq]: 8212753-improve-forward-to-atomic
*** 1116,1126 ****
if (new_obj == NULL) {
// Either to-space is full or we decided to promote try allocating obj tenured
// Attempt to install a null forwarding pointer (atomically),
// to claim the right to install the real forwarding pointer.
! forward_ptr = old->forward_to_atomic(ClaimedForwardPtr);
if (forward_ptr != NULL) {
// someone else beat us to it.
return real_forwardee(old);
}
--- 1116,1126 ----
if (new_obj == NULL) {
// Either to-space is full or we decided to promote try allocating obj tenured
// Attempt to install a null forwarding pointer (atomically),
// to claim the right to install the real forwarding pointer.
! forward_ptr = old->forward_to_atomic(ClaimedForwardPtr, m);
if (forward_ptr != NULL) {
// someone else beat us to it.
return real_forwardee(old);
}
*** 1142,1152 ****
forward_ptr = NULL;
} else {
// Is in to-space; do copying ourselves.
Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
! forward_ptr = old->forward_to_atomic(new_obj);
// Restore the mark word copied above.
new_obj->set_mark_raw(m);
// Increment age if obj still in new generation
new_obj->incr_age();
par_scan_state->age_table()->add(new_obj, sz);
--- 1142,1152 ----
forward_ptr = NULL;
} else {
// Is in to-space; do copying ourselves.
Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
! forward_ptr = old->forward_to_atomic(new_obj, m);
// Restore the mark word copied above.
new_obj->set_mark_raw(m);
// Increment age if obj still in new generation
new_obj->incr_age();
par_scan_state->age_table()->add(new_obj, sz);
< prev index next >