comparison src/share/vm/opto/connode.cpp @ 216:8d191a7697e2

6715633: when matching a memory node the adr_type should not change Summary: verify the adr_type of a mach node was not changed Reviewed-by: rasbold, never
author kvn
date Fri, 20 Jun 2008 11:10:05 -0700
parents 7793bd37a336
children 1e026f8da827
comparison
equal deleted inserted replaced
215:273eaa04d9a1 216:8d191a7697e2
563 } 563 }
564 return this; 564 return this;
565 } 565 }
566 566
567 const Type *DecodeNNode::Value( PhaseTransform *phase ) const { 567 const Type *DecodeNNode::Value( PhaseTransform *phase ) const {
568 if (phase->type( in(1) ) == TypeNarrowOop::NULL_PTR) { 568 const Type *t = phase->type( in(1) );
569 return TypePtr::NULL_PTR; 569 if (t == Type::TOP) return Type::TOP;
570 } 570 if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR;
571 return bottom_type(); 571
572 assert(t->isa_narrowoop(), "only narrowoop here");
573 return t->is_narrowoop()->make_oopptr();
572 } 574 }
573 575
574 Node* DecodeNNode::decode(PhaseTransform* phase, Node* value) { 576 Node* DecodeNNode::decode(PhaseTransform* phase, Node* value) {
575 if (value->is_EncodeP()) { 577 if (value->is_EncodeP()) {
576 // (DecodeN (EncodeP p)) -> p 578 // (DecodeN (EncodeP p)) -> p
597 } 599 }
598 return this; 600 return this;
599 } 601 }
600 602
601 const Type *EncodePNode::Value( PhaseTransform *phase ) const { 603 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
602 if (phase->type( in(1) ) == TypePtr::NULL_PTR) { 604 const Type *t = phase->type( in(1) );
603 return TypeNarrowOop::NULL_PTR; 605 if (t == Type::TOP) return Type::TOP;
604 } 606 if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
605 return bottom_type(); 607
608 assert(t->isa_oopptr(), "only oopptr here");
609 return t->is_oopptr()->make_narrowoop();
606 } 610 }
607 611
608 Node* EncodePNode::encode(PhaseTransform* phase, Node* value) { 612 Node* EncodePNode::encode(PhaseTransform* phase, Node* value) {
609 if (value->is_DecodeN()) { 613 if (value->is_DecodeN()) {
610 // (EncodeP (DecodeN p)) -> p 614 // (EncodeP (DecodeN p)) -> p