328 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
329 virtual void eliminate_gc_barrier_data(Node* node) const { }
330 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
331 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
332
333 // Allow barrier sets to have shared state that is preserved across a compilation unit.
334 // This could for example comprise macro nodes to be expanded during macro expansion.
335 virtual void* create_barrier_state(Arena* comp_arena) const { return nullptr; }
336 // If the BarrierSetC2 state has barrier nodes in its compilation
337 // unit state to be expanded later, then now is the time to do so.
338 virtual bool expand_barriers(Compile* C, PhaseIterGVN& igvn) const { return false; }
339 virtual bool optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { return false; }
340 virtual bool strip_mined_loops_expanded(LoopOptsMode mode) const { return false; }
341 virtual bool is_gc_specific_loop_opts_pass(LoopOptsMode mode) const { return false; }
342 // Estimated size of the node barrier in number of C2 Ideal nodes.
343 // This is used to guide heuristics in C2, e.g. whether to unroll a loop.
344 virtual uint estimated_barrier_size(const Node* node) const { return 0; }
345 // Whether the given store can be used to initialize a newly allocated object.
346 virtual bool can_initialize_object(const StoreNode* store) const { return true; }
347
348 enum CompilePhase {
349 BeforeOptimize,
350 BeforeMacroExpand,
351 BeforeCodeGen
352 };
353
354 #ifdef ASSERT
355 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
356 #endif
357
358 virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode, Unique_Node_List& dead_nodes) const { return false; }
359
360 virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { return false; }
361 virtual bool escape_add_final_edges(ConnectionGraph* conn_graph, PhaseGVN* gvn, Node* n, uint opcode) const { return false; }
362 virtual bool escape_has_out_with_unsafe_object(Node* n) const { return false; }
363
364 virtual bool matcher_find_shared_post_visit(Matcher* matcher, Node* n, uint opcode) const { return false; };
365 virtual bool matcher_is_store_load_barrier(Node* x, uint xop) const { return false; }
366
367 // Whether the given phi node joins OOPs from fast and slow allocation paths.
368 static bool is_allocation(const Node* node);
369 // Elide GC barriers from a Mach node according to elide_dominated_barriers().
370 virtual void elide_dominated_barrier(MachNode* mach) const { }
|
328 virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
329 virtual void eliminate_gc_barrier_data(Node* node) const { }
330 virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
331 virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
332
333 // Allow barrier sets to have shared state that is preserved across a compilation unit.
334 // This could for example comprise macro nodes to be expanded during macro expansion.
335 virtual void* create_barrier_state(Arena* comp_arena) const { return nullptr; }
336 // If the BarrierSetC2 state has barrier nodes in its compilation
337 // unit state to be expanded later, then now is the time to do so.
338 virtual bool expand_barriers(Compile* C, PhaseIterGVN& igvn) const { return false; }
339 virtual bool optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { return false; }
340 virtual bool strip_mined_loops_expanded(LoopOptsMode mode) const { return false; }
341 virtual bool is_gc_specific_loop_opts_pass(LoopOptsMode mode) const { return false; }
342 // Estimated size of the node barrier in number of C2 Ideal nodes.
343 // This is used to guide heuristics in C2, e.g. whether to unroll a loop.
344 virtual uint estimated_barrier_size(const Node* node) const { return 0; }
345 // Whether the given store can be used to initialize a newly allocated object.
346 virtual bool can_initialize_object(const StoreNode* store) const { return true; }
347
348 virtual void final_refinement(Compile* C) const {};
349
350 enum CompilePhase {
351 BeforeOptimize,
352 BeforeMacroExpand,
353 AfterOptimize,
354 BeforeCodeGen
355 };
356
357 #ifdef ASSERT
358 virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
359 #endif
360
361 virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode, Unique_Node_List& dead_nodes) const { return false; }
362
363 virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { return false; }
364 virtual bool escape_add_final_edges(ConnectionGraph* conn_graph, PhaseGVN* gvn, Node* n, uint opcode) const { return false; }
365 virtual bool escape_has_out_with_unsafe_object(Node* n) const { return false; }
366
367 virtual bool matcher_find_shared_post_visit(Matcher* matcher, Node* n, uint opcode) const { return false; };
368 virtual bool matcher_is_store_load_barrier(Node* x, uint xop) const { return false; }
369
370 // Whether the given phi node joins OOPs from fast and slow allocation paths.
371 static bool is_allocation(const Node* node);
372 // Elide GC barriers from a Mach node according to elide_dominated_barriers().
373 virtual void elide_dominated_barrier(MachNode* mach) const { }
|