1.1 --- a/src/share/vm/opto/cfgnode.cpp Thu Jul 30 16:05:56 2009 -0700 1.2 +++ b/src/share/vm/opto/cfgnode.cpp Fri Jul 31 12:04:07 2009 -0700 1.3 @@ -1792,15 +1792,12 @@ 1.4 if (UseCompressedOops && can_reshape && progress == NULL) { 1.5 bool may_push = true; 1.6 bool has_decodeN = false; 1.7 - Node* in_decodeN = NULL; 1.8 for (uint i=1; i<req(); ++i) {// For all paths in 1.9 Node *ii = in(i); 1.10 if (ii->is_DecodeN() && ii->bottom_type() == bottom_type()) { 1.11 - // Note: in_decodeN is used only to define the type of new phi. 1.12 - // Find a non dead path otherwise phi type will be wrong. 1.13 + // Do optimization if a non dead path exist. 1.14 if (ii->in(1)->bottom_type() != Type::TOP) { 1.15 has_decodeN = true; 1.16 - in_decodeN = ii->in(1); 1.17 } 1.18 } else if (!ii->is_Phi()) { 1.19 may_push = false; 1.20 @@ -1809,7 +1806,9 @@ 1.21 1.22 if (has_decodeN && may_push) { 1.23 PhaseIterGVN *igvn = phase->is_IterGVN(); 1.24 - PhiNode *new_phi = PhiNode::make_blank(in(0), in_decodeN); 1.25 + // Make narrow type for new phi. 1.26 + const Type* narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr()); 1.27 + PhiNode* new_phi = new (phase->C, r->req()) PhiNode(r, narrow_t); 1.28 uint orig_cnt = req(); 1.29 for (uint i=1; i<req(); ++i) {// For all paths in 1.30 Node *ii = in(i); 1.31 @@ -1822,7 +1821,7 @@ 1.32 if (ii->as_Phi() == this) { 1.33 new_ii = new_phi; 1.34 } else { 1.35 - new_ii = new (phase->C, 2) EncodePNode(ii, in_decodeN->bottom_type()); 1.36 + new_ii = new (phase->C, 2) EncodePNode(ii, narrow_t); 1.37 igvn->register_new_node_with_optimizer(new_ii); 1.38 } 1.39 }