From bdb8050bbf0577ece28f6535d70f9d64b084f5f2 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 2 Jun 2014 10:01:15 +0200 Subject: [PATCH] 8043413: REGRESSION: Hotspot causes segmentation fault in jdk8ux, but not in jdk7ux Long series of lambda form calls trigger stack overflow in c2 Reviewed-by: kvn, vlivanov --- hotspot/src/share/vm/opto/bytecodeInfo.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 101d5f73325..c4ee166a20c 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -361,11 +361,14 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, set_msg("not an accessor"); return false; } + + // Limit inlining depth in case inlining is forced or + // _max_inline_level was increased to compensate for lambda forms. + if (inline_level() > MaxForceInlineLevel) { + set_msg("MaxForceInlineLevel"); + 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;