src/share/vm/opto/bytecodeInfo.cpp

changeset 6314
1419657ed891
parent 6217
849eb7bfceac
child 6709
73c839dda17e
     1.1 --- a/src/share/vm/opto/bytecodeInfo.cpp	Fri Jan 24 09:31:53 2014 +0100
     1.2 +++ b/src/share/vm/opto/bytecodeInfo.cpp	Fri Jan 24 15:26:56 2014 +0400
     1.3 @@ -63,34 +63,14 @@
     1.4    assert(_caller_jvms->same_calls_as(caller_jvms), "consistent JVMS");
     1.5    assert((caller_tree == NULL ? 0 : caller_tree->stack_depth() + 1) == stack_depth(), "correct (redundant) depth parameter");
     1.6    assert(caller_bci == this->caller_bci(), "correct (redundant) bci parameter");
     1.7 -  if (UseOldInlining) {
     1.8 -    // Update hierarchical counts, count_inline_bcs() and count_inlines()
     1.9 -    InlineTree *caller = (InlineTree *)caller_tree;
    1.10 -    for( ; caller != NULL; caller = ((InlineTree *)(caller->caller_tree())) ) {
    1.11 -      caller->_count_inline_bcs += count_inline_bcs();
    1.12 -      NOT_PRODUCT(caller->_count_inlines++;)
    1.13 -    }
    1.14 +  // Update hierarchical counts, count_inline_bcs() and count_inlines()
    1.15 +  InlineTree *caller = (InlineTree *)caller_tree;
    1.16 +  for( ; caller != NULL; caller = ((InlineTree *)(caller->caller_tree())) ) {
    1.17 +    caller->_count_inline_bcs += count_inline_bcs();
    1.18 +    NOT_PRODUCT(caller->_count_inlines++;)
    1.19    }
    1.20  }
    1.21  
    1.22 -InlineTree::InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms,
    1.23 -                       float site_invoke_ratio, int max_inline_level) :
    1.24 -  C(c),
    1.25 -  _caller_jvms(caller_jvms),
    1.26 -  _caller_tree(NULL),
    1.27 -  _method(callee_method),
    1.28 -  _site_invoke_ratio(site_invoke_ratio),
    1.29 -  _max_inline_level(max_inline_level),
    1.30 -  _count_inline_bcs(method()->code_size()),
    1.31 -  _msg(NULL)
    1.32 -{
    1.33 -#ifndef PRODUCT
    1.34 -  _count_inlines = 0;
    1.35 -  _forced_inline = false;
    1.36 -#endif
    1.37 -  assert(!UseOldInlining, "do not use for old stuff");
    1.38 -}
    1.39 -
    1.40  /**
    1.41   *  Return true when EA is ON and a java constructor is called or
    1.42   *  a super constructor is called from an inlined java constructor.
    1.43 @@ -161,11 +141,6 @@
    1.44      return true;
    1.45    }
    1.46  
    1.47 -  if (!UseOldInlining) {
    1.48 -    set_msg("!UseOldInlining");
    1.49 -    return true;  // size and frequency are represented in a new way
    1.50 -  }
    1.51 -
    1.52    int default_max_inline_size = C->max_inline_size();
    1.53    int inline_small_code_size  = InlineSmallCode / 4;
    1.54    int max_inline_size         = default_max_inline_size;
    1.55 @@ -229,35 +204,6 @@
    1.56      fail_msg = "don't inline by annotation";
    1.57    }
    1.58  
    1.59 -  if (!UseOldInlining) {
    1.60 -    if (fail_msg != NULL) {
    1.61 -      *wci_result = *(WarmCallInfo::always_cold());
    1.62 -      set_msg(fail_msg);
    1.63 -      return true;
    1.64 -    }
    1.65 -
    1.66 -    if (callee_method->has_unloaded_classes_in_signature()) {
    1.67 -      wci_result->set_profit(wci_result->profit() * 0.1);
    1.68 -    }
    1.69 -
    1.70 -    // don't inline exception code unless the top method belongs to an
    1.71 -    // exception class
    1.72 -    if (callee_method->holder()->is_subclass_of(C->env()->Throwable_klass())) {
    1.73 -      ciMethod* top_method = jvms->caller() != NULL ? jvms->caller()->of_depth(1)->method() : method();
    1.74 -      if (!top_method->holder()->is_subclass_of(C->env()->Throwable_klass())) {
    1.75 -        wci_result->set_profit(wci_result->profit() * 0.1);
    1.76 -      }
    1.77 -    }
    1.78 -
    1.79 -    if (callee_method->has_compiled_code() &&
    1.80 -        callee_method->instructions_size() > InlineSmallCode) {
    1.81 -      wci_result->set_profit(wci_result->profit() * 0.1);
    1.82 -      // %%% adjust wci_result->size()?
    1.83 -    }
    1.84 -
    1.85 -    return false;
    1.86 -  }
    1.87 -
    1.88    // one more inlining restriction
    1.89    if (fail_msg == NULL && callee_method->has_unloaded_classes_in_signature()) {
    1.90      fail_msg = "unloaded signature classes";
    1.91 @@ -360,9 +306,7 @@
    1.92                                 int caller_bci, JVMState* jvms, ciCallProfile& profile,
    1.93                                 WarmCallInfo* wci_result, bool& should_delay) {
    1.94  
    1.95 -   // Old algorithm had funny accumulating BC-size counters
    1.96 -  if (UseOldInlining && ClipInlining
    1.97 -      && (int)count_inline_bcs() >= DesiredMethodLimit) {
    1.98 +  if (ClipInlining && (int)count_inline_bcs() >= DesiredMethodLimit) {
    1.99      if (!callee_method->force_inline() || !IncrementalInline) {
   1.100        set_msg("size > DesiredMethodLimit");
   1.101        return false;
   1.102 @@ -465,8 +409,7 @@
   1.103  
   1.104    int size = callee_method->code_size_for_inlining();
   1.105  
   1.106 -  if (UseOldInlining && ClipInlining
   1.107 -      && (int)count_inline_bcs() + size >= DesiredMethodLimit) {
   1.108 +  if (ClipInlining && (int)count_inline_bcs() + size >= DesiredMethodLimit) {
   1.109      if (!callee_method->force_inline() || !IncrementalInline) {
   1.110        set_msg("size > DesiredMethodLimit");
   1.111        return false;
   1.112 @@ -584,8 +527,7 @@
   1.113                                 jvms, profile, &wci, should_delay);
   1.114  
   1.115  #ifndef PRODUCT
   1.116 -  if (UseOldInlining && InlineWarmCalls
   1.117 -      && (PrintOpto || C->print_inlining())) {
   1.118 +  if (InlineWarmCalls && (PrintOpto || C->print_inlining())) {
   1.119      bool cold = wci.is_cold();
   1.120      bool hot  = !cold && wci.is_hot();
   1.121      bool old_cold = !success;
   1.122 @@ -599,13 +541,12 @@
   1.123      }
   1.124    }
   1.125  #endif
   1.126 -  if (UseOldInlining) {
   1.127 -    if (success) {
   1.128 -      wci = *(WarmCallInfo::always_hot());
   1.129 -    } else {
   1.130 -      wci = *(WarmCallInfo::always_cold());
   1.131 -    }
   1.132 +  if (success) {
   1.133 +    wci = *(WarmCallInfo::always_hot());
   1.134 +  } else {
   1.135 +    wci = *(WarmCallInfo::always_cold());
   1.136    }
   1.137 +
   1.138    if (!InlineWarmCalls) {
   1.139      if (!wci.is_cold() && !wci.is_hot()) {
   1.140        // Do not inline the warm calls.
   1.141 @@ -619,8 +560,7 @@
   1.142        set_msg("inline (hot)");
   1.143      }
   1.144      print_inlining(callee_method, caller_bci, true /* success */);
   1.145 -    if (UseOldInlining)
   1.146 -      build_inline_tree_for_callee(callee_method, jvms, caller_bci);
   1.147 +    build_inline_tree_for_callee(callee_method, jvms, caller_bci);
   1.148      if (InlineWarmCalls && !wci.is_hot())
   1.149        return new (C) WarmCallInfo(wci);  // copy to heap
   1.150      return WarmCallInfo::always_hot();

mercurial