# HG changeset patch # User twisti # Date 1304322909 25200 # Node ID b21ecca7ccc4d6fd1a9e551e6594cc34da8c4331 # Parent ae93231c7a1fd75e79bfa1f8f6bdba74429c54d9 6552561: MaxRecursiveInlineLevel flag doesn't operate correctly Reviewed-by: kvn, never diff -r ae93231c7a1f -r b21ecca7ccc4 src/share/vm/opto/bytecodeInfo.cpp --- a/src/share/vm/opto/bytecodeInfo.cpp Thu Apr 28 16:40:23 2011 -0700 +++ b/src/share/vm/opto/bytecodeInfo.cpp Mon May 02 00:55:09 2011 -0700 @@ -310,13 +310,14 @@ return "inlining too deep"; } - // We need to detect recursive inlining of method handle targets: if - // the current method is a method handle adapter and one of the - // callers is the same method as the callee, we bail out if - // MaxRecursiveInlineLevel is hit. - if (method()->is_method_handle_adapter()) { + // detect direct and indirect recursive inlining + { + // count the current method and the callee + int inline_level = (method() == callee_method) ? 1 : 0; + if (inline_level > MaxRecursiveInlineLevel) + return "recursively inlining too deep"; + // count callers of current method and callee JVMState* jvms = caller_jvms(); - int inline_level = 0; while (jvms != NULL && jvms->has_method()) { if (jvms->method() == callee_method) { inline_level++; @@ -327,10 +328,6 @@ } } - if (method() == callee_method && inline_depth() > MaxRecursiveInlineLevel) { - return "recursively inlining too deep"; - } - int size = callee_method->code_size(); if (UseOldInlining && ClipInlining