< prev index next >

src/share/vm/opto/parse3.cpp

Print this page

        

@@ -34,10 +34,14 @@
 #include "opto/runtime.hpp"
 #include "opto/subnode.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/handles.inline.hpp"
 
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/shenandoah/c2/shenandoahBarrierSetC2.hpp"
+#endif
+
 //=============================================================================
 // Helper methods for _get* and _put* bytecodes
 //=============================================================================
 bool Parse::static_field_ok_in_clinit(ciField *field, ciMethod *method) {
   // Could be the field_holder's <clinit> method, or <clinit> for a subklass.

@@ -234,10 +238,17 @@
   // Build the load.
   //
   MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
   Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol);
 
+  Node* load = ld;
+#if INCLUDE_ALL_GCS
+  if (UseShenandoahGC && (bt == T_OBJECT || bt == T_ARRAY)) {
+    ld = ShenandoahBarrierSetC2::bsc2()->load_reference_barrier(this, ld);
+  }
+#endif
+
   // Adjust Java stack
   if (type2size[bt] == 1)
     push(ld);
   else
     push_pair(ld);

@@ -272,11 +283,11 @@
   // floating up past the volatile read.  Also prevents commoning
   // another volatile read.
   if (field->is_volatile()) {
     // Memory barrier includes bogus read of value to force load BEFORE membar
     assert(leading_membar == NULL || support_IRIW_for_not_multiple_copy_atomic_cpu, "no leading membar expected");
-    Node* mb = insert_mem_bar(Op_MemBarAcquire, ld);
+    Node* mb = insert_mem_bar(Op_MemBarAcquire, load);
     mb->as_MemBar()->set_trailing_load();
   }
 }
 
 void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {
< prev index next >