src/share/vm/opto/bytecodeInfo.cpp

changeset 2866
b21ecca7ccc4
parent 2687
3d58a4983660
child 2877
bad7ecd0b6ed
     1.1 --- a/src/share/vm/opto/bytecodeInfo.cpp	Thu Apr 28 16:40:23 2011 -0700
     1.2 +++ b/src/share/vm/opto/bytecodeInfo.cpp	Mon May 02 00:55:09 2011 -0700
     1.3 @@ -310,13 +310,14 @@
     1.4      return "inlining too deep";
     1.5    }
     1.6  
     1.7 -  // We need to detect recursive inlining of method handle targets: if
     1.8 -  // the current method is a method handle adapter and one of the
     1.9 -  // callers is the same method as the callee, we bail out if
    1.10 -  // MaxRecursiveInlineLevel is hit.
    1.11 -  if (method()->is_method_handle_adapter()) {
    1.12 +  // detect direct and indirect recursive inlining
    1.13 +  {
    1.14 +    // count the current method and the callee
    1.15 +    int inline_level = (method() == callee_method) ? 1 : 0;
    1.16 +    if (inline_level > MaxRecursiveInlineLevel)
    1.17 +      return "recursively inlining too deep";
    1.18 +    // count callers of current method and callee
    1.19      JVMState* jvms = caller_jvms();
    1.20 -    int inline_level = 0;
    1.21      while (jvms != NULL && jvms->has_method()) {
    1.22        if (jvms->method() == callee_method) {
    1.23          inline_level++;
    1.24 @@ -327,10 +328,6 @@
    1.25      }
    1.26    }
    1.27  
    1.28 -  if (method() == callee_method && inline_depth() > MaxRecursiveInlineLevel) {
    1.29 -    return "recursively inlining too deep";
    1.30 -  }
    1.31 -
    1.32    int size = callee_method->code_size();
    1.33  
    1.34    if (UseOldInlining && ClipInlining

mercurial