src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/subnode.cpp

Print this page




 561   const TypeInt *r0 = t1->is_int();   // Handy access
 562   const TypeInt *r1 = t2->is_int();
 563 
 564   // Current installed version
 565   // Compare ranges for non-overlap
 566   juint lo0 = r0->_lo;
 567   juint hi0 = r0->_hi;
 568   juint lo1 = r1->_lo;
 569   juint hi1 = r1->_hi;
 570 
 571   // If either one has both negative and positive values,
 572   // it therefore contains both 0 and -1, and since [0..-1] is the
 573   // full unsigned range, the type must act as an unsigned bottom.
 574   bool bot0 = ((jint)(lo0 ^ hi0) < 0);
 575   bool bot1 = ((jint)(lo1 ^ hi1) < 0);
 576 
 577   if (bot0 || bot1) {
 578     // All unsigned values are LE -1 and GE 0.
 579     if (lo0 == 0 && hi0 == 0) {
 580       return TypeInt::CC_LE;            //   0 <= bot


 581     } else if (lo1 == 0 && hi1 == 0) {
 582       return TypeInt::CC_GE;            // bot >= 0


 583     }
 584   } else {
 585     // We can use ranges of the form [lo..hi] if signs are the same.
 586     assert(lo0 <= hi0 && lo1 <= hi1, "unsigned ranges are valid");
 587     // results are reversed, '-' > '+' for unsigned compare
 588     if (hi0 < lo1) {
 589       return TypeInt::CC_LT;            // smaller
 590     } else if (lo0 > hi1) {
 591       return TypeInt::CC_GT;            // greater
 592     } else if (hi0 == lo1 && lo0 == hi1) {
 593       return TypeInt::CC_EQ;            // Equal results
 594     } else if (lo0 >= hi1) {
 595       return TypeInt::CC_GE;
 596     } else if (hi0 <= lo1) {
 597       // Check for special case in Hashtable::get.  (See below.)
 598       if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
 599         return TypeInt::CC_LT;
 600       return TypeInt::CC_LE;
 601     }
 602   }




 561   const TypeInt *r0 = t1->is_int();   // Handy access
 562   const TypeInt *r1 = t2->is_int();
 563 
 564   // Current installed version
 565   // Compare ranges for non-overlap
 566   juint lo0 = r0->_lo;
 567   juint hi0 = r0->_hi;
 568   juint lo1 = r1->_lo;
 569   juint hi1 = r1->_hi;
 570 
 571   // If either one has both negative and positive values,
 572   // it therefore contains both 0 and -1, and since [0..-1] is the
 573   // full unsigned range, the type must act as an unsigned bottom.
 574   bool bot0 = ((jint)(lo0 ^ hi0) < 0);
 575   bool bot1 = ((jint)(lo1 ^ hi1) < 0);
 576 
 577   if (bot0 || bot1) {
 578     // All unsigned values are LE -1 and GE 0.
 579     if (lo0 == 0 && hi0 == 0) {
 580       return TypeInt::CC_LE;            //   0 <= bot
 581     } else if ((jint)lo0 == -1 && (jint)hi0 == -1) {
 582       return TypeInt::CC_GE;            // -1 >= bot
 583     } else if (lo1 == 0 && hi1 == 0) {
 584       return TypeInt::CC_GE;            // bot >= 0
 585     } else if ((jint)lo1 == -1 && (jint)hi1 == -1) {
 586       return TypeInt::CC_LE;            // bot <= -1
 587     }
 588   } else {
 589     // We can use ranges of the form [lo..hi] if signs are the same.
 590     assert(lo0 <= hi0 && lo1 <= hi1, "unsigned ranges are valid");
 591     // results are reversed, '-' > '+' for unsigned compare
 592     if (hi0 < lo1) {
 593       return TypeInt::CC_LT;            // smaller
 594     } else if (lo0 > hi1) {
 595       return TypeInt::CC_GT;            // greater
 596     } else if (hi0 == lo1 && lo0 == hi1) {
 597       return TypeInt::CC_EQ;            // Equal results
 598     } else if (lo0 >= hi1) {
 599       return TypeInt::CC_GE;
 600     } else if (hi0 <= lo1) {
 601       // Check for special case in Hashtable::get.  (See below.)
 602       if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
 603         return TypeInt::CC_LT;
 604       return TypeInt::CC_LE;
 605     }
 606   }


src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File