75 LIRAccess(LIRGenerator* gen, DecoratorSet decorators, 76 LIRAddressOpr base, LIRAddressOpr offset, BasicType type, 77 CodeEmitInfo* patch_emit_info = NULL, CodeEmitInfo* access_emit_info = NULL) : 78 _gen(gen), 79 _decorators(AccessInternal::decorator_fixup(decorators)), 80 _base(base), 81 _offset(offset), 82 _type(type), 83 _resolved_addr(NULL), 84 _patch_emit_info(patch_emit_info), 85 _access_emit_info(access_emit_info) {} 86 87 void load_base() { _base.item().load_item(); } 88 void load_offset() { _offset.item().load_nonconstant(); } 89 90 void load_address() { 91 load_base(); 92 load_offset(); 93 } 94 95 LIRGenerator* gen() const { return _gen; } 96 CodeEmitInfo*& patch_emit_info() { return _patch_emit_info; } 97 CodeEmitInfo*& access_emit_info() { return _access_emit_info; } 98 LIRAddressOpr& base() { return _base; } 99 LIRAddressOpr& offset() { return _offset; } 100 BasicType type() const { return _type; } 101 LIR_Opr resolved_addr() const { return _resolved_addr; } 102 void set_resolved_addr(LIR_Opr addr) { _resolved_addr = addr; } 103 bool is_oop() const { return _type == T_ARRAY || _type == T_OBJECT; } 104 DecoratorSet decorators() const { return _decorators; } 105 bool is_raw() const { return (_decorators & AS_RAW) != 0; } 106 }; 107 108 // The BarrierSetC1 class is the main entry point for the GC backend of the Access API in C1. 109 // It is called by the LIRGenerator::access_* functions, which is the main entry poing for 110 // access calls in C1. 111 112 class BarrierSetC1: public CHeapObj<mtGC> { 113 protected: 114 virtual LIR_Opr resolve_address(LIRAccess& access, bool resolve_in_register); 115 116 virtual void generate_referent_check(LIRAccess& access, LabelObj* cont); 117 118 // Accesses with resolved address 119 virtual void store_at_resolved(LIRAccess& access, LIR_Opr value); 120 virtual void load_at_resolved(LIRAccess& access, LIR_Opr result); 121 122 virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value); 123 124 virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value); 125 virtual LIR_Opr atomic_add_at_resolved(LIRAccess& access, LIRItem& value); | 75 LIRAccess(LIRGenerator* gen, DecoratorSet decorators, 76 LIRAddressOpr base, LIRAddressOpr offset, BasicType type, 77 CodeEmitInfo* patch_emit_info = NULL, CodeEmitInfo* access_emit_info = NULL) : 78 _gen(gen), 79 _decorators(AccessInternal::decorator_fixup(decorators)), 80 _base(base), 81 _offset(offset), 82 _type(type), 83 _resolved_addr(NULL), 84 _patch_emit_info(patch_emit_info), 85 _access_emit_info(access_emit_info) {} 86 87 void load_base() { _base.item().load_item(); } 88 void load_offset() { _offset.item().load_nonconstant(); } 89 90 void load_address() { 91 load_base(); 92 load_offset(); 93 } 94 95 LIRGenerator* gen() const { return _gen; } 96 CodeEmitInfo*& patch_emit_info() { return _patch_emit_info; } 97 CodeEmitInfo*& access_emit_info() { return _access_emit_info; } 98 LIRAddressOpr& base() { return _base; } 99 LIRAddressOpr& offset() { return _offset; } 100 BasicType type() const { return _type; } 101 LIR_Opr resolved_addr() const { return _resolved_addr; } 102 void set_resolved_addr(LIR_Opr addr) { _resolved_addr = addr; } 103 bool is_oop() const { return _type == T_ARRAY || _type == T_OBJECT; } 104 DecoratorSet decorators() const { return _decorators; } 105 void clear_decorators(DecoratorSet ds) { _decorators &= ~ds; } 106 bool is_raw() const { return (_decorators & AS_RAW) != 0; } 107 }; 108 109 // The BarrierSetC1 class is the main entry point for the GC backend of the Access API in C1. 110 // It is called by the LIRGenerator::access_* functions, which is the main entry poing for 111 // access calls in C1. 112 113 class BarrierSetC1: public CHeapObj<mtGC> { 114 protected: 115 virtual LIR_Opr resolve_address(LIRAccess& access, bool resolve_in_register); 116 117 virtual void generate_referent_check(LIRAccess& access, LabelObj* cont); 118 119 // Accesses with resolved address 120 virtual void store_at_resolved(LIRAccess& access, LIR_Opr value); 121 virtual void load_at_resolved(LIRAccess& access, LIR_Opr result); 122 123 virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value); 124 125 virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value); 126 virtual LIR_Opr atomic_add_at_resolved(LIRAccess& access, LIRItem& value); |