src/share/vm/runtime/simpleThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File JDK-8026949 Sdiff src/share/vm/runtime

src/share/vm/runtime/simpleThresholdPolicy.cpp

Print this page




 117       need_comma = true;
 118     }
 119     if (!mh->is_not_compilable(CompLevel_full_optimization)) {
 120       if (need_comma) tty->print(",");
 121       tty->print("c2");
 122       need_comma = true;
 123     }
 124     if (!mh->is_not_osr_compilable(CompLevel_full_optimization)) {
 125       if (need_comma) tty->print(",");
 126       tty->print("c2-osr");
 127     }
 128     tty->print(" status=");
 129     if (mh->queued_for_compilation()) {
 130       tty->print("in-queue");
 131     } else tty->print("idle");
 132   }
 133   tty->print_cr("]");
 134 }
 135 
 136 void SimpleThresholdPolicy::initialize() {



 137   if (FLAG_IS_DEFAULT(CICompilerCount)) {
 138     FLAG_SET_DEFAULT(CICompilerCount, 3);
 139   }
 140   int count = CICompilerCount;
 141   if (CICompilerCountPerCPU) {
 142     count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
 143   }
 144   set_c1_count(MAX2(count / 3, 1));
 145   set_c2_count(MAX2(count - count / 3, 1));

 146 }
 147 
 148 void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {
 149   if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) {
 150     counter->set_carry_flag();
 151   }
 152 }
 153 
 154 // Set carry flags on the counters if necessary
 155 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
 156   MethodCounters *mcs = method->method_counters();
 157   if (mcs != NULL) {
 158     set_carry_if_necessary(mcs->invocation_counter());
 159     set_carry_if_necessary(mcs->backedge_counter());
 160   }
 161   MethodData* mdo = method->method_data();
 162   if (mdo != NULL) {
 163     set_carry_if_necessary(mdo->invocation_counter());
 164     set_carry_if_necessary(mdo->backedge_counter());
 165   }




 117       need_comma = true;
 118     }
 119     if (!mh->is_not_compilable(CompLevel_full_optimization)) {
 120       if (need_comma) tty->print(",");
 121       tty->print("c2");
 122       need_comma = true;
 123     }
 124     if (!mh->is_not_osr_compilable(CompLevel_full_optimization)) {
 125       if (need_comma) tty->print(",");
 126       tty->print("c2-osr");
 127     }
 128     tty->print(" status=");
 129     if (mh->queued_for_compilation()) {
 130       tty->print("in-queue");
 131     } else tty->print("idle");
 132   }
 133   tty->print_cr("]");
 134 }
 135 
 136 void SimpleThresholdPolicy::initialize() {
 137   // No need to set number of compiler threads if the VM is started with -Xint
 138   assert ((c1_count() == 0) && (c2_count() == 0), "Must be initialized to 0");
 139   if (Arguments::mode() != Arguments::_int) {
 140     if (FLAG_IS_DEFAULT(CICompilerCount)) {
 141       FLAG_SET_DEFAULT(CICompilerCount, 3);
 142     }
 143     int count = CICompilerCount;
 144     if (CICompilerCountPerCPU) {
 145       count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2;
 146     }
 147     set_c1_count(MAX2(count / 3, 1));
 148     set_c2_count(MAX2(count - count / 3, 1));
 149   }
 150 }
 151 
 152 void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {
 153   if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) {
 154     counter->set_carry_flag();
 155   }
 156 }
 157 
 158 // Set carry flags on the counters if necessary
 159 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
 160   MethodCounters *mcs = method->method_counters();
 161   if (mcs != NULL) {
 162     set_carry_if_necessary(mcs->invocation_counter());
 163     set_carry_if_necessary(mcs->backedge_counter());
 164   }
 165   MethodData* mdo = method->method_data();
 166   if (mdo != NULL) {
 167     set_carry_if_necessary(mdo->invocation_counter());
 168     set_carry_if_necessary(mdo->backedge_counter());
 169   }


src/share/vm/runtime/simpleThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File