hotspot/src/share/vm/opto/callnode.cpp
changeset 25935 59b08808cb9c
parent 25911 d47a5d9c5b89
child 26166 4b49fd58bbd9
equal deleted inserted replaced
25934:ba6dabf5c7d9 25935:59b08808cb9c
   776   }
   776   }
   777   return false;
   777   return false;
   778 }
   778 }
   779 
   779 
   780 // Returns the unique CheckCastPP of a call
   780 // Returns the unique CheckCastPP of a call
   781 // or 'this' if there are several CheckCastPP
   781 // or 'this' if there are several CheckCastPP or unexpected uses
   782 // or returns NULL if there is no one.
   782 // or returns NULL if there is no one.
   783 Node *CallNode::result_cast() {
   783 Node *CallNode::result_cast() {
   784   Node *cast = NULL;
   784   Node *cast = NULL;
   785 
   785 
   786   Node *p = proj_out(TypeFunc::Parms);
   786   Node *p = proj_out(TypeFunc::Parms);
   792     if (use->is_CheckCastPP()) {
   792     if (use->is_CheckCastPP()) {
   793       if (cast != NULL) {
   793       if (cast != NULL) {
   794         return this;  // more than 1 CheckCastPP
   794         return this;  // more than 1 CheckCastPP
   795       }
   795       }
   796       cast = use;
   796       cast = use;
       
   797     } else if (!use->is_Initialize() &&
       
   798                !use->is_AddP()) {
       
   799       // Expected uses are restricted to a CheckCastPP, an Initialize
       
   800       // node, and AddP nodes. If we encounter any other use (a Phi
       
   801       // node can be seen in rare cases) return this to prevent
       
   802       // incorrect optimizations.
       
   803       return this;
   797     }
   804     }
   798   }
   805   }
   799   return cast;
   806   return cast;
   800 }
   807 }
   801 
   808