< prev index next >

src/hotspot/share/opto/narrowptrnode.cpp

Print this page

 24 
 25 #include "opto/narrowptrnode.hpp"
 26 #include "opto/phaseX.hpp"
 27 
 28 Node* DecodeNNode::Identity(PhaseGVN* phase) {
 29   const Type *t = phase->type( in(1) );
 30   if( t == Type::TOP ) return in(1);
 31 
 32   if (in(1)->is_EncodeP()) {
 33     // (DecodeN (EncodeP p)) -> p
 34     return in(1)->in(1);
 35   }
 36   return this;
 37 }
 38 
 39 const Type* DecodeNNode::Value(PhaseGVN* phase) const {
 40   const Type *t = phase->type( in(1) );
 41   if (t == Type::TOP) return Type::TOP;
 42   if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR;
 43 
 44   assert(t->isa_narrowoop(), "only  narrowoop here");
 45   return t->make_ptr();
 46 }
 47 
 48 Node* EncodePNode::Identity(PhaseGVN* phase) {
 49   const Type *t = phase->type( in(1) );
 50   if( t == Type::TOP ) return in(1);
 51 
 52   if (in(1)->is_DecodeN()) {
 53     // (EncodeP (DecodeN p)) -> p
 54     return in(1)->in(1);
 55   }
 56   return this;
 57 }
 58 
 59 const Type* EncodePNode::Value(PhaseGVN* phase) const {
 60   const Type *t = phase->type( in(1) );
 61   if (t == Type::TOP) return Type::TOP;
 62   if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
 63 
 64   assert(t->isa_oop_ptr(), "only oopptr here");

 24 
 25 #include "opto/narrowptrnode.hpp"
 26 #include "opto/phaseX.hpp"
 27 
 28 Node* DecodeNNode::Identity(PhaseGVN* phase) {
 29   const Type *t = phase->type( in(1) );
 30   if( t == Type::TOP ) return in(1);
 31 
 32   if (in(1)->is_EncodeP()) {
 33     // (DecodeN (EncodeP p)) -> p
 34     return in(1)->in(1);
 35   }
 36   return this;
 37 }
 38 
 39 const Type* DecodeNNode::Value(PhaseGVN* phase) const {
 40   const Type *t = phase->type( in(1) );
 41   if (t == Type::TOP) return Type::TOP;
 42   if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR;
 43 
 44   assert(t->isa_narrowoop(), "only narrowoop here");
 45   return t->make_ptr();
 46 }
 47 
 48 Node* EncodePNode::Identity(PhaseGVN* phase) {
 49   const Type *t = phase->type( in(1) );
 50   if( t == Type::TOP ) return in(1);
 51 
 52   if (in(1)->is_DecodeN()) {
 53     // (EncodeP (DecodeN p)) -> p
 54     return in(1)->in(1);
 55   }
 56   return this;
 57 }
 58 
 59 const Type* EncodePNode::Value(PhaseGVN* phase) const {
 60   const Type *t = phase->type( in(1) );
 61   if (t == Type::TOP) return Type::TOP;
 62   if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
 63 
 64   assert(t->isa_oop_ptr(), "only oopptr here");
< prev index next >