342 // to be passed a TOP or BOTTOM type, these are filtered out by |
342 // to be passed a TOP or BOTTOM type, these are filtered out by |
343 // pre-check. |
343 // pre-check. |
344 const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const { |
344 const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const { |
345 const TypeInt *r0 = t0->is_int(); // Handy access |
345 const TypeInt *r0 = t0->is_int(); // Handy access |
346 const TypeInt *r1 = t1->is_int(); |
346 const TypeInt *r1 = t1->is_int(); |
347 int lo = r0->_lo + r1->_lo; |
347 int lo = java_add(r0->_lo, r1->_lo); |
348 int hi = r0->_hi + r1->_hi; |
348 int hi = java_add(r0->_hi, r1->_hi); |
349 if( !(r0->is_con() && r1->is_con()) ) { |
349 if( !(r0->is_con() && r1->is_con()) ) { |
350 // Not both constants, compute approximate result |
350 // Not both constants, compute approximate result |
351 if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { |
351 if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { |
352 lo = min_jint; hi = max_jint; // Underflow on the low side |
352 lo = min_jint; hi = max_jint; // Underflow on the low side |
353 } |
353 } |
460 // to be passed a TOP or BOTTOM type, these are filtered out by |
460 // to be passed a TOP or BOTTOM type, these are filtered out by |
461 // pre-check. |
461 // pre-check. |
462 const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const { |
462 const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const { |
463 const TypeLong *r0 = t0->is_long(); // Handy access |
463 const TypeLong *r0 = t0->is_long(); // Handy access |
464 const TypeLong *r1 = t1->is_long(); |
464 const TypeLong *r1 = t1->is_long(); |
465 jlong lo = r0->_lo + r1->_lo; |
465 jlong lo = java_add(r0->_lo, r1->_lo); |
466 jlong hi = r0->_hi + r1->_hi; |
466 jlong hi = java_add(r0->_hi, r1->_hi); |
467 if( !(r0->is_con() && r1->is_con()) ) { |
467 if( !(r0->is_con() && r1->is_con()) ) { |
468 // Not both constants, compute approximate result |
468 // Not both constants, compute approximate result |
469 if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { |
469 if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { |
470 lo =min_jlong; hi = max_jlong; // Underflow on the low side |
470 lo =min_jlong; hi = max_jlong; // Underflow on the low side |
471 } |
471 } |