275 ConstraintCastNode::dump_spec(st); 276 if (_range_check_dependency) { 277 st->print(" range check dependency"); 278 } 279 } 280 #endif 281 282 //============================================================================= 283 //------------------------------Identity--------------------------------------- 284 // If input is already higher or equal to cast type, then this is an identity. 285 Node* CheckCastPPNode::Identity(PhaseGVN* phase) { 286 Node* dom = dominating_cast(phase, phase); 287 if (dom != NULL) { 288 return dom; 289 } 290 if (_carry_dependency) { 291 return this; 292 } 293 const Type* t = phase->type(in(1)); 294 if (EnableVectorReboxing && in(1)->Opcode() == Op_VectorBox) { 295 return t->higher_equal_speculative(phase->type(this)) ? in(1) : this; 296 } else { 297 // Toned down to rescue meeting at a Phi 3 different oops all implementing 298 // the same interface. 299 return (t == phase->type(this)) ? in(1) : this; 300 } 301 } 302 303 //------------------------------Value------------------------------------------ 304 // Take 'join' of input and cast-up type, unless working with an Interface 305 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const { 306 if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; 307 308 const Type *inn = phase->type(in(1)); 309 if( inn == Type::TOP ) return Type::TOP; // No information yet 310 311 const TypePtr *in_type = inn->isa_ptr(); 312 const TypePtr *my_type = _type->isa_ptr(); 313 const Type *result = _type; 314 if( in_type != NULL && my_type != NULL ) { 315 TypePtr::PTR in_ptr = in_type->ptr(); 316 if (in_ptr == TypePtr::Null) { 317 result = in_type; 318 } else if (in_ptr == TypePtr::Constant) { 319 if (my_type->isa_rawptr()) { 320 result = my_type; | 275 ConstraintCastNode::dump_spec(st); 276 if (_range_check_dependency) { 277 st->print(" range check dependency"); 278 } 279 } 280 #endif 281 282 //============================================================================= 283 //------------------------------Identity--------------------------------------- 284 // If input is already higher or equal to cast type, then this is an identity. 285 Node* CheckCastPPNode::Identity(PhaseGVN* phase) { 286 Node* dom = dominating_cast(phase, phase); 287 if (dom != NULL) { 288 return dom; 289 } 290 if (_carry_dependency) { 291 return this; 292 } 293 const Type* t = phase->type(in(1)); 294 if (EnableVectorReboxing && in(1)->Opcode() == Op_VectorBox) { 295 if (t->higher_equal_speculative(phase->type(this))) { 296 return in(1); 297 } 298 } else if (t == phase->type(this)) { 299 // Toned down to rescue meeting at a Phi 3 different oops all implementing 300 // the same interface. 301 return in(1); 302 } 303 return this; 304 } 305 306 //------------------------------Value------------------------------------------ 307 // Take 'join' of input and cast-up type, unless working with an Interface 308 const Type* CheckCastPPNode::Value(PhaseGVN* phase) const { 309 if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; 310 311 const Type *inn = phase->type(in(1)); 312 if( inn == Type::TOP ) return Type::TOP; // No information yet 313 314 const TypePtr *in_type = inn->isa_ptr(); 315 const TypePtr *my_type = _type->isa_ptr(); 316 const Type *result = _type; 317 if( in_type != NULL && my_type != NULL ) { 318 TypePtr::PTR in_ptr = in_type->ptr(); 319 if (in_ptr == TypePtr::Null) { 320 result = in_type; 321 } else if (in_ptr == TypePtr::Constant) { 322 if (my_type->isa_rawptr()) { 323 result = my_type; |