RFR(L): 8005071: Incremental inlining for JSR 292

Roland Westrelin roland.westrelin at oracle.com
Sun Dec 23 08:37:33 PST 2012


Hi John,

Thanks for the suggestions. I kept all of them except the is_diamond_phi that wasn't quite right.

> int PhiNode::is_diamond_phi(bool check_control_only = false) const {
>   // Check for a 2-path merge
>   Node *region = in(0);
>   if( !region ) return 0;
>   if( region->req() != 3 ) return 0;
>   if(         req() != 3 ) return 0;
>   // Check that both paths come from the same If
>   Node *ifp1 = region->in(1);
>   Node *ifp2 = region->in(2);
>   if( !ifp1 || !ifp2 ) return 0;
>   if (check_control_only)  return (ifp1 == ifp2) ? -1 : 0;

int PhiNode::is_diamond_phi(bool check_control_only) const {
  // Check for a 2-path merge                                                                                                                                                                                                                                                    
  Node *region = in(0);
  if( !region ) return 0;
  if( region->req() != 3 ) return 0;
  if(         req() != 3 ) return 0;
  // Check that both paths come from the same If                                                                                                                                                                                                                                
  Node *ifp1 = region->in(1);
  Node *ifp2 = region->in(2);
  if( !ifp1 || !ifp2 ) return 0;
  Node *iff = ifp1->in(0);
  if( !iff || !iff->is_If() ) return 0;
  if( iff != ifp2->in(0) ) return 0;
  if (check_control_only)  return -1;

Roland.


More information about the hotspot-compiler-dev mailing list