src/share/vm/opto/connode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6689060 Cdiff src/share/vm/opto/connode.cpp

src/share/vm/opto/connode.cpp

Print this page

        

*** 561,570 **** --- 561,590 ---- return in(1)->in(1); } return this; } + const Type *DecodeNNode::Value( PhaseTransform *phase ) const { + if (phase->type( in(1) ) == TypeNarrowOop::NULL_PTR) { + return TypePtr::NULL_PTR; + } + return bottom_type(); + } + + Node* DecodeNNode::decode(PhaseGVN* phase, Node* value) { + if (value->Opcode() == Op_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 { + return phase->transform(new (phase->C, 2) DecodeNNode(value, newtype->is_narrowoop()->make_oopptr())); + } + } + Node* EncodePNode::Identity(PhaseTransform* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); if (in(1)->Opcode() == Op_DecodeN) {
*** 572,589 **** return in(1)->in(1); } return this; } Node* EncodePNode::encode(PhaseGVN* phase, Node* value) { const Type* newtype = value->bottom_type(); if (newtype == TypePtr::NULL_PTR) { return phase->transform(new (phase->C, 1) ConNNode(TypeNarrowOop::NULL_PTR)); } else { ! return phase->transform(new (phase->C, 2) EncodePNode(value, ! newtype->is_oopptr()->make_narrowoop())); } } //============================================================================= --- 592,621 ---- return in(1)->in(1); } return this; } + const Type *EncodePNode::Value( PhaseTransform *phase ) const { + if (phase->type( in(1) ) == TypePtr::NULL_PTR) { + return TypeNarrowOop::NULL_PTR; + } + return bottom_type(); + } Node* EncodePNode::encode(PhaseGVN* phase, Node* value) { + if (value->Opcode() == Op_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. } } //=============================================================================
src/share/vm/opto/connode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File