313 if (obj->cas_forward_to(obj, obj_mark)) {
314 // We won any races, we "own" this object.
315 assert(obj == obj->forwardee(), "Sanity");
316
317 _promotion_failed_info.register_copy_failure(obj->size());
318
319 obj->push_contents(this);
320
321 // Save the mark if needed
322 PSScavenge::oop_promotion_failed(obj, obj_mark);
323 } else {
324 // We lost, someone else "owns" this object
325 guarantee(obj->is_forwarded(), "Object must be forwarded if the cas failed.");
326
327 // No unallocation to worry about.
328 obj = obj->forwardee();
329 }
330
331 #ifndef PRODUCT
332 if (TraceScavenge) {
333 gclog_or_tty->print_cr("{%s %s 0x%x (%d)}",
334 "promotion-failure",
335 obj->klass()->internal_name(),
336 (void *)obj, obj->size());
337
338 }
339 #endif
340
341 return obj;
342 }
|
313 if (obj->cas_forward_to(obj, obj_mark)) {
314 // We won any races, we "own" this object.
315 assert(obj == obj->forwardee(), "Sanity");
316
317 _promotion_failed_info.register_copy_failure(obj->size());
318
319 obj->push_contents(this);
320
321 // Save the mark if needed
322 PSScavenge::oop_promotion_failed(obj, obj_mark);
323 } else {
324 // We lost, someone else "owns" this object
325 guarantee(obj->is_forwarded(), "Object must be forwarded if the cas failed.");
326
327 // No unallocation to worry about.
328 obj = obj->forwardee();
329 }
330
331 #ifndef PRODUCT
332 if (TraceScavenge) {
333 gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " (%d)}",
334 "promotion-failure",
335 obj->klass()->internal_name(),
336 (void *)obj, obj->size());
337
338 }
339 #endif
340
341 return obj;
342 }
|