282 if (forwardee == nullptr) { // forwardee is null when forwarding is successful
283 // We won any races, we "own" this object.
284 oop new_obj = cast_to_oop(new_obj_addr);
285 assert(new_obj == o->forwardee(), "Sanity");
286
287 // Increment age if obj still in new generation. Now that
288 // we're dealing with a markWord that cannot change, it is
289 // okay to use the non mt safe oop methods.
290 if (!new_obj_is_tenured) {
291 new_obj->incr_age();
292 assert(young_space()->contains(new_obj), "Attempt to push non-promoted obj");
293 }
294
295 ContinuationGCSupport::transform_stack_chunk(new_obj);
296
297 // Do the size comparison first with new_obj_size, which we
298 // already have. Hopefully, only a few objects are larger than
299 // _min_array_size_for_chunking, and most of them will be arrays.
300 // So, the objArray test would be very infrequent.
301 if (new_obj_size > _min_array_size_for_chunking &&
302 klass->is_objArray_klass()) {
303 push_objArray(o, new_obj);
304 } else {
305 // we'll just push its contents
306 push_contents(new_obj);
307
308 if (StringDedup::is_enabled_string(klass) &&
309 psStringDedup::is_candidate_from_evacuation(new_obj, new_obj_is_tenured)) {
310 _string_dedup_requests.add(o);
311 }
312 }
313 return new_obj;
314 } else {
315 // We lost, someone else "owns" this object.
316 assert(o->is_forwarded(), "Object must be forwarded if the cas failed.");
317 assert(o->forwardee() == forwardee, "invariant");
318
319 if (new_obj_is_tenured) {
320 _old_lab.unallocate_object(new_obj_addr, new_obj_size);
321 } else {
322 _young_lab.unallocate_object(new_obj_addr, new_obj_size);
|
282 if (forwardee == nullptr) { // forwardee is null when forwarding is successful
283 // We won any races, we "own" this object.
284 oop new_obj = cast_to_oop(new_obj_addr);
285 assert(new_obj == o->forwardee(), "Sanity");
286
287 // Increment age if obj still in new generation. Now that
288 // we're dealing with a markWord that cannot change, it is
289 // okay to use the non mt safe oop methods.
290 if (!new_obj_is_tenured) {
291 new_obj->incr_age();
292 assert(young_space()->contains(new_obj), "Attempt to push non-promoted obj");
293 }
294
295 ContinuationGCSupport::transform_stack_chunk(new_obj);
296
297 // Do the size comparison first with new_obj_size, which we
298 // already have. Hopefully, only a few objects are larger than
299 // _min_array_size_for_chunking, and most of them will be arrays.
300 // So, the objArray test would be very infrequent.
301 if (new_obj_size > _min_array_size_for_chunking &&
302 klass->is_refArray_klass()) {
303 push_objArray(o, new_obj);
304 } else {
305 // we'll just push its contents
306 push_contents(new_obj);
307
308 if (StringDedup::is_enabled_string(klass) &&
309 psStringDedup::is_candidate_from_evacuation(new_obj, new_obj_is_tenured)) {
310 _string_dedup_requests.add(o);
311 }
312 }
313 return new_obj;
314 } else {
315 // We lost, someone else "owns" this object.
316 assert(o->is_forwarded(), "Object must be forwarded if the cas failed.");
317 assert(o->forwardee() == forwardee, "invariant");
318
319 if (new_obj_is_tenured) {
320 _old_lab.unallocate_object(new_obj_addr, new_obj_size);
321 } else {
322 _young_lab.unallocate_object(new_obj_addr, new_obj_size);
|