hotspot/src/share/vm/opto/connode.cpp
changeset 781 e1baa9c8f16f
parent 670 ddf3e9583f2f
parent 767 64fb1fd7186d
child 1067 f82e0a8cd438
--- a/hotspot/src/share/vm/opto/connode.cpp	Thu Jul 03 11:01:32 2008 -0700
+++ b/hotspot/src/share/vm/opto/connode.cpp	Fri Jul 11 01:14:44 2008 -0700
@@ -565,26 +565,12 @@
 }
 
 const Type *DecodeNNode::Value( PhaseTransform *phase ) const {
-  if (phase->type( in(1) ) == TypeNarrowOop::NULL_PTR) {
-    return TypePtr::NULL_PTR;
-  }
-  return bottom_type();
-}
+  const Type *t = phase->type( in(1) );
+  if (t == Type::TOP) return Type::TOP;
+  if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR;
 
-Node* DecodeNNode::decode(PhaseTransform* phase, Node* value) {
-  if (value->is_EncodeP()) {
-    // (DecodeN (EncodeP p)) -> p
-    return value->in(1);
-  }
-  const Type* newtype = value->bottom_type();
-  if (newtype == TypeNarrowOop::NULL_PTR) {
-    return phase->transform(new (phase->C, 1) ConPNode(TypePtr::NULL_PTR));
-  } else if (newtype->isa_narrowoop()) {
-    return phase->transform(new (phase->C, 2) DecodeNNode(value, newtype->is_narrowoop()->make_oopptr()));
-  } else {
-    ShouldNotReachHere();
-    return NULL; // to make C++ compiler happy.
-  }
+  assert(t->isa_narrowoop(), "only  narrowoop here");
+  return t->make_ptr();
 }
 
 Node* EncodePNode::Identity(PhaseTransform* phase) {
@@ -599,27 +585,14 @@
 }
 
 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
-  if (phase->type( in(1) ) == TypePtr::NULL_PTR) {
-    return TypeNarrowOop::NULL_PTR;
-  }
-  return bottom_type();
+  const Type *t = phase->type( in(1) );
+  if (t == Type::TOP) return Type::TOP;
+  if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
+
+  assert(t->isa_oopptr(), "only oopptr here");
+  return t->make_narrowoop();
 }
 
-Node* EncodePNode::encode(PhaseTransform* phase, Node* value) {
-  if (value->is_DecodeN()) {
-    // (EncodeP (DecodeN p)) -> p
-    return value->in(1);
-  }
-  const Type* newtype = value->bottom_type();
-  if (newtype == TypePtr::NULL_PTR) {
-    return phase->transform(new (phase->C, 1) ConNNode(TypeNarrowOop::NULL_PTR));
-  } else if (newtype->isa_oopptr()) {
-    return phase->transform(new (phase->C, 2) EncodePNode(value, newtype->is_oopptr()->make_narrowoop()));
-  } else {
-    ShouldNotReachHere();
-    return NULL; // to make C++ compiler happy.
-  }
-}
 
 Node *EncodePNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
   return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1));