src/share/vm/opto/compile.cpp

Print this page

        

*** 2881,2893 **** } #endif break; } - #ifdef _LP64 case Op_CastPP: ! if (n->in(1)->is_DecodeN() && Matcher::gen_narrow_oop_implicit_null_checks()) { Node* in1 = n->in(1); const Type* t = n->bottom_type(); Node* new_in1 = in1->clone(); new_in1->as_DecodeN()->set_type(t); --- 2881,2923 ---- } #endif break; } case Op_CastPP: ! { ! // Remove CastPP nodes to gain more freedom during scheduling but ! // keep the dependency they encode as control or precedence edges ! // (if control is set already) on memory operations. Some CastPP ! // nodes don't have a control (don't carry a dependency): skip ! // those. ! if (n->in(0) != NULL) { ! ResourceMark rm; ! Unique_Node_List wq; ! wq.push(n); ! for (uint next = 0; next < wq.size(); ++next) { ! Node *m = wq.at(next); ! for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) { ! Node* use = m->fast_out(i); ! if (use->is_Mem() || use->is_EncodeNarrowPtr()) { ! use->ensure_control_or_add_prec(n->in(0)); ! } else if (use->in(0) == NULL) { ! switch(use->Opcode()) { ! case Op_AddP: ! case Op_DecodeN: ! case Op_DecodeNKlass: ! case Op_CheckCastPP: ! case Op_CastPP: ! wq.push(use); ! break; ! } ! } ! } ! } ! } ! const bool is_LP64 = LP64_ONLY(true) NOT_LP64(false); ! if (is_LP64 && n->in(1)->is_DecodeN() && Matcher::gen_narrow_oop_implicit_null_checks()) { Node* in1 = n->in(1); const Type* t = n->bottom_type(); Node* new_in1 = in1->clone(); new_in1->as_DecodeN()->set_type(t);
*** 2916,2928 **** n->subsume_by(new_in1, this); if (in1->outcnt() == 0) { in1->disconnect_inputs(NULL, this); } } break; ! case Op_CmpP: // Do this transformation here to preserve CmpPNode::sub() and // other TypePtr related Ideal optimizations (for example, ptr nullness). if (n->in(1)->is_DecodeNarrowPtr() || n->in(2)->is_DecodeNarrowPtr()) { Node* in1 = n->in(1); --- 2946,2964 ---- n->subsume_by(new_in1, this); if (in1->outcnt() == 0) { in1->disconnect_inputs(NULL, this); } + } else { + n->subsume_by(n->in(1), this); + if (n->outcnt() == 0) { + n->disconnect_inputs(NULL, this); + } } break; ! } ! #ifdef _LP64 case Op_CmpP: // Do this transformation here to preserve CmpPNode::sub() and // other TypePtr related Ideal optimizations (for example, ptr nullness). if (n->in(1)->is_DecodeNarrowPtr() || n->in(2)->is_DecodeNarrowPtr()) { Node* in1 = n->in(1);