70 static void fix_ctrl(Node* barrier, Node* region, const MemoryGraphFixer& fixer, Unique_Node_List& uses, Unique_Node_List& uses_to_ignore, uint last, PhaseIdealLoop* phase);
71 static IfNode* find_unswitching_candidate(const IdealLoopTree *loop, PhaseIdealLoop* phase);
72
73 static Node* get_load_addr(PhaseIdealLoop* phase, VectorSet& visited, Node* lrb);
74 public:
75 static bool is_dominator(Node* d_c, Node* n_c, Node* d, Node* n, PhaseIdealLoop* phase);
76 static bool is_dominator_same_ctrl(Node* c, Node* d, Node* n, PhaseIdealLoop* phase);
77
78 static bool is_gc_state_load(Node* n);
79 static bool is_heap_stable_test(Node* iff);
80
81 static bool expand(Compile* C, PhaseIterGVN& igvn);
82 static void pin_and_expand(PhaseIdealLoop* phase);
83 static void optimize_after_expansion(VectorSet& visited, Node_Stack& nstack, Node_List& old_new, PhaseIdealLoop* phase);
84
85 #ifdef ASSERT
86 static void verify(RootNode* root);
87 #endif
88 };
89
90 class ShenandoahIUBarrierNode : public Node {
91 public:
92 ShenandoahIUBarrierNode(Node* val);
93
94 const Type *bottom_type() const;
95 const Type* Value(PhaseGVN* phase) const;
96 Node* Identity(PhaseGVN* phase);
97
98 int Opcode() const;
99
100 private:
101 enum { Needed, NotNeeded, MaybeNeeded };
102
103 static int needed(Node* n);
104 static Node* next(Node* n);
105 };
106
107 class MemoryGraphFixer : public ResourceObj {
108 private:
109 Node_List _memory_nodes;
110 int _alias;
111 PhaseIdealLoop* _phase;
112 bool _include_lsm;
113
114 void collect_memory_nodes();
115 Node* get_ctrl(Node* n) const;
116 Node* ctrl_or_self(Node* n) const;
117 bool mem_is_valid(Node* m, Node* c) const;
118 MergeMemNode* allocate_merge_mem(Node* mem, Node* rep_proj, Node* rep_ctrl) const;
119 MergeMemNode* clone_merge_mem(Node* u, Node* mem, Node* rep_proj, Node* rep_ctrl, DUIterator& i) const;
120 void fix_memory_uses(Node* mem, Node* replacement, Node* rep_proj, Node* rep_ctrl) const;
121 bool should_process_phi(Node* phi) const;
122 bool has_mem_phi(Node* region) const;
123
124 public:
125 MemoryGraphFixer(int alias, bool include_lsm, PhaseIdealLoop* phase) :
126 _alias(alias), _phase(phase), _include_lsm(include_lsm) {
|
70 static void fix_ctrl(Node* barrier, Node* region, const MemoryGraphFixer& fixer, Unique_Node_List& uses, Unique_Node_List& uses_to_ignore, uint last, PhaseIdealLoop* phase);
71 static IfNode* find_unswitching_candidate(const IdealLoopTree *loop, PhaseIdealLoop* phase);
72
73 static Node* get_load_addr(PhaseIdealLoop* phase, VectorSet& visited, Node* lrb);
74 public:
75 static bool is_dominator(Node* d_c, Node* n_c, Node* d, Node* n, PhaseIdealLoop* phase);
76 static bool is_dominator_same_ctrl(Node* c, Node* d, Node* n, PhaseIdealLoop* phase);
77
78 static bool is_gc_state_load(Node* n);
79 static bool is_heap_stable_test(Node* iff);
80
81 static bool expand(Compile* C, PhaseIterGVN& igvn);
82 static void pin_and_expand(PhaseIdealLoop* phase);
83 static void optimize_after_expansion(VectorSet& visited, Node_Stack& nstack, Node_List& old_new, PhaseIdealLoop* phase);
84
85 #ifdef ASSERT
86 static void verify(RootNode* root);
87 #endif
88 };
89
90 class MemoryGraphFixer : public ResourceObj {
91 private:
92 Node_List _memory_nodes;
93 int _alias;
94 PhaseIdealLoop* _phase;
95 bool _include_lsm;
96
97 void collect_memory_nodes();
98 Node* get_ctrl(Node* n) const;
99 Node* ctrl_or_self(Node* n) const;
100 bool mem_is_valid(Node* m, Node* c) const;
101 MergeMemNode* allocate_merge_mem(Node* mem, Node* rep_proj, Node* rep_ctrl) const;
102 MergeMemNode* clone_merge_mem(Node* u, Node* mem, Node* rep_proj, Node* rep_ctrl, DUIterator& i) const;
103 void fix_memory_uses(Node* mem, Node* replacement, Node* rep_proj, Node* rep_ctrl) const;
104 bool should_process_phi(Node* phi) const;
105 bool has_mem_phi(Node* region) const;
106
107 public:
108 MemoryGraphFixer(int alias, bool include_lsm, PhaseIdealLoop* phase) :
109 _alias(alias), _phase(phase), _include_lsm(include_lsm) {
|