< prev index next >

src/hotspot/share/opto/cfgnode.cpp

Print this page

        

@@ -1661,26 +1661,27 @@
     // pushed down through Phis.
     const TypeValueTypePtr* vtptr = NULL;
     for (uint i = 1; i < req(); i++) {
       if (in(i) != NULL && in(i)->is_ValueTypePtr()) {
         const TypeValueTypePtr* t = phase->type(in(i))->is_valuetypeptr();
+        t = t->cast_to_ptr_type(TypePtr::BotPTR)->is_valuetypeptr();
         if (vtptr == NULL) {
           vtptr = t;
         } else {
           assert(vtptr == t, "Phi should merge identical value types");
         }
       } else {
         assert(in(i) == NULL || vtptr == NULL || phase->type(in(i))->higher_equal(vtptr) || phase->type(in(i)) == Type::TOP ||
-               phase->type(in(i))->is_valuetypeptr()->value_type()->value_klass() == phase->C->env()->___Value_klass(), "bad type");
+               phase->type(in(i))->is_valuetypeptr()->is__Value(), "bad type");
       }
     }
     if (vtptr != NULL) {
       // One input is a value type. All inputs must have the same type.
       bool progress = false;
       PhaseIterGVN* igvn = phase->is_IterGVN();
       for (uint i = 1; i < req(); i++) {
-        if (in(i) != NULL && !phase->type(in(i))->higher_equal(vtptr)) {
+        if (in(i) != NULL && !in(i)->is_Con() && !phase->type(in(i))->higher_equal(vtptr)) {
           // Can't transform because CheckCastPPNode::Identity can
           // push the cast up through another Phi and cause this same
           // transformation to run again, indefinitely
           Node* cast = igvn->register_new_node_with_optimizer(new CheckCastPPNode(NULL, in(i), vtptr));
           set_req(i, cast);
< prev index next >