< prev index next >

src/hotspot/share/gc/shared/c1/barrierSetC1.cpp

Print this page

        

@@ -41,25 +41,30 @@
 LIR_Opr BarrierSetC1::resolve_address(LIRAccess& access, bool resolve_in_register) {
   DecoratorSet decorators = access.decorators();
   bool is_array = (decorators & IS_ARRAY) != 0;
   bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0;
 
-  LIRItem& base = access.base().item();
+  LIR_Opr base;
+  if (access.base().opr() != NULL) {
+    base = access.base().opr();
+  } else {
+    base = access.base().item().result();
+  }
   LIR_Opr offset = access.offset().opr();
   LIRGenerator *gen = access.gen();
 
   LIR_Opr addr_opr;
   if (is_array) {
-    addr_opr = LIR_OprFact::address(gen->emit_array_address(base.result(), offset, access.type()));
+    addr_opr = LIR_OprFact::address(gen->emit_array_address(base, offset, access.type()));
   } else if (needs_patching) {
     // we need to patch the offset in the instruction so don't allow
     // generate_address to try to be smart about emitting the -1.
     // Otherwise the patching code won't know how to find the
     // instruction to patch.
-    addr_opr = LIR_OprFact::address(new LIR_Address(base.result(), PATCHED_ADDR, access.type()));
+    addr_opr = LIR_OprFact::address(new LIR_Address(base, PATCHED_ADDR, access.type()));
   } else {
-    addr_opr = LIR_OprFact::address(gen->generate_address(base.result(), offset, 0, 0, access.type()));
+    addr_opr = LIR_OprFact::address(gen->generate_address(base, offset, 0, 0, access.type()));
   }
 
   if (resolve_in_register) {
     LIR_Opr resolved_addr = gen->new_pointer_register();
     __ leal(addr_opr, resolved_addr);

@@ -326,5 +331,13 @@
       __ cmp(lir_cond_equal, reference_type, LIR_OprFact::intConst(REF_NONE));
       __ branch(lir_cond_equal, T_INT, cont->label());
     }
   }
 }
+
+LIR_Opr BarrierSetC1::resolve_for_read(LIRAccess& access) {
+  return access.base().opr();
+}
+
+LIR_Opr BarrierSetC1::resolve_for_write(LIRAccess& access) {
+  return access.base().opr();
+}
< prev index next >