97 }
98 }
99
100 void ZBarrierSetC2::unregister_potential_barrier_node(Node* node) const {
101 if (node->is_LoadBarrier()) {
102 state()->remove_load_barrier_node(node->as_LoadBarrier());
103 }
104 }
105
106 void ZBarrierSetC2::eliminate_useless_gc_barriers(Unique_Node_List &useful) const {
107 // Remove useless LoadBarrier nodes
108 ZBarrierSetC2State* s = state();
109 for (int i = s->load_barrier_count()-1; i >= 0; i--) {
110 LoadBarrierNode* n = s->load_barrier_node(i);
111 if (!useful.member(n)) {
112 unregister_potential_barrier_node(n);
113 }
114 }
115 }
116
117 void ZBarrierSetC2::enqueue_useful_gc_barrier(Unique_Node_List &worklist, Node* node) const {
118 if (node->is_LoadBarrier() && !node->as_LoadBarrier()->has_true_uses()) {
119 worklist.push(node);
120 }
121 }
122
123 void ZBarrierSetC2::find_dominating_barriers(PhaseIterGVN& igvn) {
124 // Look for dominating barriers on the same address only once all
125 // other loop opts are over: loop opts may cause a safepoint to be
126 // inserted between a barrier and its dominating barrier.
127 Compile* C = Compile::current();
128 ZBarrierSetC2* bs = (ZBarrierSetC2*)BarrierSet::barrier_set()->barrier_set_c2();
129 ZBarrierSetC2State* s = bs->state();
130 if (s->load_barrier_count() >= 2) {
131 Compile::TracePhase tp("idealLoop", &C->timers[Phase::_t_idealLoop]);
132 PhaseIdealLoop ideal_loop(igvn, LoopOptsLastRound);
133 if (C->major_progress()) C->print_method(PHASE_PHASEIDEALLOOP_ITERATIONS, 2);
134 }
135 }
136
137 void ZBarrierSetC2::add_users_to_worklist(Unique_Node_List* worklist) const {
138 // Permanent temporary workaround
139 // Loadbarriers may have non-obvious dead uses keeping them alive during parsing. The use is
|
97 }
98 }
99
100 void ZBarrierSetC2::unregister_potential_barrier_node(Node* node) const {
101 if (node->is_LoadBarrier()) {
102 state()->remove_load_barrier_node(node->as_LoadBarrier());
103 }
104 }
105
106 void ZBarrierSetC2::eliminate_useless_gc_barriers(Unique_Node_List &useful) const {
107 // Remove useless LoadBarrier nodes
108 ZBarrierSetC2State* s = state();
109 for (int i = s->load_barrier_count()-1; i >= 0; i--) {
110 LoadBarrierNode* n = s->load_barrier_node(i);
111 if (!useful.member(n)) {
112 unregister_potential_barrier_node(n);
113 }
114 }
115 }
116
117 void ZBarrierSetC2::enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {
118 if (node->is_LoadBarrier() && !node->as_LoadBarrier()->has_true_uses()) {
119 igvn->_worklist.push(node);
120 }
121 }
122
123 void ZBarrierSetC2::find_dominating_barriers(PhaseIterGVN& igvn) {
124 // Look for dominating barriers on the same address only once all
125 // other loop opts are over: loop opts may cause a safepoint to be
126 // inserted between a barrier and its dominating barrier.
127 Compile* C = Compile::current();
128 ZBarrierSetC2* bs = (ZBarrierSetC2*)BarrierSet::barrier_set()->barrier_set_c2();
129 ZBarrierSetC2State* s = bs->state();
130 if (s->load_barrier_count() >= 2) {
131 Compile::TracePhase tp("idealLoop", &C->timers[Phase::_t_idealLoop]);
132 PhaseIdealLoop ideal_loop(igvn, LoopOptsLastRound);
133 if (C->major_progress()) C->print_method(PHASE_PHASEIDEALLOOP_ITERATIONS, 2);
134 }
135 }
136
137 void ZBarrierSetC2::add_users_to_worklist(Unique_Node_List* worklist) const {
138 // Permanent temporary workaround
139 // Loadbarriers may have non-obvious dead uses keeping them alive during parsing. The use is
|