50 const Type *t = phase->type( in(1) );
51 if( t == Type::TOP ) return in(1);
52
53 if (in(1)->is_DecodeN()) {
54 // (EncodeP (DecodeN p)) -> p
55 return in(1)->in(1);
56 }
57 return this;
58 }
59
60 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
61 const Type *t = phase->type( in(1) );
62 if (t == Type::TOP) return Type::TOP;
63 if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
64
65 assert(t->isa_oop_ptr(), "only oopptr here");
66 return t->make_narrowoop();
67 }
68
69
70 Node *EncodeNarrowPtrNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
71 return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1));
72 }
73
74 Node* DecodeNKlassNode::Identity(PhaseTransform* phase) {
75 const Type *t = phase->type( in(1) );
76 if( t == Type::TOP ) return in(1);
77
78 if (in(1)->is_EncodePKlass()) {
79 // (DecodeNKlass (EncodePKlass p)) -> p
80 return in(1)->in(1);
81 }
82 return this;
83 }
84
85 const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const {
86 const Type *t = phase->type( in(1) );
87 if (t == Type::TOP) return Type::TOP;
88 assert(t != TypeNarrowKlass::NULL_PTR, "null klass?");
89
90 assert(t->isa_narrowklass(), "only narrow klass ptr here");
91 return t->make_ptr();
92 }
93
|
50 const Type *t = phase->type( in(1) );
51 if( t == Type::TOP ) return in(1);
52
53 if (in(1)->is_DecodeN()) {
54 // (EncodeP (DecodeN p)) -> p
55 return in(1)->in(1);
56 }
57 return this;
58 }
59
60 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
61 const Type *t = phase->type( in(1) );
62 if (t == Type::TOP) return Type::TOP;
63 if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
64
65 assert(t->isa_oop_ptr(), "only oopptr here");
66 return t->make_narrowoop();
67 }
68
69
70 Node* DecodeNKlassNode::Identity(PhaseTransform* phase) {
71 const Type *t = phase->type( in(1) );
72 if( t == Type::TOP ) return in(1);
73
74 if (in(1)->is_EncodePKlass()) {
75 // (DecodeNKlass (EncodePKlass p)) -> p
76 return in(1)->in(1);
77 }
78 return this;
79 }
80
81 const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const {
82 const Type *t = phase->type( in(1) );
83 if (t == Type::TOP) return Type::TOP;
84 assert(t != TypeNarrowKlass::NULL_PTR, "null klass?");
85
86 assert(t->isa_narrowklass(), "only narrow klass ptr here");
87 return t->make_ptr();
88 }
89
|