145 // On 64-bit systems, scale the number of compiler threads with |
145 // On 64-bit systems, scale the number of compiler threads with |
146 // the number of cores available on the system. Scaling is not |
146 // the number of cores available on the system. Scaling is not |
147 // performed on 32-bit systems because it can lead to exhaustion |
147 // performed on 32-bit systems because it can lead to exhaustion |
148 // of the virtual memory address space available to the JVM. |
148 // of the virtual memory address space available to the JVM. |
149 if (CICompilerCountPerCPU) { |
149 if (CICompilerCountPerCPU) { |
150 count = MAX2(log2_intptr(os::active_processor_count()), 1) * 3 / 2; |
150 count = MAX2(log2_intptr(os::active_processor_count()) * 3 / 2, 2); |
|
151 FLAG_SET_ERGO(intx, CICompilerCount, count); |
151 } |
152 } |
152 #endif |
153 #endif |
153 set_c1_count(MAX2(count / 3, 1)); |
154 if (TieredStopAtLevel < CompLevel_full_optimization) { |
154 set_c2_count(MAX2(count - c1_count(), 1)); |
155 // No C2 compiler thread required |
155 FLAG_SET_ERGO(intx, CICompilerCount, c1_count() + c2_count()); |
156 set_c1_count(count); |
|
157 } else { |
|
158 set_c1_count(MAX2(count / 3, 1)); |
|
159 set_c2_count(MAX2(count - c1_count(), 1)); |
|
160 } |
|
161 assert(count == c1_count() + c2_count(), "inconsistent compiler thread count"); |
156 } |
162 } |
157 |
163 |
158 void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) { |
164 void SimpleThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) { |
159 if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) { |
165 if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) { |
160 counter->set_carry_flag(); |
166 counter->set_carry_flag(); |