< prev index next >

src/hotspot/share/opto/gcm.cpp

Print this page

 217         Node* m = node->in(i);
 218         if (m == nullptr) continue;
 219         assert(is_CFG(m), "must be a CFG node");
 220         node->rm_prec(i);
 221         if (n == nullptr) {
 222           n = m;
 223         } else {
 224           assert(is_dominator(n, m) || is_dominator(m, n), "one must dominate the other");
 225           n = is_dominator(n, m) ? m : n;
 226         }
 227       }
 228       if (n != nullptr) {
 229         assert(node->in(0), "control should have been set");
 230         assert(is_dominator(n, node->in(0)) || is_dominator(node->in(0), n), "one must dominate the other");
 231         if (!is_dominator(n, node->in(0))) {
 232           node->set_req(0, n);
 233         }
 234       }
 235 
 236       // process all inputs that are non null
 237       for (int i = node->req()-1; i >= 0; --i) {
 238         if (node->in(i) != nullptr) {
 239           spstack.push(node->in(i));
 240         }
 241       }
 242     }
 243   }
 244 }
 245 
 246 #ifdef ASSERT
 247 // Assert that new input b2 is dominated by all previous inputs.
 248 // Check this by by seeing that it is dominated by b1, the deepest
 249 // input observed until b2.
 250 static void assert_dom(Block* b1, Block* b2, Node* n, const PhaseCFG* cfg) {
 251   if (b1 == nullptr)  return;
 252   assert(b1->_dom_depth < b2->_dom_depth, "sanity");
 253   Block* tmp = b2;
 254   while (tmp != b1 && tmp != nullptr) {
 255     tmp = tmp->_idom;
 256   }
 257   if (tmp != b1) {

 217         Node* m = node->in(i);
 218         if (m == nullptr) continue;
 219         assert(is_CFG(m), "must be a CFG node");
 220         node->rm_prec(i);
 221         if (n == nullptr) {
 222           n = m;
 223         } else {
 224           assert(is_dominator(n, m) || is_dominator(m, n), "one must dominate the other");
 225           n = is_dominator(n, m) ? m : n;
 226         }
 227       }
 228       if (n != nullptr) {
 229         assert(node->in(0), "control should have been set");
 230         assert(is_dominator(n, node->in(0)) || is_dominator(node->in(0), n), "one must dominate the other");
 231         if (!is_dominator(n, node->in(0))) {
 232           node->set_req(0, n);
 233         }
 234       }
 235 
 236       // process all inputs that are non null
 237       for (int i = node->len()-1; i >= 0; --i) {
 238         if (node->in(i) != nullptr) {
 239           spstack.push(node->in(i));
 240         }
 241       }
 242     }
 243   }
 244 }
 245 
 246 #ifdef ASSERT
 247 // Assert that new input b2 is dominated by all previous inputs.
 248 // Check this by by seeing that it is dominated by b1, the deepest
 249 // input observed until b2.
 250 static void assert_dom(Block* b1, Block* b2, Node* n, const PhaseCFG* cfg) {
 251   if (b1 == nullptr)  return;
 252   assert(b1->_dom_depth < b2->_dom_depth, "sanity");
 253   Block* tmp = b2;
 254   while (tmp != b1 && tmp != nullptr) {
 255     tmp = tmp->_idom;
 256   }
 257   if (tmp != b1) {
< prev index next >