21 * questions. 22 */ 23 24 #include "precompiled.hpp" 25 #include "c1/c1_LIR.hpp" 26 #include "c1/c1_LIRGenerator.hpp" 27 #include "c1/c1_CodeStubs.hpp" 28 #include "gc/z/c1/zBarrierSetC1.hpp" 29 #include "gc/z/zBarrierSet.hpp" 30 #include "gc/z/zBarrierSetAssembler.hpp" 31 #include "gc/z/zThreadLocalData.hpp" 32 #include "utilities/macros.hpp" 33 34 ZLoadBarrierStubC1::ZLoadBarrierStubC1(LIRAccess& access, LIR_Opr ref, address runtime_stub) : 35 _decorators(access.decorators()), 36 _ref_addr(access.resolved_addr()), 37 _ref(ref), 38 _tmp(LIR_OprFact::illegalOpr), 39 _runtime_stub(runtime_stub) { 40 41 // Allocate tmp register if needed 42 if (!_ref_addr->is_register()) { 43 assert(_ref_addr->is_address(), "Must be an address"); 44 if (_ref_addr->as_address_ptr()->index()->is_valid() || 45 _ref_addr->as_address_ptr()->disp() != 0) { 46 // Has index or displacement, need tmp register to load address into 47 _tmp = access.gen()->new_pointer_register(); 48 } else { 49 // No index or displacement, address available in base register 50 _ref_addr = _ref_addr->as_address_ptr()->base(); 51 } 52 } 53 54 assert(_ref->is_register(), "Must be a register"); 55 assert(_ref_addr->is_register() != _tmp->is_register(), "Only one should be a register"); 56 } 57 58 DecoratorSet ZLoadBarrierStubC1::decorators() const { 59 return _decorators; 60 } 61 62 LIR_Opr ZLoadBarrierStubC1::ref() const { 63 return _ref; 64 } 65 66 LIR_Opr ZLoadBarrierStubC1::ref_addr() const { 67 return _ref_addr; 68 } 69 70 LIR_Opr ZLoadBarrierStubC1::tmp() const { 71 return _tmp; 72 } 73 74 address ZLoadBarrierStubC1::runtime_stub() const { 75 return _runtime_stub; | 21 * questions. 22 */ 23 24 #include "precompiled.hpp" 25 #include "c1/c1_LIR.hpp" 26 #include "c1/c1_LIRGenerator.hpp" 27 #include "c1/c1_CodeStubs.hpp" 28 #include "gc/z/c1/zBarrierSetC1.hpp" 29 #include "gc/z/zBarrierSet.hpp" 30 #include "gc/z/zBarrierSetAssembler.hpp" 31 #include "gc/z/zThreadLocalData.hpp" 32 #include "utilities/macros.hpp" 33 34 ZLoadBarrierStubC1::ZLoadBarrierStubC1(LIRAccess& access, LIR_Opr ref, address runtime_stub) : 35 _decorators(access.decorators()), 36 _ref_addr(access.resolved_addr()), 37 _ref(ref), 38 _tmp(LIR_OprFact::illegalOpr), 39 _runtime_stub(runtime_stub) { 40 41 assert(_ref_addr->is_address(), "Must be an address"); 42 assert(_ref->is_register(), "Must be a register"); 43 44 // Allocate tmp register if needed 45 if (_ref_addr->as_address_ptr()->index()->is_valid() || 46 _ref_addr->as_address_ptr()->disp() != 0) { 47 // Has index or displacement, need tmp register to load address into 48 _tmp = access.gen()->new_pointer_register(); 49 } 50 } 51 52 DecoratorSet ZLoadBarrierStubC1::decorators() const { 53 return _decorators; 54 } 55 56 LIR_Opr ZLoadBarrierStubC1::ref() const { 57 return _ref; 58 } 59 60 LIR_Opr ZLoadBarrierStubC1::ref_addr() const { 61 return _ref_addr; 62 } 63 64 LIR_Opr ZLoadBarrierStubC1::tmp() const { 65 return _tmp; 66 } 67 68 address ZLoadBarrierStubC1::runtime_stub() const { 69 return _runtime_stub; |