src/share/vm/opto/callnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/callnode.cpp

Print this page
rev 6579 : 8046698: assert(false) failed: only Initialize or AddP expected macro.cpp:943
Summary: PhiNode inserted between AllocateNode and Initialization node confuses allocation elimination
Reviewed-by:


 761       }
 762       return false;
 763     }
 764   }
 765   return true;
 766 }
 767 
 768 // Does this call have a direct reference to n other than debug information?
 769 bool CallNode::has_non_debug_use(Node *n) {
 770   const TypeTuple * d = tf()->domain();
 771   for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
 772     Node *arg = in(i);
 773     if (arg == n) {
 774       return true;
 775     }
 776   }
 777   return false;
 778 }
 779 
 780 // Returns the unique CheckCastPP of a call
 781 // or 'this' if there are several CheckCastPP
 782 // or returns NULL if there is no one.
 783 Node *CallNode::result_cast() {
 784   Node *cast = NULL;
 785 
 786   Node *p = proj_out(TypeFunc::Parms);
 787   if (p == NULL)
 788     return NULL;
 789 
 790   for (DUIterator_Fast imax, i = p->fast_outs(imax); i < imax; i++) {
 791     Node *use = p->fast_out(i);
 792     if (use->is_CheckCastPP()) {
 793       if (cast != NULL) {
 794         return this;  // more than 1 CheckCastPP
 795       }
 796       cast = use;







 797     }
 798   }
 799   return cast;
 800 }
 801 
 802 
 803 void CallNode::extract_projections(CallProjections* projs, bool separate_io_proj) {
 804   projs->fallthrough_proj      = NULL;
 805   projs->fallthrough_catchproj = NULL;
 806   projs->fallthrough_ioproj    = NULL;
 807   projs->catchall_ioproj       = NULL;
 808   projs->catchall_catchproj    = NULL;
 809   projs->fallthrough_memproj   = NULL;
 810   projs->catchall_memproj      = NULL;
 811   projs->resproj               = NULL;
 812   projs->exobj                 = NULL;
 813 
 814   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 815     ProjNode *pn = fast_out(i)->as_Proj();
 816     if (pn->outcnt() == 0) continue;




 761       }
 762       return false;
 763     }
 764   }
 765   return true;
 766 }
 767 
 768 // Does this call have a direct reference to n other than debug information?
 769 bool CallNode::has_non_debug_use(Node *n) {
 770   const TypeTuple * d = tf()->domain();
 771   for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
 772     Node *arg = in(i);
 773     if (arg == n) {
 774       return true;
 775     }
 776   }
 777   return false;
 778 }
 779 
 780 // Returns the unique CheckCastPP of a call
 781 // or 'this' if there are several CheckCastPP or unexpected uses
 782 // or returns NULL if there is no one.
 783 Node *CallNode::result_cast() {
 784   Node *cast = NULL;
 785 
 786   Node *p = proj_out(TypeFunc::Parms);
 787   if (p == NULL)
 788     return NULL;
 789 
 790   for (DUIterator_Fast imax, i = p->fast_outs(imax); i < imax; i++) {
 791     Node *use = p->fast_out(i);
 792     if (use->is_CheckCastPP()) {
 793       if (cast != NULL) {
 794         return this;  // more than 1 CheckCastPP
 795       }
 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;
 804     }
 805   }
 806   return cast;
 807 }
 808 
 809 
 810 void CallNode::extract_projections(CallProjections* projs, bool separate_io_proj) {
 811   projs->fallthrough_proj      = NULL;
 812   projs->fallthrough_catchproj = NULL;
 813   projs->fallthrough_ioproj    = NULL;
 814   projs->catchall_ioproj       = NULL;
 815   projs->catchall_catchproj    = NULL;
 816   projs->fallthrough_memproj   = NULL;
 817   projs->catchall_memproj      = NULL;
 818   projs->resproj               = NULL;
 819   projs->exobj                 = NULL;
 820 
 821   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 822     ProjNode *pn = fast_out(i)->as_Proj();
 823     if (pn->outcnt() == 0) continue;


src/share/vm/opto/callnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File