# HG changeset patch # User vlivanov # Date 1393928344 28800 # Node ID 1179450ad3eeefaca97e9fddb5e9f89f80e314ba # Parent 3edd4a71588b391a0443e181d131bb33df483b69 8035887: VM crashes trying to force inlining the recursive call Reviewed-by: kvn, twisti diff -r 3edd4a71588b -r 1179450ad3ee src/share/vm/c1/c1_GraphBuilder.cpp --- a/src/share/vm/c1/c1_GraphBuilder.cpp Mon Mar 03 15:31:27 2014 +0400 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Tue Mar 04 02:19:04 2014 -0800 @@ -3771,11 +3771,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"); diff -r 3edd4a71588b -r 1179450ad3ee src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon Mar 03 15:31:27 2014 +0400 +++ b/src/share/vm/runtime/globals.hpp Tue Mar 04 02:19:04 2014 -0800 @@ -2987,7 +2987,8 @@ "maximum number of nested recursive calls that are inlined") \ \ develop(intx, MaxForceInlineLevel, 100, \ - "maximum number of nested @ForceInline calls that are inlined") \ + "maximum number of nested calls that are forced for inlining " \ + "(using CompilerOracle or marked w/ @ForceInline)") \ \ product_pd(intx, InlineSmallCode, \ "Only inline already compiled methods if their code size is " \