src/share/vm/opto/type.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/type.cpp Wed Oct 7 09:47:31 2009
--- new/src/share/vm/opto/type.cpp Wed Oct 7 09:47:31 2009
*** 1113,1123 ****
--- 1113,1123 ----
return new TypeInt(_hi,_lo,WidenMax-_widen);
}
//------------------------------widen------------------------------------------
// Only happens for optimistic top-down optimizations.
! const Type *TypeInt::widen( const Type *old, const Type* limit ) const {
// Coming from TOP or such; no widening
if( old->base() != Int ) return this;
const TypeInt *ot = old->is_int();
// If new guy is equal to old guy, no widening
*** 1132,1150 ****
--- 1132,1156 ----
// If old guy was a constant, do not bother
if (ot->_lo == ot->_hi) return this;
// Now widen new guy.
// Check for widening too far
if (_widen == WidenMax) {
! if (min_jint < _lo && _hi < max_jint) {
! int max = max_jint;
+ int min = min_jint;
+ if (limit->isa_int()) {
+ max = limit->is_int()->_hi;
+ min = limit->is_int()->_lo;
+ }
+ if (min < _lo && _hi < max) {
// If neither endpoint is extremal yet, push out the endpoint
// which is closer to its respective limit.
if (_lo >= 0 || // easy common case
! (juint)(_lo - min_jint) >= (juint)(max_jint - _hi)) {
// Try to widen to an unsigned range type of 31 bits:
- return make(_lo, max_jint, WidenMax);
} else {
- return make(min_jint, _hi, WidenMax);
}
}
return TypeInt::INT;
}
// Returned widened new guy
*** 1355,1365 ****
--- 1361,1371 ----
return new TypeLong(_hi,_lo,WidenMax-_widen);
}
//------------------------------widen------------------------------------------
// Only happens for optimistic top-down optimizations.
! const Type *TypeLong::widen( const Type *old, const Type* limit ) const {
// Coming from TOP or such; no widening
if( old->base() != Long ) return this;
const TypeLong *ot = old->is_long();
// If new guy is equal to old guy, no widening
*** 1374,1395 ****
--- 1380,1407 ----
// If old guy was a constant, do not bother
if (ot->_lo == ot->_hi) return this;
// Now widen new guy.
// Check for widening too far
if (_widen == WidenMax) {
if (min_jlong < _lo && _hi < max_jlong) {
+ jlong max = max_jlong;
+ jlong min = min_jlong;
+ if (limit->isa_long()) {
+ max = limit->is_long()->_hi;
+ min = limit->is_long()->_lo;
+ }
+ if (min < _lo && _hi < max) {
// If neither endpoint is extremal yet, push out the endpoint
// which is closer to its respective limit.
if (_lo >= 0 || // easy common case
! (julong)(_lo - min_jlong) >= (julong)(max_jlong - _hi)) {
// Try to widen to an unsigned range type of 32/63 bits:
! if (max >= max_juint && _hi < max_juint)
return make(_lo, max_juint, WidenMax);
else
- return make(_lo, max_jlong, WidenMax);
} else {
- return make(min_jlong, _hi, WidenMax);
}
}
return TypeLong::LONG;
}
// Returned widened new guy
src/share/vm/opto/type.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File