src/share/vm/opto/compile.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8148754-cr Sdiff src/share/vm/opto

src/share/vm/opto/compile.cpp

Print this page




1884   if (!InlineWarmCalls)  return 0;
1885 
1886   int calls_made_hot = 0;
1887   int room_to_grow   = NodeCountInliningCutoff - unique();
1888   int amount_to_grow = MIN2(room_to_grow, (int)NodeCountInliningStep);
1889   int amount_grown   = 0;
1890   WarmCallInfo* call;
1891   while (amount_to_grow > 0 && (call = pop_warm_call()) != NULL) {
1892     int est_size = (int)call->size();
1893     if (est_size > (room_to_grow - amount_grown)) {
1894       // This one won't fit anyway.  Get rid of it.
1895       call->make_cold();
1896       continue;
1897     }
1898     call->make_hot();
1899     calls_made_hot++;
1900     amount_grown   += est_size;
1901     amount_to_grow -= est_size;
1902   }
1903 
1904   if (calls_made_hot > 0)  set_major_progress();
1905   return calls_made_hot;
1906 }
1907 
1908 
1909 //----------------------------Finish_Warm--------------------------------------
1910 void Compile::Finish_Warm() {
1911   if (!InlineWarmCalls)  return;
1912   if (failing())  return;
1913   if (warm_calls() == NULL)  return;
1914 
1915   // Clean up loose ends, if we are out of space for inlining.
1916   WarmCallInfo* call;
1917   while ((call = pop_warm_call()) != NULL) {
1918     call->make_cold();
1919   }
1920 }
1921 
1922 //---------------------cleanup_loop_predicates-----------------------
1923 // Remove the opaque nodes that protect the predicates so that all unused
1924 // checks and uncommon_traps will be eliminated from the ideal graph


2050 void Compile::inline_incrementally(PhaseIterGVN& igvn) {
2051   TracePhase tp("incrementalInline", &timers[_t_incrInline]);
2052 
2053   PhaseGVN* gvn = initial_gvn();
2054 
2055   set_inlining_incrementally(true);
2056   set_inlining_progress(true);
2057   uint low_live_nodes = 0;
2058 
2059   while(inlining_progress() && _late_inlines.length() > 0) {
2060 
2061     if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
2062       if (low_live_nodes < (uint)LiveNodeCountInliningCutoff * 8 / 10) {
2063         TracePhase tp("incrementalInline_ideal", &timers[_t_incrInline_ideal]);
2064         // PhaseIdealLoop is expensive so we only try it once we are
2065         // out of live nodes and we only try it again if the previous
2066         // helped got the number of nodes down significantly
2067         PhaseIdealLoop ideal_loop( igvn, false, true );
2068         if (failing())  return;
2069         low_live_nodes = live_nodes();
2070         _major_progress = true;
2071       }
2072 
2073       if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
2074         break;
2075       }
2076     }
2077 
2078     inline_incrementally_one(igvn);
2079 
2080     if (failing())  return;
2081 
2082     {
2083       TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
2084       igvn.optimize();
2085     }
2086 
2087     if (failing())  return;
2088   }
2089 
2090   assert( igvn._worklist.size() == 0, "should be done with igvn" );




1884   if (!InlineWarmCalls)  return 0;
1885 
1886   int calls_made_hot = 0;
1887   int room_to_grow   = NodeCountInliningCutoff - unique();
1888   int amount_to_grow = MIN2(room_to_grow, (int)NodeCountInliningStep);
1889   int amount_grown   = 0;
1890   WarmCallInfo* call;
1891   while (amount_to_grow > 0 && (call = pop_warm_call()) != NULL) {
1892     int est_size = (int)call->size();
1893     if (est_size > (room_to_grow - amount_grown)) {
1894       // This one won't fit anyway.  Get rid of it.
1895       call->make_cold();
1896       continue;
1897     }
1898     call->make_hot();
1899     calls_made_hot++;
1900     amount_grown   += est_size;
1901     amount_to_grow -= est_size;
1902   }
1903 

1904   return calls_made_hot;
1905 }
1906 
1907 
1908 //----------------------------Finish_Warm--------------------------------------
1909 void Compile::Finish_Warm() {
1910   if (!InlineWarmCalls)  return;
1911   if (failing())  return;
1912   if (warm_calls() == NULL)  return;
1913 
1914   // Clean up loose ends, if we are out of space for inlining.
1915   WarmCallInfo* call;
1916   while ((call = pop_warm_call()) != NULL) {
1917     call->make_cold();
1918   }
1919 }
1920 
1921 //---------------------cleanup_loop_predicates-----------------------
1922 // Remove the opaque nodes that protect the predicates so that all unused
1923 // checks and uncommon_traps will be eliminated from the ideal graph


2049 void Compile::inline_incrementally(PhaseIterGVN& igvn) {
2050   TracePhase tp("incrementalInline", &timers[_t_incrInline]);
2051 
2052   PhaseGVN* gvn = initial_gvn();
2053 
2054   set_inlining_incrementally(true);
2055   set_inlining_progress(true);
2056   uint low_live_nodes = 0;
2057 
2058   while(inlining_progress() && _late_inlines.length() > 0) {
2059 
2060     if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
2061       if (low_live_nodes < (uint)LiveNodeCountInliningCutoff * 8 / 10) {
2062         TracePhase tp("incrementalInline_ideal", &timers[_t_incrInline_ideal]);
2063         // PhaseIdealLoop is expensive so we only try it once we are
2064         // out of live nodes and we only try it again if the previous
2065         // helped got the number of nodes down significantly
2066         PhaseIdealLoop ideal_loop( igvn, false, true );
2067         if (failing())  return;
2068         low_live_nodes = live_nodes();

2069       }
2070 
2071       if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
2072         break;
2073       }
2074     }
2075 
2076     inline_incrementally_one(igvn);
2077 
2078     if (failing())  return;
2079 
2080     {
2081       TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
2082       igvn.optimize();
2083     }
2084 
2085     if (failing())  return;
2086   }
2087 
2088   assert( igvn._worklist.size() == 0, "should be done with igvn" );


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