src/hotspot/share/gc/cms/parNewGeneration.cpp
changeset 52271 1587306fe23f
parent 51332 c25572739e7c
child 52480 4c5d48f3bc84
equal deleted inserted replaced
52270:487bd00f4ea8 52271:1587306fe23f
  1116   if (new_obj == NULL) {
  1116   if (new_obj == NULL) {
  1117     // Either to-space is full or we decided to promote try allocating obj tenured
  1117     // Either to-space is full or we decided to promote try allocating obj tenured
  1118 
  1118 
  1119     // Attempt to install a null forwarding pointer (atomically),
  1119     // Attempt to install a null forwarding pointer (atomically),
  1120     // to claim the right to install the real forwarding pointer.
  1120     // to claim the right to install the real forwarding pointer.
  1121     forward_ptr = old->forward_to_atomic(ClaimedForwardPtr);
  1121     forward_ptr = old->forward_to_atomic(ClaimedForwardPtr, m);
  1122     if (forward_ptr != NULL) {
  1122     if (forward_ptr != NULL) {
  1123       // someone else beat us to it.
  1123       // someone else beat us to it.
  1124         return real_forwardee(old);
  1124         return real_forwardee(old);
  1125     }
  1125     }
  1126 
  1126 
  1142     forward_ptr = NULL;
  1142     forward_ptr = NULL;
  1143   } else {
  1143   } else {
  1144     // Is in to-space; do copying ourselves.
  1144     // Is in to-space; do copying ourselves.
  1145     Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
  1145     Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz);
  1146     assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
  1146     assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value.");
  1147     forward_ptr = old->forward_to_atomic(new_obj);
  1147     forward_ptr = old->forward_to_atomic(new_obj, m);
  1148     // Restore the mark word copied above.
  1148     // Restore the mark word copied above.
  1149     new_obj->set_mark_raw(m);
  1149     new_obj->set_mark_raw(m);
  1150     // Increment age if obj still in new generation
  1150     // Increment age if obj still in new generation
  1151     new_obj->incr_age();
  1151     new_obj->incr_age();
  1152     par_scan_state->age_table()->add(new_obj, sz);
  1152     par_scan_state->age_table()->add(new_obj, sz);