--- old/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp 2019-01-24 11:42:54.651168902 +0100 +++ new/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp 2019-01-24 11:42:54.363156507 +0100 @@ -36,7 +36,6 @@ _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 @@ -72,28 +71,14 @@ 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); } @@ -174,6 +159,14 @@ __ 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) {