changeset 5736:96d116f870b0

8012941: JSR 292: too deep inlining might crash compiler because of stack overflow Reviewed-by: kvn, sgabdura
author vkempik
date Wed, 24 Sep 2014 13:47:43 +0400
parents c296492ba8b4
children c02c67eb03ae
files src/share/vm/c1/c1_GraphBuilder.cpp src/share/vm/c1/c1_globals.hpp
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Sep 17 11:30:38 2014 +0200
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Sep 24 13:47:43 2014 +0400
@@ -3663,6 +3663,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/src/share/vm/c1/c1_globals.hpp	Wed Sep 17 11:30:38 2014 +0200
+++ b/src/share/vm/c1/c1_globals.hpp	Wed Sep 24 13:47:43 2014 +0400
@@ -320,6 +320,9 @@
   develop(bool, PrintCFGToFile, false,                                      \
           "print control flow graph to a separate file during compilation") \
                                                                             \
+  develop(intx, MaxForceInlineLevel, 100,                                   \
+          "maximum number of nested @ForceInline calls that are inlined")   \
+                                                                            \
 
 
 // Read default values for c1 globals