< prev index next >

src/share/vm/gc/parallel/psScavenge.inline.hpp

Print this page

        

@@ -100,16 +100,14 @@
     assert(!psh->is_in_reserved(p), "GC barrier needed");
     if (PSScavenge::should_scavenge(p)) {
       assert(PSScavenge::should_scavenge(p, true), "revisiting object?");
 
       oop o = *p;
-      oop new_obj;
-      if (o->is_forwarded()) {
-        new_obj = o->forwardee();
-      } else {
-        new_obj = _pm->copy_to_survivor_space</*promote_immediately=*/false>(o);
+      if (!o->is_forwarded()) {
+         _pm->copy_to_survivor_space</*promote_immediately=*/false>(o);
       }
+      oop new_obj = o->forwardee();
       oopDesc::encode_store_heap_oop_not_null(p, new_obj);
 
       if (PSScavenge::is_obj_in_young(new_obj)) {
         do_klass_barrier();
       }
< prev index next >