33
34 // This means the access is mismatched. This means the value of an access
35 // is not equivalent to the value pointed to by the address.
36 const DecoratorSet C2_MISMATCHED = DECORATOR_LAST << 1;
37 // The access may not be aligned to its natural size.
38 const DecoratorSet C2_UNALIGNED = DECORATOR_LAST << 2;
39 // The atomic cmpxchg is weak, meaning that spurious false negatives are allowed,
40 // but never false positives.
41 const DecoratorSet C2_WEAK_CMPXCHG = DECORATOR_LAST << 3;
42 // This denotes that a load has control dependency.
43 const DecoratorSet C2_CONTROL_DEPENDENT_LOAD = DECORATOR_LAST << 4;
44 // This denotes that a load that must be pinned.
45 const DecoratorSet C2_PINNED_LOAD = DECORATOR_LAST << 5;
46 // This denotes that the access is produced from the sun.misc.Unsafe intrinsics.
47 const DecoratorSet C2_UNSAFE_ACCESS = DECORATOR_LAST << 6;
48 // This denotes that the access mutates state.
49 const DecoratorSet C2_WRITE_ACCESS = DECORATOR_LAST << 7;
50 // This denotes that the access reads state.
51 const DecoratorSet C2_READ_ACCESS = DECORATOR_LAST << 8;
52
53 class GraphKit;
54 class IdealKit;
55 class Node;
56 class Type;
57 class TypePtr;
58 class PhaseMacroExpand;
59
60 // This class wraps a node and a type.
61 class C2AccessValue: public StackObj {
62 protected:
63 Node* _node;
64 const Type* _type;
65
66 public:
67 C2AccessValue(Node* node, const Type* type) :
68 _node(node),
69 _type(type) {}
70
71 Node* node() const { return _node; }
72 const Type* type() const { return _type; }
206
207 // Support for GC barriers emitted during parsing
208 virtual bool has_load_barriers() const { return false; }
209 virtual bool is_gc_barrier_node(Node* node) const { return false; }
210 virtual Node* step_over_gc_barrier(Node* c) const { return c; }
211
212 // Support for macro expanded GC barriers
213 virtual void register_potential_barrier_node(Node* node) const { }
214 virtual void unregister_potential_barrier_node(Node* node) const { }
215 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
216 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
217 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
218 virtual void add_users_to_worklist(Unique_Node_List* worklist) const {}
219
220 // Allow barrier sets to have shared state that is preserved across a compilation unit.
221 // This could for example comprise macro nodes to be expanded during macro expansion.
222 virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
223 // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
224 // expanded later, then now is the time to do so.
225 virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
226 virtual void verify_gc_barriers(bool post_parse) const {}
227 };
228
229 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|
33
34 // This means the access is mismatched. This means the value of an access
35 // is not equivalent to the value pointed to by the address.
36 const DecoratorSet C2_MISMATCHED = DECORATOR_LAST << 1;
37 // The access may not be aligned to its natural size.
38 const DecoratorSet C2_UNALIGNED = DECORATOR_LAST << 2;
39 // The atomic cmpxchg is weak, meaning that spurious false negatives are allowed,
40 // but never false positives.
41 const DecoratorSet C2_WEAK_CMPXCHG = DECORATOR_LAST << 3;
42 // This denotes that a load has control dependency.
43 const DecoratorSet C2_CONTROL_DEPENDENT_LOAD = DECORATOR_LAST << 4;
44 // This denotes that a load that must be pinned.
45 const DecoratorSet C2_PINNED_LOAD = DECORATOR_LAST << 5;
46 // This denotes that the access is produced from the sun.misc.Unsafe intrinsics.
47 const DecoratorSet C2_UNSAFE_ACCESS = DECORATOR_LAST << 6;
48 // This denotes that the access mutates state.
49 const DecoratorSet C2_WRITE_ACCESS = DECORATOR_LAST << 7;
50 // This denotes that the access reads state.
51 const DecoratorSet C2_READ_ACCESS = DECORATOR_LAST << 8;
52
53 class Compile;
54 class GraphKit;
55 class IdealKit;
56 class Node;
57 class Type;
58 class TypePtr;
59 class PhaseMacroExpand;
60
61 // This class wraps a node and a type.
62 class C2AccessValue: public StackObj {
63 protected:
64 Node* _node;
65 const Type* _type;
66
67 public:
68 C2AccessValue(Node* node, const Type* type) :
69 _node(node),
70 _type(type) {}
71
72 Node* node() const { return _node; }
73 const Type* type() const { return _type; }
207
208 // Support for GC barriers emitted during parsing
209 virtual bool has_load_barriers() const { return false; }
210 virtual bool is_gc_barrier_node(Node* node) const { return false; }
211 virtual Node* step_over_gc_barrier(Node* c) const { return c; }
212
213 // Support for macro expanded GC barriers
214 virtual void register_potential_barrier_node(Node* node) const { }
215 virtual void unregister_potential_barrier_node(Node* node) const { }
216 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
217 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
218 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
219 virtual void add_users_to_worklist(Unique_Node_List* worklist) const {}
220
221 // Allow barrier sets to have shared state that is preserved across a compilation unit.
222 // This could for example comprise macro nodes to be expanded during macro expansion.
223 virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
224 // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
225 // expanded later, then now is the time to do so.
226 virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
227
228 enum CompilePhase {
229 BeforeOptimize, /* post_parse = true */
230 BeforeExpand, /* post_parse = false */
231 BeforeCodeGen
232 };
233 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
234 };
235
236 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|