--- old/src/share/vm/opto/castnode.cpp 2017-06-08 13:53:46.357301946 +0200 +++ new/src/share/vm/opto/castnode.cpp 2017-06-08 13:53:46.269301949 +0200 @@ -35,7 +35,7 @@ //============================================================================= // If input is already higher or equal to cast type, then this is an identity. Node* ConstraintCastNode::Identity(PhaseGVN* phase) { - Node* dom = dominating_cast(phase); + Node* dom = dominating_cast(phase, phase); if (dom != NULL) { return dom; } @@ -108,7 +108,7 @@ return NULL; } -TypeNode* ConstraintCastNode::dominating_cast(PhaseTransform *phase) const { +TypeNode* ConstraintCastNode::dominating_cast(PhaseGVN* gvn, PhaseTransform* pt) const { Node* val = in(1); Node* ctl = in(0); int opc = Opcode(); @@ -121,7 +121,7 @@ if (is_CastII() && as_CastII()->has_range_check()) { return NULL; } - if (type()->isa_rawptr() && (phase->type_or_null(val) == NULL || phase->type(val)->isa_oopptr())) { + if (type()->isa_rawptr() && (gvn->type_or_null(val) == NULL || gvn->type(val)->isa_oopptr())) { return NULL; } for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) { @@ -131,7 +131,7 @@ u->Opcode() == opc && u->in(0) != NULL && u->bottom_type()->higher_equal(type())) { - if (phase->is_dominator(u->in(0), ctl)) { + if (pt->is_dominator(u->in(0), ctl)) { return u->as_Type(); } if (is_CheckCastPP() && u->in(1)->is_Proj() && u->in(1)->in(0)->is_Allocate() && @@ -283,7 +283,7 @@ //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. Node* CheckCastPPNode::Identity(PhaseGVN* phase) { - Node* dom = dominating_cast(phase); + Node* dom = dominating_cast(phase, phase); if (dom != NULL) { return dom; } --- old/src/share/vm/opto/castnode.hpp 2017-06-08 13:53:46.649301936 +0200 +++ new/src/share/vm/opto/castnode.hpp 2017-06-08 13:53:46.557301939 +0200 @@ -51,7 +51,7 @@ virtual uint ideal_reg() const = 0; virtual bool depends_only_on_test() const { return !_carry_dependency; } bool carry_dependency() const { return _carry_dependency; } - TypeNode* dominating_cast(PhaseTransform *phase) const; + TypeNode* dominating_cast(PhaseGVN* gvn, PhaseTransform* pt) const; static Node* make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency); #ifndef PRODUCT --- old/src/share/vm/opto/loopopts.cpp 2017-06-08 13:53:47.061301922 +0200 +++ new/src/share/vm/opto/loopopts.cpp 2017-06-08 13:53:46.901301928 +0200 @@ -912,7 +912,7 @@ if( m ) return m; if (n->is_ConstraintCast()) { - Node* dom_cast = n->as_ConstraintCast()->dominating_cast(this); + Node* dom_cast = n->as_ConstraintCast()->dominating_cast(&_igvn, this); if (dom_cast != NULL) { _igvn.replace_node(n, dom_cast); return dom_cast; --- old/src/share/vm/opto/phaseX.hpp 2017-06-08 13:53:47.421301910 +0200 +++ new/src/share/vm/opto/phaseX.hpp 2017-06-08 13:53:47.333301913 +0200 @@ -211,6 +211,7 @@ // If you want the type of a very new (untransformed) node, // you must use type_or_null, and test the result for NULL. const Type* type(const Node* n) const { + assert(_pnum != Ideal_Loop, "should not be used from PhaseIdealLoop"); assert(n != NULL, "must not be null"); const Type* t = _types.fast_lookup(n->_idx); assert(t != NULL, "must set before get"); @@ -219,6 +220,7 @@ // Get a previously recorded type for the node n, // or else return NULL if there is none. const Type* type_or_null(const Node* n) const { + assert(_pnum != Ideal_Loop, "should not be used from PhaseIdealLoop"); return _types.fast_lookup(n->_idx); } // Record a type for a node.