< prev index next >
src/share/vm/opto/compile.cpp
Print this page
@@ -1953,19 +1953,12 @@
set_inlining_progress(false);
set_inlining_incrementally(false);
}
}
-void Compile::inline_incrementally_one(PhaseIterGVN& igvn) {
+void Compile::inline_incrementally_one() {
assert(IncrementalInline, "incremental inlining should be on");
- PhaseGVN* gvn = initial_gvn();
-
- set_inlining_progress(false);
- for_igvn()->clear();
- gvn->replace_with(&igvn);
-
- {
TracePhase tp("incrementalInline_inline", &timers[_t_incrInline_inline]);
int i = 0;
for (; i <_late_inlines.length() && !inlining_progress(); i++) {
CallGenerator* cg = _late_inlines.at(i);
_late_inlines_pos = i+1;
@@ -1975,22 +1968,10 @@
int j = 0;
for (; i < _late_inlines.length(); i++, j++) {
_late_inlines.at_put(j, _late_inlines.at(i));
}
_late_inlines.trunc_to(j);
- }
-
- {
- TracePhase tp("incrementalInline_pru", &timers[_t_incrInline_pru]);
- ResourceMark rm;
- PhaseRemoveUseless pru(gvn, for_igvn());
- }
-
- {
- TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
- igvn = PhaseIterGVN(gvn);
- }
}
// Perform incremental inlining until bound on number of live nodes is reached
void Compile::inline_incrementally(PhaseIterGVN& igvn) {
TracePhase tp("incrementalInline", &timers[_t_incrInline]);
@@ -2000,11 +1981,10 @@
set_inlining_incrementally(true);
set_inlining_progress(true);
uint low_live_nodes = 0;
while(inlining_progress() && _late_inlines.length() > 0) {
-
if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
if (low_live_nodes < (uint)LiveNodeCountInliningCutoff * 8 / 10) {
TracePhase tp("incrementalInline_ideal", &timers[_t_incrInline_ideal]);
// PhaseIdealLoop is expensive so we only try it once we are
// out of live nodes and we only try it again if the previous
@@ -2018,11 +1998,28 @@
if (live_nodes() > (uint)LiveNodeCountInliningCutoff) {
break;
}
}
- inline_incrementally_one(igvn);
+ for_igvn()->clear();
+ gvn->replace_with(&igvn);
+
+ do {
+ set_inlining_progress(false);
+ inline_incrementally_one();
+ } while (!over_inlining_cutoff() && inlining_progress());
+
+ {
+ TracePhase tp("incrementalInline_pru", &timers[_t_incrInline_pru]);
+ ResourceMark rm;
+ PhaseRemoveUseless pru(gvn, for_igvn());
+ }
+
+ {
+ TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
+ igvn = PhaseIterGVN(gvn);
+ }
if (failing()) return;
{
TracePhase tp("incrementalInline_igvn", &timers[_t_incrInline_igvn]);
< prev index next >