comparison src/share/vm/opto/connode.cpp @ 235:9c2ecc2ffb12 jdk7-b31

Merge
author trims
date Fri, 11 Jul 2008 01:14:44 -0700
parents d1605aabd0a1 1e026f8da827
children ab075d07f1ba
comparison
equal deleted inserted replaced
197:de141433919f 235:9c2ecc2ffb12
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 } 572 assert(t->isa_narrowoop(), "only narrowoop here");
573 573 return t->make_ptr();
574 Node* DecodeNNode::decode(PhaseTransform* phase, Node* value) {
575 if (value->is_EncodeP()) {
576 // (DecodeN (EncodeP p)) -> p
577 return value->in(1);
578 }
579 const Type* newtype = value->bottom_type();
580 if (newtype == TypeNarrowOop::NULL_PTR) {
581 return phase->transform(new (phase->C, 1) ConPNode(TypePtr::NULL_PTR));
582 } else if (newtype->isa_narrowoop()) {
583 return phase->transform(new (phase->C, 2) DecodeNNode(value, newtype->is_narrowoop()->make_oopptr()));
584 } else {
585 ShouldNotReachHere();
586 return NULL; // to make C++ compiler happy.
587 }
588 } 574 }
589 575
590 Node* EncodePNode::Identity(PhaseTransform* phase) { 576 Node* EncodePNode::Identity(PhaseTransform* phase) {
591 const Type *t = phase->type( in(1) ); 577 const Type *t = phase->type( in(1) );
592 if( t == Type::TOP ) return in(1); 578 if( t == Type::TOP ) return in(1);
597 } 583 }
598 return this; 584 return this;
599 } 585 }
600 586
601 const Type *EncodePNode::Value( PhaseTransform *phase ) const { 587 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
602 if (phase->type( in(1) ) == TypePtr::NULL_PTR) { 588 const Type *t = phase->type( in(1) );
603 return TypeNarrowOop::NULL_PTR; 589 if (t == Type::TOP) return Type::TOP;
604 } 590 if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
605 return bottom_type(); 591
606 } 592 assert(t->isa_oopptr(), "only oopptr here");
607 593 return t->make_narrowoop();
608 Node* EncodePNode::encode(PhaseTransform* phase, Node* value) { 594 }
609 if (value->is_DecodeN()) { 595
610 // (EncodeP (DecodeN p)) -> p
611 return value->in(1);
612 }
613 const Type* newtype = value->bottom_type();
614 if (newtype == TypePtr::NULL_PTR) {
615 return phase->transform(new (phase->C, 1) ConNNode(TypeNarrowOop::NULL_PTR));
616 } else if (newtype->isa_oopptr()) {
617 return phase->transform(new (phase->C, 2) EncodePNode(value, newtype->is_oopptr()->make_narrowoop()));
618 } else {
619 ShouldNotReachHere();
620 return NULL; // to make C++ compiler happy.
621 }
622 }
623 596
624 Node *EncodePNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { 597 Node *EncodePNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
625 return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1)); 598 return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1));
626 } 599 }
627 600