diff src/share/vm/c1/c1_GraphBuilder.cpp @ 17819:f47fa50d9b9c

8035887: VM crashes trying to force inlining the recursive call Reviewed-by: kvn, twisti
author vlivanov
date Fri, 28 Mar 2014 10:12:48 -0700
parents f834ae379225
children 45e59fae8f2b
line wrap: on
line diff
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Mar 28 10:04:07 2014 -0700
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Fri Mar 28 10:12:48 2014 -0700
@@ -3767,11 +3767,14 @@
   }
 
   // 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");
+  if (callee->force_inline() || callee->should_inline()) {
+    if (inline_level() > MaxForceInlineLevel                    ) INLINE_BAILOUT("MaxForceInlineLevel");
+    if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
+
+    const char* msg = "";
+    if (callee->force_inline())  msg = "force inline by annotation";
+    if (callee->should_inline()) msg = "force inline by CompileOracle";
+    print_inlining(callee, msg);
   } else {
     // use heuristic controls on inlining
     if (inline_level() > MaxInlineLevel                         ) INLINE_BAILOUT("inlining too deep");