< prev index next >

src/share/vm/gc/parallel/psPromotionManager.cpp

Print this page

        

@@ -487,26 +487,29 @@
   // Attempt to CAS in the header.
   // This tests if the header is still the same as when
   // this started.  If it is the same (i.e., no forwarding
   // pointer has been installed), then this thread owns
   // it.
-  if (obj->cas_forward_to(obj, obj_mark)) {
+  if (obj->cas_forward_to(obj, obj_mark, memory_order_relaxed)) {
     // We won any races, we "own" this object.
     assert(obj == obj->forwardee(), "Sanity");
 
     _promotion_failed_info.register_copy_failure(obj->size());
 
     push_contents(obj);
 
     _preserved_marks->push_if_necessary(obj, obj_mark);
+
+    log_develop_trace(gc, scavenge)("{promotion-failure %s " PTR_FORMAT " (%d)}", obj->klass()->internal_name(), p2i(obj), obj->size());
+
   }  else {
     // We lost, someone else "owns" this object
     guarantee(obj->is_forwarded(), "Object must be forwarded if the cas failed.");
 
+    log_develop_trace(gc, scavenge)("{promotion-failure %s " PTR_FORMAT "}", obj->klass()->internal_name(), p2i(obj));
+
     // No unallocation to worry about.
     obj = obj->forwardee();
   }
 
-  log_develop_trace(gc, scavenge)("{promotion-failure %s " PTR_FORMAT " (%d)}", obj->klass()->internal_name(), p2i(obj), obj->size());
-
   return obj;
 }
< prev index next >