File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/hotspot/share/compiler Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -571,8 +571,15 @@ void CompilationPolicy::initialize() {
571571#ifdef COMPILER2
572572 c2_size = C2Compiler::initial_code_buffer_size ();
573573#endif
574- size_t buffer_size = c1_only ? c1_size : (c1_size/3 + 2 *c2_size/3 );
575- size_t max_count = (ReservedCodeCacheSize - (CodeCacheMinimumUseSpace DEBUG_ONLY (* 3 ))) / buffer_size;
574+ size_t buffer_size = 0 ;
575+ if (c1_only) {
576+ buffer_size = c1_size;
577+ } else if (c2_only) {
578+ buffer_size = c2_size;
579+ } else {
580+ buffer_size = c1_size / 3 + 2 * c2_size / 3 ;
581+ }
582+ size_t max_count = (NonNMethodCodeHeapSize - (CodeCacheMinimumUseSpace DEBUG_ONLY (* 3 ))) / buffer_size;
576583 if ((size_t )count > max_count) {
577584 // Lower the compiler count such that all buffers fit into the code cache
578585 count = MAX2 ((int )max_count, min_count);
@@ -591,7 +598,7 @@ void CompilationPolicy::initialize() {
591598 count = 3 ;
592599 FLAG_SET_ERGO (CICompilerCount, count);
593600 }
594- #endif
601+ #endif // _LP64
595602
596603 if (c1_only) {
597604 // No C2 compiler threads are needed
You can’t perform that action at this time.
0 commit comments