< prev index next >

src/share/vm/opto/ifnode.cpp

Print this page
rev 8576 : 8188223: IfNode::range_check_trap_proj() should handler dying subgraph with single if proj
Reviewed-by: kvn


 436       assert(u->outcnt() == 0, "only dead users");
 437       igvn->remove_dead_node(u);
 438     }
 439     l -= 1;
 440   }
 441   igvn->remove_dead_node(r);
 442 
 443   // Now remove the bogus extra edges used to keep things alive
 444   igvn->remove_dead_node( hook );
 445 
 446   // Must return either the original node (now dead) or a new node
 447   // (Do not return a top here, since that would break the uniqueness of top.)
 448   return new (igvn->C) ConINode(TypeInt::ZERO);
 449 }
 450 
 451 //------------------------------is_range_check---------------------------------
 452 // Return 0 if not a range check.  Return 1 if a range check and set index and
 453 // offset.  Return 2 if we had to negate the test.  Index is NULL if the check
 454 // is versus a constant.
 455 int IfNode::is_range_check(Node* &range, Node* &index, jint &offset) {



 456   Node* b = in(1);
 457   if (b == NULL || !b->is_Bool())  return 0;
 458   BoolNode* bn = b->as_Bool();
 459   Node* cmp = bn->in(1);
 460   if (cmp == NULL)  return 0;
 461   if (cmp->Opcode() != Op_CmpU)  return 0;
 462 
 463   Node* l = cmp->in(1);
 464   Node* r = cmp->in(2);
 465   int flip_test = 1;
 466   if (bn->_test._test == BoolTest::le) {
 467     l = cmp->in(2);
 468     r = cmp->in(1);
 469     flip_test = 2;
 470   } else if (bn->_test._test != BoolTest::lt) {
 471     return 0;
 472   }
 473   if (l->is_top())  return 0;   // Top input means dead test
 474   if (r->Opcode() != Op_LoadRange)  return 0;
 475 




 436       assert(u->outcnt() == 0, "only dead users");
 437       igvn->remove_dead_node(u);
 438     }
 439     l -= 1;
 440   }
 441   igvn->remove_dead_node(r);
 442 
 443   // Now remove the bogus extra edges used to keep things alive
 444   igvn->remove_dead_node( hook );
 445 
 446   // Must return either the original node (now dead) or a new node
 447   // (Do not return a top here, since that would break the uniqueness of top.)
 448   return new (igvn->C) ConINode(TypeInt::ZERO);
 449 }
 450 
 451 //------------------------------is_range_check---------------------------------
 452 // Return 0 if not a range check.  Return 1 if a range check and set index and
 453 // offset.  Return 2 if we had to negate the test.  Index is NULL if the check
 454 // is versus a constant.
 455 int IfNode::is_range_check(Node* &range, Node* &index, jint &offset) {
 456   if (outcnt() != 2) {
 457     return 0;
 458   }
 459   Node* b = in(1);
 460   if (b == NULL || !b->is_Bool())  return 0;
 461   BoolNode* bn = b->as_Bool();
 462   Node* cmp = bn->in(1);
 463   if (cmp == NULL)  return 0;
 464   if (cmp->Opcode() != Op_CmpU)  return 0;
 465 
 466   Node* l = cmp->in(1);
 467   Node* r = cmp->in(2);
 468   int flip_test = 1;
 469   if (bn->_test._test == BoolTest::le) {
 470     l = cmp->in(2);
 471     r = cmp->in(1);
 472     flip_test = 2;
 473   } else if (bn->_test._test != BoolTest::lt) {
 474     return 0;
 475   }
 476   if (l->is_top())  return 0;   // Top input means dead test
 477   if (r->Opcode() != Op_LoadRange)  return 0;
 478 


< prev index next >