comparison src/share/vm/opto/connode.cpp @ 14383:5ec7dace41a6

8027422: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed Summary: type methods shouldn't always operate on speculative part Reviewed-by: kvn, twisti
author roland
date Fri, 24 Jan 2014 09:31:53 +0100
parents de6a9e811145
children 4ca6dc0799b6 5b8e0f84f00f
comparison
equal deleted inserted replaced
14272:757ec609d8d5 14383:5ec7dace41a6
186 //------------------------------Value------------------------------------------ 186 //------------------------------Value------------------------------------------
187 // Result is the meet of inputs 187 // Result is the meet of inputs
188 const Type *CMoveNode::Value( PhaseTransform *phase ) const { 188 const Type *CMoveNode::Value( PhaseTransform *phase ) const {
189 if( phase->type(in(Condition)) == Type::TOP ) 189 if( phase->type(in(Condition)) == Type::TOP )
190 return Type::TOP; 190 return Type::TOP;
191 return phase->type(in(IfFalse))->meet(phase->type(in(IfTrue))); 191 return phase->type(in(IfFalse))->meet_speculative(phase->type(in(IfTrue)));
192 } 192 }
193 193
194 //------------------------------make------------------------------------------- 194 //------------------------------make-------------------------------------------
195 // Make a correctly-flavored CMove. Since _type is directly determined 195 // Make a correctly-flavored CMove. Since _type is directly determined
196 // from the inputs we do not need to specify it here. 196 // from the inputs we do not need to specify it here.
390 390
391 391
392 //============================================================================= 392 //=============================================================================
393 // If input is already higher or equal to cast type, then this is an identity. 393 // If input is already higher or equal to cast type, then this is an identity.
394 Node *ConstraintCastNode::Identity( PhaseTransform *phase ) { 394 Node *ConstraintCastNode::Identity( PhaseTransform *phase ) {
395 return phase->type(in(1))->higher_equal(_type) ? in(1) : this; 395 return phase->type(in(1))->higher_equal_speculative(_type) ? in(1) : this;
396 } 396 }
397 397
398 //------------------------------Value------------------------------------------ 398 //------------------------------Value------------------------------------------
399 // Take 'join' of input and cast-up type 399 // Take 'join' of input and cast-up type
400 const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const { 400 const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const {
401 if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; 401 if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
402 const Type* ft = phase->type(in(1))->filter(_type); 402 const Type* ft = phase->type(in(1))->filter_speculative(_type);
403 403
404 #ifdef ASSERT 404 #ifdef ASSERT
405 // Previous versions of this function had some special case logic, 405 // Previous versions of this function had some special case logic,
406 // which is no longer necessary. Make sure of the required effects. 406 // which is no longer necessary. Make sure of the required effects.
407 switch (Opcode()) { 407 switch (Opcode()) {
408 case Op_CastII: 408 case Op_CastII:
409 { 409 {
410 const Type* t1 = phase->type(in(1)); 410 const Type* t1 = phase->type(in(1));
411 if( t1 == Type::TOP ) assert(ft == Type::TOP, "special case #1"); 411 if( t1 == Type::TOP ) assert(ft == Type::TOP, "special case #1");
412 const Type* rt = t1->join(_type); 412 const Type* rt = t1->join_speculative(_type);
413 if (rt->empty()) assert(ft == Type::TOP, "special case #2"); 413 if (rt->empty()) assert(ft == Type::TOP, "special case #2");
414 break; 414 break;
415 } 415 }
416 case Op_CastPP: 416 case Op_CastPP:
417 if (phase->type(in(1)) == TypePtr::NULL_PTR && 417 if (phase->type(in(1)) == TypePtr::NULL_PTR &&