Skip to content

Commit f86b70c

Browse files
author
Vladimir Ivanov
committed
8266328: C2: Remove InlineWarmCalls
Reviewed-by: kvn, iveresov
1 parent 928d632 commit f86b70c

File tree

8 files changed

+28
-582
lines changed

8 files changed

+28
-582
lines changed

src/hotspot/share/opto/bytecodeInfo.cpp

Lines changed: 21 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,18 @@ static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
112112

113113
// positive filter: should callee be inlined?
114114
bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
115-
int caller_bci, ciCallProfile& profile,
116-
WarmCallInfo* wci_result) {
115+
int caller_bci, ciCallProfile& profile) {
117116
// Allows targeted inlining
118117
if (C->directive()->should_inline(callee_method)) {
119-
*wci_result = *(WarmCallInfo::always_hot());
120-
if (C->print_inlining() && Verbose) {
121-
CompileTask::print_inline_indent(inline_level());
122-
tty->print_cr("Inlined method is hot: ");
123-
}
124118
set_msg("force inline by CompileCommand");
125119
_forced_inline = true;
126120
return true;
127121
}
128122

129123
if (callee_method->force_inline()) {
130-
set_msg("force inline by annotation");
131-
_forced_inline = true;
132-
return true;
124+
set_msg("force inline by annotation");
125+
_forced_inline = true;
126+
return true;
133127
}
134128

135129
#ifndef PRODUCT
@@ -146,7 +140,6 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
146140
// Check for too many throws (and not too huge)
147141
if(callee_method->interpreter_throwout_count() > InlineThrowCount &&
148142
size < InlineThrowMaxSize ) {
149-
wci_result->set_profit(wci_result->profit() * 100);
150143
if (C->print_inlining() && Verbose) {
151144
CompileTask::print_inline_indent(inline_level());
152145
tty->print_cr("Inlined method with many throws (throws=%d):", callee_method->interpreter_throwout_count());
@@ -202,8 +195,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
202195
// negative filter: should callee NOT be inlined?
203196
bool InlineTree::should_not_inline(ciMethod *callee_method,
204197
ciMethod* caller_method,
205-
JVMState* jvms,
206-
WarmCallInfo* wci_result) {
198+
JVMState* jvms) {
207199

208200
const char* fail_msg = NULL;
209201

@@ -361,7 +353,7 @@ bool InlineTree::is_not_reached(ciMethod* callee_method, ciMethod* caller_method
361353
// Relocated from "InliningClosure::try_to_inline"
362354
bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
363355
int caller_bci, JVMState* jvms, ciCallProfile& profile,
364-
WarmCallInfo* wci_result, bool& should_delay) {
356+
bool& should_delay) {
365357

366358
if (ClipInlining && (int)count_inline_bcs() >= DesiredMethodLimit) {
367359
if (!callee_method->force_inline() || !IncrementalInline) {
@@ -373,11 +365,10 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
373365
}
374366

375367
_forced_inline = false; // Reset
376-
if (!should_inline(callee_method, caller_method, caller_bci, profile,
377-
wci_result)) {
368+
if (!should_inline(callee_method, caller_method, caller_bci, profile)) {
378369
return false;
379370
}
380-
if (should_not_inline(callee_method, caller_method, jvms, wci_result)) {
371+
if (should_not_inline(callee_method, caller_method, jvms)) {
381372
return false;
382373
}
383374

@@ -560,7 +551,8 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
560551
}
561552

562553
//------------------------------ok_to_inline-----------------------------------
563-
WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci, bool& should_delay) {
554+
bool InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile,
555+
bool& should_delay) {
564556
assert(callee_method != NULL, "caller checks for optimized virtual!");
565557
assert(!should_delay, "should be initialized to false");
566558
#ifdef ASSERT
@@ -580,68 +572,35 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
580572
if (!pass_initial_checks(caller_method, caller_bci, callee_method)) {
581573
set_msg("failed initial checks");
582574
print_inlining(callee_method, caller_bci, caller_method, false /* !success */);
583-
return NULL;
575+
return false;
584576
}
585577

586578
// Do some parse checks.
587579
set_msg(check_can_parse(callee_method));
588580
if (msg() != NULL) {
589581
print_inlining(callee_method, caller_bci, caller_method, false /* !success */);
590-
return NULL;
582+
return false;
591583
}
592584

593585
// Check if inlining policy says no.
594-
WarmCallInfo wci = *(initial_wci);
595-
bool success = try_to_inline(callee_method, caller_method, caller_bci,
596-
jvms, profile, &wci, should_delay);
597-
598-
#ifndef PRODUCT
599-
if (InlineWarmCalls && (PrintOpto || C->print_inlining())) {
600-
bool cold = wci.is_cold();
601-
bool hot = !cold && wci.is_hot();
602-
bool old_cold = !success;
603-
if (old_cold != cold || (Verbose || WizardMode)) {
604-
if (msg() == NULL) {
605-
set_msg("OK");
606-
}
607-
tty->print(" OldInlining= %4s : %s\n WCI=",
608-
old_cold ? "cold" : "hot", msg());
609-
wci.print();
610-
}
611-
}
612-
#endif
586+
bool success = try_to_inline(callee_method, caller_method, caller_bci, jvms, profile,
587+
should_delay); // out
613588
if (success) {
614-
wci = *(WarmCallInfo::always_hot());
615-
} else {
616-
wci = *(WarmCallInfo::always_cold());
617-
}
618-
619-
if (!InlineWarmCalls) {
620-
if (!wci.is_cold() && !wci.is_hot()) {
621-
// Do not inline the warm calls.
622-
wci = *(WarmCallInfo::always_cold());
623-
}
624-
}
625-
626-
if (!wci.is_cold()) {
627589
// Inline!
628590
if (msg() == NULL) {
629591
set_msg("inline (hot)");
630592
}
631593
print_inlining(callee_method, caller_bci, caller_method, true /* success */);
632594
build_inline_tree_for_callee(callee_method, jvms, caller_bci);
633-
if (InlineWarmCalls && !wci.is_hot()) {
634-
return new (C) WarmCallInfo(wci); // copy to heap
595+
return true;
596+
} else {
597+
// Do not inline
598+
if (msg() == NULL) {
599+
set_msg("too cold to inline");
635600
}
636-
return WarmCallInfo::always_hot();
637-
}
638-
639-
// Do not inline
640-
if (msg() == NULL) {
641-
set_msg("too cold to inline");
601+
print_inlining(callee_method, caller_bci, caller_method, false /* !success */ );
602+
return false;
642603
}
643-
print_inlining(callee_method, caller_bci, caller_method, false /* !success */ );
644-
return NULL;
645604
}
646605

647606
//------------------------------build_inline_tree_for_callee-------------------

src/hotspot/share/opto/c2_globals.hpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -419,46 +419,6 @@
419419
"If parser node generation exceeds limit stop inlining") \
420420
range(0, max_jint) \
421421
\
422-
develop(intx, NodeCountInliningStep, 1000, \
423-
"Target size of warm calls inlined between optimization passes") \
424-
range(0, max_jint) \
425-
\
426-
develop(bool, InlineWarmCalls, false, \
427-
"Use a heat-based priority queue to govern inlining") \
428-
\
429-
/* Max values must not exceed WarmCallInfo::MAX_VALUE(). */ \
430-
develop(intx, HotCallCountThreshold, 999999, \
431-
"large numbers of calls (per method invocation) force hotness") \
432-
range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
433-
\
434-
develop(intx, HotCallProfitThreshold, 999999, \
435-
"highly profitable inlining opportunities force hotness") \
436-
range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
437-
\
438-
develop(intx, HotCallTrivialWork, -1, \
439-
"trivial execution time (no larger than this) forces hotness") \
440-
range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
441-
\
442-
develop(intx, HotCallTrivialSize, -1, \
443-
"trivial methods (no larger than this) force calls to be hot") \
444-
range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
445-
\
446-
develop(intx, WarmCallMinCount, -1, \
447-
"number of calls (per method invocation) to enable inlining") \
448-
range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
449-
\
450-
develop(intx, WarmCallMinProfit, -1, \
451-
"number of calls (per method invocation) to enable inlining") \
452-
range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
453-
\
454-
develop(intx, WarmCallMaxWork, 999999, \
455-
"execution time of the largest inlinable method") \
456-
range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
457-
\
458-
develop(intx, WarmCallMaxSize, 999999, \
459-
"size of the largest inlinable method") \
460-
range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10)))) \
461-
\
462422
product(intx, MaxNodeLimit, 80000, \
463423
"Maximum number of nodes") \
464424
range(1000, max_jint / 3) \

0 commit comments

Comments
 (0)