--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp Tue Jan 29 11:30:17 2019 +0100
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp Tue Jan 29 10:23:38 2019 +0100
@@ -279,13 +279,13 @@
Register ref = stub->ref()->as_register();
Register ref_addr = noreg;
- if (stub->ref_addr()->is_register()) {
- // Address already in register
- ref_addr = stub->ref_addr()->as_pointer_register();
- } else {
+ if (stub->tmp()->is_valid()) {
// Load address into tmp register
ce->leal(stub->ref_addr(), stub->tmp());
ref_addr = stub->tmp()->as_pointer_register();
+ } else {
+ // Address already in register
+ ref_addr = stub->ref_addr()->as_address_ptr()->base()->as_pointer_register();
}
assert_different_registers(ref, ref_addr, noreg);
--- a/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp Tue Jan 29 11:30:17 2019 +0100
+++ b/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp Tue Jan 29 10:23:38 2019 +0100
@@ -38,21 +38,15 @@
_tmp(LIR_OprFact::illegalOpr),
_runtime_stub(runtime_stub) {
+ assert(_ref_addr->is_address(), "Must be an address");
+ assert(_ref->is_register(), "Must be a register");
+
// Allocate tmp register if needed
- if (!_ref_addr->is_register()) {
- assert(_ref_addr->is_address(), "Must be an address");
- if (_ref_addr->as_address_ptr()->index()->is_valid() ||
- _ref_addr->as_address_ptr()->disp() != 0) {
- // Has index or displacement, need tmp register to load address into
- _tmp = access.gen()->new_pointer_register();
- } else {
- // No index or displacement, address available in base register
- _ref_addr = _ref_addr->as_address_ptr()->base();
- }
+ if (_ref_addr->as_address_ptr()->index()->is_valid() ||
+ _ref_addr->as_address_ptr()->disp() != 0) {
+ // Has index or displacement, need tmp register to load address into
+ _tmp = access.gen()->new_pointer_register();
}
-
- assert(_ref->is_register(), "Must be a register");
- assert(_ref_addr->is_register() != _tmp->is_register(), "Only one should be a register");
}
DecoratorSet ZLoadBarrierStubC1::decorators() const {