242 virtual Node* atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
243
244 virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
245
246 virtual Node* resolve(GraphKit* kit, Node* n, DecoratorSet decorators) const { return n; }
247
248 virtual Node* obj_allocate(PhaseMacroExpand* macro, Node* ctrl, Node* mem, Node* toobig_false, Node* size_in_bytes,
249 Node*& i_o, Node*& needgc_ctrl,
250 Node*& fast_oop_ctrl, Node*& fast_oop_rawmem,
251 intx prefetch_lines) const;
252
253 virtual Node* ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { return NULL; }
254 virtual Node* identity_node(PhaseGVN* phase, Node* n) const { return n; }
255
256 // These are general helper methods used by C2
257 enum ArrayCopyPhase {
258 Parsing,
259 Optimization,
260 Expansion
261 };
262 virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { return false; }
263 virtual void clone_barrier_at_expansion(ArrayCopyNode* ac, Node* call, PhaseIterGVN& igvn) const;
264
265 // Support for GC barriers emitted during parsing
266 virtual bool has_load_barriers() const { return false; }
267 virtual bool is_gc_barrier_node(Node* node) const { return false; }
268 virtual Node* step_over_gc_barrier(Node* c) const { return c; }
269
270 // Support for macro expanded GC barriers
271 virtual void register_potential_barrier_node(Node* node) const { }
272 virtual void unregister_potential_barrier_node(Node* node) const { }
273 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
274 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
275 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
276 virtual void add_users_to_worklist(Unique_Node_List* worklist) const {}
277
278 // Allow barrier sets to have shared state that is preserved across a compilation unit.
279 // This could for example comprise macro nodes to be expanded during macro expansion.
280 virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
281 // If the BarrierSetC2 state has barrier nodes in its compilation
282 // unit state to be expanded later, then now is the time to do so.
283 virtual bool expand_barriers(Compile* C, PhaseIterGVN& igvn) const { return false; }
284 virtual bool optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { return false; }
285 virtual bool strip_mined_loops_expanded(LoopOptsMode mode) const { return false; }
286 virtual bool is_gc_specific_loop_opts_pass(LoopOptsMode mode) const { return false; }
287
288 virtual bool has_special_unique_user(const Node* node) const { return false; }
289
290 enum CompilePhase {
291 BeforeOptimize, /* post_parse = true */
292 BeforeExpand, /* post_parse = false */
293 BeforeCodeGen
294 };
295 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
296
297 virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
298 #ifdef ASSERT
299 virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
300 #endif
301
302 virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
303
304 virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { return false; }
305 virtual bool escape_add_final_edges(ConnectionGraph* conn_graph, PhaseGVN* gvn, Node* n, uint opcode) const { return false; }
306 virtual bool escape_has_out_with_unsafe_object(Node* n) const { return false; }
307 virtual bool escape_is_barrier_node(Node* n) const { return false; }
308
309 virtual bool matcher_find_shared_visit(Matcher* matcher, Matcher::MStack& mstack, Node* n, uint opcode, bool& mem_op, int& mem_addr_idx) const { return false; };
310 virtual bool matcher_find_shared_post_visit(Matcher* matcher, Node* n, uint opcode) const { return false; };
311 virtual bool matcher_is_store_load_barrier(Node* x, uint xop) const { return false; }
312
313 virtual void igvn_add_users_to_worklist(PhaseIterGVN* igvn, Node* use) const {}
314 virtual void ccp_analyze(PhaseCCP* ccp, Unique_Node_List& worklist, Node* use) const {}
315
316 virtual Node* split_if_pre(PhaseIdealLoop* phase, Node* n) const { return NULL; }
317 virtual bool build_loop_late_post(PhaseIdealLoop* phase, Node* n) const { return false; }
318 virtual bool sink_node(PhaseIdealLoop* phase, Node* n, Node* x, Node* x_ctrl, Node* n_ctrl) const { return false; }
319 };
320
321 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|
242 virtual Node* atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
243
244 virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
245
246 virtual Node* resolve(GraphKit* kit, Node* n, DecoratorSet decorators) const { return n; }
247
248 virtual Node* obj_allocate(PhaseMacroExpand* macro, Node* ctrl, Node* mem, Node* toobig_false, Node* size_in_bytes,
249 Node*& i_o, Node*& needgc_ctrl,
250 Node*& fast_oop_ctrl, Node*& fast_oop_rawmem,
251 intx prefetch_lines) const;
252
253 virtual Node* ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { return NULL; }
254 virtual Node* identity_node(PhaseGVN* phase, Node* n) const { return n; }
255
256 // These are general helper methods used by C2
257 enum ArrayCopyPhase {
258 Parsing,
259 Optimization,
260 Expansion
261 };
262
263 virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { return false; }
264 virtual void clone_barrier_at_expansion(ArrayCopyNode* ac, Node* call, PhaseIterGVN& igvn) const;
265
266 // Support for GC barriers emitted during parsing
267 virtual bool has_load_barriers() const { return false; }
268 virtual bool is_gc_barrier_node(Node* node) const { return false; }
269 virtual Node* step_over_gc_barrier(Node* c) const { return c; }
270
271 // Support for macro expanded GC barriers
272 virtual void register_potential_barrier_node(Node* node) const { }
273 virtual void unregister_potential_barrier_node(Node* node) const { }
274 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
275 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
276 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
277
278 // Allow barrier sets to have shared state that is preserved across a compilation unit.
279 // This could for example comprise macro nodes to be expanded during macro expansion.
280 virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
281 // If the BarrierSetC2 state has barrier nodes in its compilation
282 // unit state to be expanded later, then now is the time to do so.
283 virtual bool expand_barriers(Compile* C, PhaseIterGVN& igvn) const { return false; }
284 virtual bool optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { return false; }
285 virtual bool strip_mined_loops_expanded(LoopOptsMode mode) const { return false; }
286 virtual bool is_gc_specific_loop_opts_pass(LoopOptsMode mode) const { return false; }
287
288 virtual bool has_special_unique_user(const Node* node) const { return false; }
289 virtual bool needs_anti_dependence_check(const Node* node) const { return true; }
290
291 virtual void barrier_insertion_phase(PhaseIterGVN &igvn) const { };
292 virtual void barrier_insertion(PhaseIdealLoop* phase) const { };
293
294 enum CompilePhase {
295 BeforeOptimize,
296 BeforeLateInsertion,
297 BeforeMacroExpand,
298 BeforeCodeGen
299 };
300
301 virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
302 #ifdef ASSERT
303 virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
304 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
305 #endif
306
307 virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
308
309 virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { return false; }
310 virtual bool escape_add_final_edges(ConnectionGraph* conn_graph, PhaseGVN* gvn, Node* n, uint opcode) const { return false; }
311 virtual bool escape_has_out_with_unsafe_object(Node* n) const { return false; }
312 virtual bool escape_is_barrier_node(Node* n) const { return false; }
313
314 virtual bool matcher_find_shared_visit(Matcher* matcher, Matcher::MStack& mstack, Node* n, uint opcode, bool& mem_op, int& mem_addr_idx) const { return false; };
315 virtual bool matcher_find_shared_post_visit(Matcher* matcher, Node* n, uint opcode) const { return false; };
316 virtual bool matcher_is_store_load_barrier(Node* x, uint xop) const { return false; }
317
318 virtual void igvn_add_users_to_worklist(PhaseIterGVN* igvn, Node* use) const { }
319 virtual void ccp_analyze(PhaseCCP* ccp, Unique_Node_List& worklist, Node* use) const { }
320
321 virtual Node* split_if_pre(PhaseIdealLoop* phase, Node* n) const { return NULL; }
322 virtual bool build_loop_late_post(PhaseIdealLoop* phase, Node* n) const { return false; }
323 virtual bool sink_node(PhaseIdealLoop* phase, Node* n, Node* x, Node* x_ctrl, Node* n_ctrl) const { return false; }
324 };
325
326 #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|