< prev index next >

src/share/vm/opto/library_call.cpp

Print this page
rev 14419 : Remove obsolete and unused reduce-storeval-barrier optimization code.

@@ -2718,10 +2718,11 @@
     default:
       break;
     }
 
     if (type == T_OBJECT) {
+      val = shenandoah_storeval_barrier(val);
       store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type, mo, mismatched);
     } else {
       store_to_memory(control(), adr, val, type, adr_type, mo, requires_atomic_access, unaligned, mismatched);
     }
   }

@@ -3067,34 +3068,33 @@
     // could be delayed during Parse (for example, in adjust_map_after_if()).
     // Execute transformation here to avoid barrier generation in such case.
     if (_gvn.type(newval) == TypePtr::NULL_PTR)
       newval = _gvn.makecon(TypePtr::NULL_PTR);
 
+    newval = shenandoah_storeval_barrier(newval);
+
     // Reference stores need a store barrier.
     switch(kind) {
       case LS_get_set: {
         // If pre-barrier must execute before the oop store, old value will require do_load here.
         if (!can_move_pre_barrier()) {
-          newval = pre_barrier(true /* do_load*/,
+          pre_barrier(true /* do_load*/,
                       control(), base, adr, alias_idx, newval, value_type->make_oopptr(),
                       NULL /* pre_val*/,
                       T_OBJECT);
         } // Else move pre_barrier to use load_store value, see below.
-        else {
-          newval = shenandoah_storeval_barrier(newval);
-        }
         break;
       }
       case LS_cmp_swap_weak:
       case LS_cmp_swap:
       case LS_cmp_exchange: {
         // Same as for newval above:
         if (_gvn.type(oldval) == TypePtr::NULL_PTR) {
           oldval = _gvn.makecon(TypePtr::NULL_PTR);
         }
         // The only known value which might get overwritten is oldval.
-        newval = pre_barrier(false /* do_load */,
+        pre_barrier(false /* do_load */,
                     control(), NULL, adr, max_juint, newval, NULL,
                     oldval /* pre_val */,
                     T_OBJECT);
         break;
       }
< prev index next >