mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8235673: [C1, C2] Split inlining control flags
Reviewed-by: neliasso, kvn, thartmann
This commit is contained in:
parent
d5bd523869
commit
76b76654d2
20 changed files with 90 additions and 47 deletions
|
@ -701,10 +701,10 @@ GraphBuilder::ScopeData::ScopeData(ScopeData* parent)
|
|||
if (parent != NULL) {
|
||||
_max_inline_size = (intx) ((float) NestedInliningSizeRatio * (float) parent->max_inline_size() / 100.0f);
|
||||
} else {
|
||||
_max_inline_size = MaxInlineSize;
|
||||
_max_inline_size = C1MaxInlineSize;
|
||||
}
|
||||
if (_max_inline_size < MaxTrivialSize) {
|
||||
_max_inline_size = MaxTrivialSize;
|
||||
if (_max_inline_size < C1MaxTrivialSize) {
|
||||
_max_inline_size = C1MaxTrivialSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3817,8 +3817,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign
|
|||
// now perform tests that are based on flag settings
|
||||
bool inlinee_by_directive = compilation()->directive()->should_inline(callee);
|
||||
if (callee->force_inline() || inlinee_by_directive) {
|
||||
if (inline_level() > MaxForceInlineLevel ) INLINE_BAILOUT("MaxForceInlineLevel");
|
||||
if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
|
||||
if (inline_level() > MaxForceInlineLevel ) INLINE_BAILOUT("MaxForceInlineLevel");
|
||||
if (recursive_inline_level(callee) > C1MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
|
||||
|
||||
const char* msg = "";
|
||||
if (callee->force_inline()) msg = "force inline by annotation";
|
||||
|
@ -3826,9 +3826,15 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign
|
|||
print_inlining(callee, msg);
|
||||
} else {
|
||||
// use heuristic controls on inlining
|
||||
if (inline_level() > MaxInlineLevel ) INLINE_BAILOUT("inlining too deep");
|
||||
if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
|
||||
if (inline_level() > C1MaxInlineLevel ) INLINE_BAILOUT("inlining too deep");
|
||||
int callee_recursive_level = recursive_inline_level(callee);
|
||||
if (callee_recursive_level > C1MaxRecursiveInlineLevel ) INLINE_BAILOUT("recursive inlining too deep");
|
||||
if (callee->code_size_for_inlining() > max_inline_size() ) INLINE_BAILOUT("callee is too large");
|
||||
// Additional condition to limit stack usage for non-recursive calls.
|
||||
if ((callee_recursive_level == 0) &&
|
||||
(callee->max_stack() + callee->max_locals() - callee->size_of_parameters() > C1InlineStackLimit)) {
|
||||
INLINE_BAILOUT("callee uses too much stack");
|
||||
}
|
||||
|
||||
// don't inline throwable methods unless the inlining tree is rooted in a throwable class
|
||||
if (callee->name() == ciSymbol::object_initializer_name() &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue