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 // A nearby allocation?
53 const DecoratorSet C2_TIGHLY_COUPLED_ALLOC = DECORATOR_LAST << 9;
54 // Loads and stores from an arraycopy being optimized
55 const DecoratorSet C2_ARRAY_COPY = DECORATOR_LAST << 10;
56
57 class Compile;
58 class GraphKit;
59 class IdealKit;
60 class Node;
61 class Type;
62 class TypePtr;
63 class PhaseMacroExpand;
64
65 // This class wraps a node and a type.
66 class C2AccessValue: public StackObj {
67 protected:
68 Node* _node;
69 const Type* _type;
70
71 public:
72 C2AccessValue(Node* node, const Type* type) :
73 _node(node),
74 _type(type) {}
75
76 Node* node() const { return _node; }
77 const Type* type() const { return _type; }
78
79 void set_node(Node* node) { _node = node; }
80 };
81
82 // This class wraps a node and a pointer type.
83 class C2AccessValuePtr: public C2AccessValue {
274 // This could for example comprise macro nodes to be expanded during macro expansion.
275 virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
276 // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
277 // expanded later, then now is the time to do so.
278 virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
279
280 enum CompilePhase {
281 BeforeOptimize, /* post_parse = true */
282 BeforeExpand, /* post_parse = false */
283 BeforeCodeGen
284 };
285 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
286
287 virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
288 #ifdef ASSERT
289 virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
290 #endif
291
292 virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
293
294 };
295
296 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|
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 // A nearby allocation?
53 const DecoratorSet C2_TIGHLY_COUPLED_ALLOC = DECORATOR_LAST << 9;
54 // Loads and stores from an arraycopy being optimized
55 const DecoratorSet C2_ARRAY_COPY = DECORATOR_LAST << 10;
56
57 class Compile;
58 class ConnectionGraph;
59 class GraphKit;
60 class IdealKit;
61 class Node;
62 class PhaseGVN;
63 class PhaseMacroExpand;
64 class Type;
65 class TypePtr;
66 class Unique_Node_List;
67
68 // This class wraps a node and a type.
69 class C2AccessValue: public StackObj {
70 protected:
71 Node* _node;
72 const Type* _type;
73
74 public:
75 C2AccessValue(Node* node, const Type* type) :
76 _node(node),
77 _type(type) {}
78
79 Node* node() const { return _node; }
80 const Type* type() const { return _type; }
81
82 void set_node(Node* node) { _node = node; }
83 };
84
85 // This class wraps a node and a pointer type.
86 class C2AccessValuePtr: public C2AccessValue {
277 // This could for example comprise macro nodes to be expanded during macro expansion.
278 virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
279 // If the BarrierSetC2 state has kept macro nodes in its compilation unit state to be
280 // expanded later, then now is the time to do so.
281 virtual bool expand_macro_nodes(PhaseMacroExpand* macro) const { return false; }
282
283 enum CompilePhase {
284 BeforeOptimize, /* post_parse = true */
285 BeforeExpand, /* post_parse = false */
286 BeforeCodeGen
287 };
288 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
289
290 virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
291 #ifdef ASSERT
292 virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
293 #endif
294
295 virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
296
297 virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { return false; }
298 virtual bool escape_add_final_edges(ConnectionGraph* conn_graph, PhaseGVN* gvn, Node* n, uint opcode) const { return false; }
299 virtual bool escape_has_out_with_unsafe_object(Node* n) const { return false; }
300 virtual bool escape_is_barrier_node(Node* n) const { return false; }
301 };
302
303 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|