< prev index next >

src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp

Print this page

        

@@ -34,11 +34,10 @@
 ZLoadBarrierStubC1::ZLoadBarrierStubC1(LIRAccess& access, LIR_Opr ref, address runtime_stub) :
     _decorators(access.decorators()),
     _ref_addr(access.resolved_addr()),
     _ref(ref),
     _tmp(LIR_OprFact::illegalOpr),
-    _patch_info(access.patch_emit_info()),
     _runtime_stub(runtime_stub) {
 
   // Allocate tmp register if needed
   if (!_ref_addr->is_register()) {
     assert(_ref_addr->is_address(), "Must be an address");

@@ -70,32 +69,18 @@
 
 LIR_Opr ZLoadBarrierStubC1::tmp() const {
   return _tmp;
 }
 
-LIR_PatchCode ZLoadBarrierStubC1::patch_code() const {
-  return (_decorators & C1_NEEDS_PATCHING) != 0 ? lir_patch_normal : lir_patch_none;
-}
-
-CodeEmitInfo*& ZLoadBarrierStubC1::patch_info() {
-  return _patch_info;
-}
-
 address ZLoadBarrierStubC1::runtime_stub() const {
   return _runtime_stub;
 }
 
 void ZLoadBarrierStubC1::visit(LIR_OpVisitState* visitor) {
-  if (_patch_info != NULL) {
-    visitor->do_slow_case(_patch_info);
-  } else {
-    visitor->do_slow_case();
-  }
-
+  visitor->do_slow_case();
   visitor->do_input(_ref_addr);
   visitor->do_output(_ref);
-
   if (_tmp->is_valid()) {
     visitor->do_temp(_tmp);
   }
 }
 

@@ -172,10 +157,18 @@
   CodeStub* const stub = new ZLoadBarrierStubC1(access, result, runtime_stub);
   __ branch(lir_cond_notEqual, T_ADDRESS, stub);
   __ branch_destination(stub->continuation());
 }
 
+LIR_Opr ZBarrierSetC1::resolve_address(LIRAccess& access, bool resolve_in_register) {
+  // We must resolve in register when patching. This is to avoid
+  // having a patch area in the load barrier stub, since the call
+  // into the runtime to patch will not have the proper oop map.
+  const bool patch_before_barrier = barrier_needed(access) && (access.decorators() & C1_NEEDS_PATCHING) != 0;
+  return BarrierSetC1::resolve_address(access, resolve_in_register || patch_before_barrier);
+}
+
 #undef __
 
 void ZBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) {
   BarrierSetC1::load_at_resolved(access, result);
 
< prev index next >