1.1 --- a/src/share/vm/opto/subnode.cpp Mon Jul 02 12:59:43 2012 -0700 1.2 +++ b/src/share/vm/opto/subnode.cpp Wed Jul 11 14:50:30 2012 -0700 1.3 @@ -554,9 +554,7 @@ 1.4 return TypeInt::CC_GE; 1.5 } else if (hi0 <= lo1) { 1.6 // Check for special case in Hashtable::get. (See below.) 1.7 - if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && 1.8 - in(1)->Opcode() == Op_ModI && 1.9 - in(1)->in(2) == in(2) ) 1.10 + if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check()) 1.11 return TypeInt::CC_LT; 1.12 return TypeInt::CC_LE; 1.13 } 1.14 @@ -567,13 +565,17 @@ 1.15 // to be positive. 1.16 // (This is a gross hack, since the sub method never 1.17 // looks at the structure of the node in any other case.) 1.18 - if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && 1.19 - in(1)->Opcode() == Op_ModI && 1.20 - in(1)->in(2)->uncast() == in(2)->uncast()) 1.21 + if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check()) 1.22 return TypeInt::CC_LT; 1.23 return TypeInt::CC; // else use worst case results 1.24 } 1.25 1.26 +bool CmpUNode::is_index_range_check() const { 1.27 + // Check for the "(X ModI Y) CmpU Y" shape 1.28 + return (in(1)->Opcode() == Op_ModI && 1.29 + in(1)->in(2)->eqv_uncast(in(2))); 1.30 +} 1.31 + 1.32 //------------------------------Idealize--------------------------------------- 1.33 Node *CmpINode::Ideal( PhaseGVN *phase, bool can_reshape ) { 1.34 if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) {