2175 //
2176 } else if (t->isa_oopptr()) {
2177 new_in2 = ConNode::make(C, t->make_narrowoop());
2178 }
2179 }
2180 if (new_in2 != NULL) {
2181 Node* cmpN = new (C, 3) CmpNNode(in1->in(1), new_in2);
2182 n->subsume_by( cmpN );
2183 if (in1->outcnt() == 0) {
2184 in1->disconnect_inputs(NULL);
2185 }
2186 if (in2->outcnt() == 0) {
2187 in2->disconnect_inputs(NULL);
2188 }
2189 }
2190 }
2191 break;
2192
2193 case Op_DecodeN:
2194 assert(!n->in(1)->is_EncodeP(), "should be optimized out");
2195 break;
2196
2197 case Op_EncodeP: {
2198 Node* in1 = n->in(1);
2199 if (in1->is_DecodeN()) {
2200 n->subsume_by(in1->in(1));
2201 } else if (in1->Opcode() == Op_ConP) {
2202 Compile* C = Compile::current();
2203 const Type* t = in1->bottom_type();
2204 if (t == TypePtr::NULL_PTR) {
2205 n->subsume_by(ConNode::make(C, TypeNarrowOop::NULL_PTR));
2206 } else if (t->isa_oopptr()) {
2207 n->subsume_by(ConNode::make(C, t->make_narrowoop()));
2208 }
2209 }
2210 if (in1->outcnt() == 0) {
2211 in1->disconnect_inputs(NULL);
2212 }
2213 break;
2214 }
|
2175 //
2176 } else if (t->isa_oopptr()) {
2177 new_in2 = ConNode::make(C, t->make_narrowoop());
2178 }
2179 }
2180 if (new_in2 != NULL) {
2181 Node* cmpN = new (C, 3) CmpNNode(in1->in(1), new_in2);
2182 n->subsume_by( cmpN );
2183 if (in1->outcnt() == 0) {
2184 in1->disconnect_inputs(NULL);
2185 }
2186 if (in2->outcnt() == 0) {
2187 in2->disconnect_inputs(NULL);
2188 }
2189 }
2190 }
2191 break;
2192
2193 case Op_DecodeN:
2194 assert(!n->in(1)->is_EncodeP(), "should be optimized out");
2195 assert(n->in(0) == NULL, "no control");
2196 break;
2197
2198 case Op_EncodeP: {
2199 Node* in1 = n->in(1);
2200 if (in1->is_DecodeN()) {
2201 n->subsume_by(in1->in(1));
2202 } else if (in1->Opcode() == Op_ConP) {
2203 Compile* C = Compile::current();
2204 const Type* t = in1->bottom_type();
2205 if (t == TypePtr::NULL_PTR) {
2206 n->subsume_by(ConNode::make(C, TypeNarrowOop::NULL_PTR));
2207 } else if (t->isa_oopptr()) {
2208 n->subsume_by(ConNode::make(C, t->make_narrowoop()));
2209 }
2210 }
2211 if (in1->outcnt() == 0) {
2212 in1->disconnect_inputs(NULL);
2213 }
2214 break;
2215 }
|