8012941: JSR 292: too deep inlining might crash compiler because of stack overflow
authorvlivanov
Wed, 23 Oct 2013 20:20:03 +0400
changeset 21108 bb769f9ed280
parent 21107 aa84c4d14e6c
child 21109 43d5f32a3421
child 21200 5f7a5282462d
8012941: JSR 292: too deep inlining might crash compiler because of stack overflow Reviewed-by: kvn, twisti
hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
hotspot/src/share/vm/c1/c1_globals.hpp
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Oct 23 20:15:24 2013 +0400
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Oct 23 20:20:03 2013 +0400
@@ -3768,6 +3768,7 @@
 
   // now perform tests that are based on flag settings
   if (callee->force_inline()) {
+    if (inline_level() > MaxForceInlineLevel) INLINE_BAILOUT("MaxForceInlineLevel");
     print_inlining(callee, "force inline by annotation");
   } else if (callee->should_inline()) {
     print_inlining(callee, "force inline by CompileOracle");
--- a/hotspot/src/share/vm/c1/c1_globals.hpp	Wed Oct 23 20:15:24 2013 +0400
+++ b/hotspot/src/share/vm/c1/c1_globals.hpp	Wed Oct 23 20:20:03 2013 +0400
@@ -341,6 +341,8 @@
   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")   \
                                                                             \