1.1 --- a/src/share/vm/opto/cfgnode.cpp Mon Oct 08 17:04:00 2012 -0700 1.2 +++ b/src/share/vm/opto/cfgnode.cpp Tue Oct 09 10:11:38 2012 +0200 1.3 @@ -1386,7 +1386,7 @@ 1.4 Node *n = phi->in(i); 1.5 if( !n ) return NULL; 1.6 if( phase->type(n) == Type::TOP ) return NULL; 1.7 - if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN ) 1.8 + if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN || n->Opcode() == Op_ConNKlass ) 1.9 break; 1.10 } 1.11 if( i >= phi->req() ) // Only split for constants 1.12 @@ -1875,17 +1875,19 @@ 1.13 } 1.14 1.15 #ifdef _LP64 1.16 - // Push DecodeN down through phi. 1.17 + // Push DecodeN/DecodeNKlass down through phi. 1.18 // The rest of phi graph will transform by split EncodeP node though phis up. 1.19 - if (UseCompressedOops && can_reshape && progress == NULL) { 1.20 + if ((UseCompressedOops || UseCompressedKlassPointers) && can_reshape && progress == NULL) { 1.21 bool may_push = true; 1.22 bool has_decodeN = false; 1.23 + bool is_decodeN = false; 1.24 for (uint i=1; i<req(); ++i) {// For all paths in 1.25 Node *ii = in(i); 1.26 - if (ii->is_DecodeN() && ii->bottom_type() == bottom_type()) { 1.27 + if (ii->is_DecodeNarrowPtr() && ii->bottom_type() == bottom_type()) { 1.28 // Do optimization if a non dead path exist. 1.29 if (ii->in(1)->bottom_type() != Type::TOP) { 1.30 has_decodeN = true; 1.31 + is_decodeN = ii->is_DecodeN(); 1.32 } 1.33 } else if (!ii->is_Phi()) { 1.34 may_push = false; 1.35 @@ -1895,13 +1897,18 @@ 1.36 if (has_decodeN && may_push) { 1.37 PhaseIterGVN *igvn = phase->is_IterGVN(); 1.38 // Make narrow type for new phi. 1.39 - const Type* narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr()); 1.40 + const Type* narrow_t; 1.41 + if (is_decodeN) { 1.42 + narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr()); 1.43 + } else { 1.44 + narrow_t = TypeNarrowKlass::make(this->bottom_type()->is_ptr()); 1.45 + } 1.46 PhiNode* new_phi = new (phase->C) PhiNode(r, narrow_t); 1.47 uint orig_cnt = req(); 1.48 for (uint i=1; i<req(); ++i) {// For all paths in 1.49 Node *ii = in(i); 1.50 Node* new_ii = NULL; 1.51 - if (ii->is_DecodeN()) { 1.52 + if (ii->is_DecodeNarrowPtr()) { 1.53 assert(ii->bottom_type() == bottom_type(), "sanity"); 1.54 new_ii = ii->in(1); 1.55 } else { 1.56 @@ -1909,14 +1916,22 @@ 1.57 if (ii->as_Phi() == this) { 1.58 new_ii = new_phi; 1.59 } else { 1.60 - new_ii = new (phase->C) EncodePNode(ii, narrow_t); 1.61 + if (is_decodeN) { 1.62 + new_ii = new (phase->C) EncodePNode(ii, narrow_t); 1.63 + } else { 1.64 + new_ii = new (phase->C) EncodePKlassNode(ii, narrow_t); 1.65 + } 1.66 igvn->register_new_node_with_optimizer(new_ii); 1.67 } 1.68 } 1.69 new_phi->set_req(i, new_ii); 1.70 } 1.71 igvn->register_new_node_with_optimizer(new_phi, this); 1.72 - progress = new (phase->C) DecodeNNode(new_phi, bottom_type()); 1.73 + if (is_decodeN) { 1.74 + progress = new (phase->C) DecodeNNode(new_phi, bottom_type()); 1.75 + } else { 1.76 + progress = new (phase->C) DecodeNKlassNode(new_phi, bottom_type()); 1.77 + } 1.78 } 1.79 } 1.80 #endif