74 void set_node(Node* node) { _node = node; } |
74 void set_node(Node* node) { _node = node; } |
75 }; |
75 }; |
76 |
76 |
77 // This class wraps a node and a pointer type. |
77 // This class wraps a node and a pointer type. |
78 class C2AccessValuePtr: public C2AccessValue { |
78 class C2AccessValuePtr: public C2AccessValue { |
79 int _alias_idx; |
|
80 |
79 |
81 public: |
80 public: |
82 C2AccessValuePtr(Node* node, const TypePtr* type) : |
81 C2AccessValuePtr(Node* node, const TypePtr* type) : |
83 C2AccessValue(node, reinterpret_cast<const Type*>(type)) {} |
82 C2AccessValue(node, reinterpret_cast<const Type*>(type)) {} |
84 |
83 |
85 const TypePtr* type() const { return reinterpret_cast<const TypePtr*>(_type); } |
84 const TypePtr* type() const { return reinterpret_cast<const TypePtr*>(_type); } |
86 int alias_idx() const { return _alias_idx; } |
|
87 }; |
85 }; |
88 |
86 |
89 // This class wraps a bunch of context parameters thare are passed around in the |
87 // This class wraps a bunch of context parameters thare are passed around in the |
90 // BarrierSetC2 backend hierarchy, for loads and stores, to reduce boiler plate. |
88 // BarrierSetC2 backend hierarchy, for loads and stores, to reduce boiler plate. |
91 class C2Access: public StackObj { |
89 class C2Access: public StackObj { |
173 Node* new_val, const Type* val_type) const; |
171 Node* new_val, const Type* val_type) const; |
174 virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val, |
172 virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val, |
175 Node* new_val, const Type* value_type) const; |
173 Node* new_val, const Type* value_type) const; |
176 virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const; |
174 virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const; |
177 virtual Node* atomic_add_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const; |
175 virtual Node* atomic_add_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* val_type) const; |
|
176 void pin_atomic_op(C2AtomicAccess& access) const; |
178 |
177 |
179 public: |
178 public: |
180 // This is the entry-point for the backend to perform accesses through the Access API. |
179 // This is the entry-point for the backend to perform accesses through the Access API. |
181 virtual Node* store_at(C2Access& access, C2AccessValue& val) const; |
180 virtual Node* store_at(C2Access& access, C2AccessValue& val) const; |
182 virtual Node* load_at(C2Access& access, const Type* val_type) const; |
181 virtual Node* load_at(C2Access& access, const Type* val_type) const; |