mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8028159: C2: compiler stack overflow during inlining of @ForceInline methods
Reviewed-by: roland, kvn
This commit is contained in:
parent
3fbc683322
commit
e7f6de784c
4 changed files with 9 additions and 5 deletions
|
@ -341,9 +341,6 @@
|
|||
diagnostic(bool, C1PatchInvokeDynamic, true, \
|
||||
"Patch invokedynamic appendix not known at compile time") \
|
||||
\
|
||||
develop(intx, MaxForceInlineLevel, 100, \
|
||||
"maximum number of nested @ForceInline calls that are inlined") \
|
||||
\
|
||||
|
||||
|
||||
// Read default values for c1 globals
|
||||
|
|
|
@ -389,6 +389,10 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
|
|||
return false;
|
||||
}
|
||||
if (inline_level() > _max_inline_level) {
|
||||
if (callee_method->force_inline() && inline_level() > MaxForceInlineLevel) {
|
||||
set_msg("MaxForceInlineLevel");
|
||||
return false;
|
||||
}
|
||||
if (!callee_method->force_inline() || !IncrementalInline) {
|
||||
set_msg("inlining too deep");
|
||||
return false;
|
||||
|
|
|
@ -776,7 +776,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
|
|||
guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove
|
||||
const int vtable_index = Method::invalid_vtable_index;
|
||||
CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, NULL, true, true);
|
||||
assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
|
||||
assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
|
||||
if (cg != NULL && cg->is_inline())
|
||||
return cg;
|
||||
}
|
||||
|
@ -846,7 +846,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
|
|||
}
|
||||
|
||||
CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true);
|
||||
assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
|
||||
assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
|
||||
if (cg != NULL && cg->is_inline())
|
||||
return cg;
|
||||
}
|
||||
|
|
|
@ -2954,6 +2954,9 @@ class CommandLineFlags {
|
|||
product(intx, MaxRecursiveInlineLevel, 1, \
|
||||
"maximum number of nested recursive calls that are inlined") \
|
||||
\
|
||||
develop(intx, MaxForceInlineLevel, 100, \
|
||||
"maximum number of nested @ForceInline calls that are inlined") \
|
||||
\
|
||||
product_pd(intx, InlineSmallCode, \
|
||||
"Only inline already compiled methods if their code size is " \
|
||||
"less than this") \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue