< prev index next >

src/hotspot/share/opto/ifnode.cpp

Print this page




 484   if (cmp == NULL)  return NULL;
 485   if (cmp->Opcode() != Op_CmpU)  return NULL;
 486 
 487   l = cmp->in(1);
 488   r = cmp->in(2);
 489   flip_test = 1;
 490   if (bn->_test._test == BoolTest::le) {
 491     l = cmp->in(2);
 492     r = cmp->in(1);
 493     flip_test = 2;
 494   } else if (bn->_test._test != BoolTest::lt) {
 495     return NULL;
 496   }
 497   if (l->is_top())  return NULL;   // Top input means dead test
 498   if (r->Opcode() != Op_LoadRange && !is_RangeCheck())  return NULL;
 499 
 500   // We have recognized one of these forms:
 501   //  Flip 1:  If (Bool[<] CmpU(l, LoadRange)) ...
 502   //  Flip 2:  If (Bool[<=] CmpU(LoadRange, l)) ...
 503 




 504   ProjNode* iftrap = proj_out(flip_test == 2 ? true : false);
 505   return iftrap;
 506 }
 507 
 508 
 509 //------------------------------is_range_check---------------------------------
 510 // Return 0 if not a range check.  Return 1 if a range check and set index and
 511 // offset.  Return 2 if we had to negate the test.  Index is NULL if the check
 512 // is versus a constant.
 513 int RangeCheckNode::is_range_check(Node* &range, Node* &index, jint &offset) {
 514   int flip_test = 0;
 515   Node* l = NULL;
 516   Node* r = NULL;
 517   ProjNode* iftrap = range_check_trap_proj(flip_test, l, r);
 518 
 519   if (iftrap == NULL) {
 520     return 0;
 521   }
 522 
 523   // Make sure it's a real range check by requiring an uncommon trap




 484   if (cmp == NULL)  return NULL;
 485   if (cmp->Opcode() != Op_CmpU)  return NULL;
 486 
 487   l = cmp->in(1);
 488   r = cmp->in(2);
 489   flip_test = 1;
 490   if (bn->_test._test == BoolTest::le) {
 491     l = cmp->in(2);
 492     r = cmp->in(1);
 493     flip_test = 2;
 494   } else if (bn->_test._test != BoolTest::lt) {
 495     return NULL;
 496   }
 497   if (l->is_top())  return NULL;   // Top input means dead test
 498   if (r->Opcode() != Op_LoadRange && !is_RangeCheck())  return NULL;
 499 
 500   // We have recognized one of these forms:
 501   //  Flip 1:  If (Bool[<] CmpU(l, LoadRange)) ...
 502   //  Flip 2:  If (Bool[<=] CmpU(LoadRange, l)) ...
 503 
 504   if (outcnt() != 2) {
 505     return NULL;
 506   }
 507 
 508   ProjNode* iftrap = proj_out(flip_test == 2 ? true : false);
 509   return iftrap;
 510 }
 511 
 512 
 513 //------------------------------is_range_check---------------------------------
 514 // Return 0 if not a range check.  Return 1 if a range check and set index and
 515 // offset.  Return 2 if we had to negate the test.  Index is NULL if the check
 516 // is versus a constant.
 517 int RangeCheckNode::is_range_check(Node* &range, Node* &index, jint &offset) {
 518   int flip_test = 0;
 519   Node* l = NULL;
 520   Node* r = NULL;
 521   ProjNode* iftrap = range_check_trap_proj(flip_test, l, r);
 522 
 523   if (iftrap == NULL) {
 524     return 0;
 525   }
 526 
 527   // Make sure it's a real range check by requiring an uncommon trap


< prev index next >