src/share/vm/runtime/advancedThresholdPolicy.cpp

changeset 9637
eef07cd490d4
parent 7535
7ae4e26cb1e0
parent 9614
bb44c0e88235
child 9703
2fdf635bcf28
equal deleted inserted replaced
9581:95fce20624fc 9637:eef07cd490d4
45 FLAG_SET_DEFAULT(CICompilerCountPerCPU, true); 45 FLAG_SET_DEFAULT(CICompilerCountPerCPU, true);
46 } 46 }
47 int count = CICompilerCount; 47 int count = CICompilerCount;
48 if (CICompilerCountPerCPU) { 48 if (CICompilerCountPerCPU) {
49 // Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n 49 // Simple log n seems to grow too slowly for tiered, try something faster: log n * log log n
50 int log_cpu = log2_intptr(os::active_processor_count()); 50 int log_cpu = log2_int(os::active_processor_count());
51 int loglog_cpu = log2_intptr(MAX2(log_cpu, 1)); 51 int loglog_cpu = log2_int(MAX2(log_cpu, 1));
52 count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2; 52 count = MAX2(log_cpu * loglog_cpu, 1) * 3 / 2;
53 } 53 }
54 54
55 set_c1_count(MAX2(count / 3, 1)); 55 set_c1_count(MAX2(count / 3, 1));
56 set_c2_count(MAX2(count - c1_count(), 1)); 56 set_c2_count(MAX2(count - c1_count(), 1));
129 bool AdvancedThresholdPolicy::is_old(Method* method) { 129 bool AdvancedThresholdPolicy::is_old(Method* method) {
130 return method->invocation_count() > 50000 || method->backedge_count() > 500000; 130 return method->invocation_count() > 50000 || method->backedge_count() > 500000;
131 } 131 }
132 132
133 double AdvancedThresholdPolicy::weight(Method* method) { 133 double AdvancedThresholdPolicy::weight(Method* method) {
134 return (method->rate() + 1) * ((method->invocation_count() + 1) * (method->backedge_count() + 1)); 134 return (double)(method->rate() + 1) *
135 (method->invocation_count() + 1) * (method->backedge_count() + 1);
135 } 136 }
136 137
137 // Apply heuristics and return true if x should be compiled before y 138 // Apply heuristics and return true if x should be compiled before y
138 bool AdvancedThresholdPolicy::compare_methods(Method* x, Method* y) { 139 bool AdvancedThresholdPolicy::compare_methods(Method* x, Method* y) {
139 if (x->highest_comp_level() > y->highest_comp_level()) { 140 if (x->highest_comp_level() > y->highest_comp_level()) {

mercurial