< prev index next >

src/share/vm/opto/castnode.cpp

Print this page




 260         // Keep a range assertion of >=0.
 261         lo1 = 0;        hi1 = max_jint;
 262       } else if (hi1 < 0) {
 263         // Keep a range assertion of <0.
 264         lo1 = min_jint; hi1 = -1;
 265       } else {
 266         lo1 = min_jint; hi1 = max_jint;
 267       }
 268       const TypeInt* wtype = TypeInt::make(MAX2(in_type->_lo, lo1),
 269                                            MIN2(in_type->_hi, hi1),
 270                                            MAX2((int)in_type->_widen, w1));
 271       if (wtype != type()) {
 272         set_type(wtype);
 273         return this;
 274       }
 275     }
 276   }
 277   return NULL;
 278 }
 279 

















 280 //=============================================================================
 281 //------------------------------Identity---------------------------------------
 282 // If input is already higher or equal to cast type, then this is an identity.
 283 Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
 284   Node* dom = dominating_cast(phase);
 285   if (dom != NULL) {
 286     assert(_carry_dependency, "only for casts that carry a dependency");
 287     return dom;
 288   }
 289   if (_carry_dependency) {
 290     return this;
 291   }
 292   // Toned down to rescue meeting at a Phi 3 different oops all implementing
 293   // the same interface.  CompileTheWorld starting at 502, kd12rc1.zip.
 294   return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
 295 }
 296 
 297 //------------------------------Value------------------------------------------
 298 // Take 'join' of input and cast-up type, unless working with an Interface
 299 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {




 260         // Keep a range assertion of >=0.
 261         lo1 = 0;        hi1 = max_jint;
 262       } else if (hi1 < 0) {
 263         // Keep a range assertion of <0.
 264         lo1 = min_jint; hi1 = -1;
 265       } else {
 266         lo1 = min_jint; hi1 = max_jint;
 267       }
 268       const TypeInt* wtype = TypeInt::make(MAX2(in_type->_lo, lo1),
 269                                            MIN2(in_type->_hi, hi1),
 270                                            MAX2((int)in_type->_widen, w1));
 271       if (wtype != type()) {
 272         set_type(wtype);
 273         return this;
 274       }
 275     }
 276   }
 277   return NULL;
 278 }
 279 
 280 uint CastIINode::cmp(const Node &n) const {
 281   return ConstraintCastNode::cmp(n) && ((CastIINode&)n)._range_check_dependency == _range_check_dependency;
 282 }
 283 
 284 uint CastIINode::size_of() const {
 285   return sizeof(*this);
 286 }
 287 
 288 #ifndef PRODUCT
 289 void CastIINode::dump_spec(outputStream* st) const {
 290   ConstraintCastNode::dump_spec(st);
 291   if (_range_check_dependency) {
 292     st->print(" range check dependency");
 293   }
 294 }
 295 #endif
 296 
 297 //=============================================================================
 298 //------------------------------Identity---------------------------------------
 299 // If input is already higher or equal to cast type, then this is an identity.
 300 Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
 301   Node* dom = dominating_cast(phase);
 302   if (dom != NULL) {
 303     assert(_carry_dependency, "only for casts that carry a dependency");
 304     return dom;
 305   }
 306   if (_carry_dependency) {
 307     return this;
 308   }
 309   // Toned down to rescue meeting at a Phi 3 different oops all implementing
 310   // the same interface.  CompileTheWorld starting at 502, kd12rc1.zip.
 311   return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
 312 }
 313 
 314 //------------------------------Value------------------------------------------
 315 // Take 'join' of input and cast-up type, unless working with an Interface
 316 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {


< prev index next >