< prev index next >

src/hotspot/share/compiler/compilerDefinitions.cpp

Print this page

  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 

 25 #include "code/codeCache.hpp"
 26 #include "compiler/compilerDefinitions.inline.hpp"
 27 #include "interpreter/invocationCounter.hpp"
 28 #include "jvm_io.h"
 29 #include "runtime/arguments.hpp"
 30 #include "runtime/continuation.hpp"
 31 #include "runtime/flags/jvmFlag.hpp"
 32 #include "runtime/flags/jvmFlagAccess.hpp"
 33 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
 34 #include "runtime/flags/jvmFlagLimit.hpp"
 35 #include "runtime/globals.hpp"
 36 #include "runtime/globals_extension.hpp"
 37 #include "utilities/defaultStream.hpp"
 38 
 39 const char* compilertype2name_tab[compiler_number_of_types] = {
 40   "",
 41   "c1",
 42   "c2",
 43   "jvmci"
 44 };

317     }
318     // Enable SegmentedCodeCache if tiered compilation is enabled, ReservedCodeCacheSize >= 240M
319     // and the code cache contains at least 8 pages (segmentation disables advantage of huge pages).
320     if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M &&
321         8 * CodeCache::page_size() <= ReservedCodeCacheSize) {
322       FLAG_SET_ERGO(SegmentedCodeCache, true);
323     }
324     if (Arguments::is_compiler_only()) { // -Xcomp
325       // Be much more aggressive in tiered mode with -Xcomp and exercise C2 more.
326       // We will first compile a level 3 version (C1 with full profiling), then do one invocation of it and
327       // compile a level 4 (C2) and then continue executing it.
328       if (FLAG_IS_DEFAULT(Tier3InvokeNotifyFreqLog)) {
329         FLAG_SET_CMDLINE(Tier3InvokeNotifyFreqLog, 0);
330       }
331       if (FLAG_IS_DEFAULT(Tier4InvocationThreshold)) {
332         FLAG_SET_CMDLINE(Tier4InvocationThreshold, 0);
333       }
334     }
335   }
336 











337   if (CompileThresholdScaling < 0) {
338     vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", nullptr);
339   }
340 
341   if (CompilationModeFlag::disable_intermediate()) {
342     if (FLAG_IS_DEFAULT(Tier0ProfilingStartPercentage)) {
343       FLAG_SET_DEFAULT(Tier0ProfilingStartPercentage, 33);
344     }
345 
346     if (FLAG_IS_DEFAULT(Tier4InvocationThreshold)) {
347       FLAG_SET_DEFAULT(Tier4InvocationThreshold, 5000);
348     }
349     if (FLAG_IS_DEFAULT(Tier4MinInvocationThreshold)) {
350       FLAG_SET_DEFAULT(Tier4MinInvocationThreshold, 600);
351     }
352     if (FLAG_IS_DEFAULT(Tier4CompileThreshold)) {
353       FLAG_SET_DEFAULT(Tier4CompileThreshold, 10000);
354     }
355     if (FLAG_IS_DEFAULT(Tier4BackEdgeThreshold)) {
356       FLAG_SET_DEFAULT(Tier4BackEdgeThreshold, 15000);

563       if (NeverActAsServerClassMachine) {
564         set_client_emulation_mode_flags();
565       }
566     } else if (!has_c2() && !is_jvmci_compiler()) {
567       set_client_emulation_mode_flags();
568     }
569   }
570 
571   set_legacy_emulation_flags();
572   set_compilation_policy_flags();
573 
574 #if INCLUDE_JVMCI
575   // Check that JVMCI supports selected GC.
576   // Should be done after GCConfig::initialize() was called.
577   JVMCIGlobals::check_jvmci_supported_gc();
578 
579   // Do JVMCI specific settings
580   set_jvmci_specific_flags();
581 #endif
582 











583   if (UseOnStackReplacement && !UseLoopCounter) {
584     warning("On-stack-replacement requires loop counters; enabling loop counters");
585     FLAG_SET_DEFAULT(UseLoopCounter, true);
586   }
587 
588   if (ProfileInterpreter && CompilerConfig::is_c1_simple_only()) {
589     if (!FLAG_IS_DEFAULT(ProfileInterpreter)) {
590         warning("ProfileInterpreter disabled due to client emulation mode");
591     }
592     FLAG_SET_CMDLINE(ProfileInterpreter, false);
593   }
594 
595 #ifdef COMPILER2
596   if (!EliminateLocks) {
597     EliminateNestedLocks = false;
598   }
599   if (!Inline || !IncrementalInline) {
600     IncrementalInline = false;
601     IncrementalInlineMH = false;
602     IncrementalInlineVirtual = false;

  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "code/aotCodeCache.hpp"
 26 #include "code/codeCache.hpp"
 27 #include "compiler/compilerDefinitions.inline.hpp"
 28 #include "interpreter/invocationCounter.hpp"
 29 #include "jvm_io.h"
 30 #include "runtime/arguments.hpp"
 31 #include "runtime/continuation.hpp"
 32 #include "runtime/flags/jvmFlag.hpp"
 33 #include "runtime/flags/jvmFlagAccess.hpp"
 34 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
 35 #include "runtime/flags/jvmFlagLimit.hpp"
 36 #include "runtime/globals.hpp"
 37 #include "runtime/globals_extension.hpp"
 38 #include "utilities/defaultStream.hpp"
 39 
 40 const char* compilertype2name_tab[compiler_number_of_types] = {
 41   "",
 42   "c1",
 43   "c2",
 44   "jvmci"
 45 };

318     }
319     // Enable SegmentedCodeCache if tiered compilation is enabled, ReservedCodeCacheSize >= 240M
320     // and the code cache contains at least 8 pages (segmentation disables advantage of huge pages).
321     if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M &&
322         8 * CodeCache::page_size() <= ReservedCodeCacheSize) {
323       FLAG_SET_ERGO(SegmentedCodeCache, true);
324     }
325     if (Arguments::is_compiler_only()) { // -Xcomp
326       // Be much more aggressive in tiered mode with -Xcomp and exercise C2 more.
327       // We will first compile a level 3 version (C1 with full profiling), then do one invocation of it and
328       // compile a level 4 (C2) and then continue executing it.
329       if (FLAG_IS_DEFAULT(Tier3InvokeNotifyFreqLog)) {
330         FLAG_SET_CMDLINE(Tier3InvokeNotifyFreqLog, 0);
331       }
332       if (FLAG_IS_DEFAULT(Tier4InvocationThreshold)) {
333         FLAG_SET_CMDLINE(Tier4InvocationThreshold, 0);
334       }
335     }
336   }
337 
338   // Current Leyden implementation requires SegmentedCodeCache: the archive-backed code
339   // cache would be initialized only then. Force SegmentedCodeCache if we are loading/storing
340   // cached code. TODO: Resolve this in code cache initialization code.
341   if (!SegmentedCodeCache && AOTCodeCache::is_caching_enabled()) {
342     FLAG_SET_ERGO(SegmentedCodeCache, true);
343     if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
344       FLAG_SET_ERGO(ReservedCodeCacheSize,
345                     MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)ReservedCodeCacheSize * 5));
346     }
347   }
348 
349   if (CompileThresholdScaling < 0) {
350     vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", nullptr);
351   }
352 
353   if (CompilationModeFlag::disable_intermediate()) {
354     if (FLAG_IS_DEFAULT(Tier0ProfilingStartPercentage)) {
355       FLAG_SET_DEFAULT(Tier0ProfilingStartPercentage, 33);
356     }
357 
358     if (FLAG_IS_DEFAULT(Tier4InvocationThreshold)) {
359       FLAG_SET_DEFAULT(Tier4InvocationThreshold, 5000);
360     }
361     if (FLAG_IS_DEFAULT(Tier4MinInvocationThreshold)) {
362       FLAG_SET_DEFAULT(Tier4MinInvocationThreshold, 600);
363     }
364     if (FLAG_IS_DEFAULT(Tier4CompileThreshold)) {
365       FLAG_SET_DEFAULT(Tier4CompileThreshold, 10000);
366     }
367     if (FLAG_IS_DEFAULT(Tier4BackEdgeThreshold)) {
368       FLAG_SET_DEFAULT(Tier4BackEdgeThreshold, 15000);

575       if (NeverActAsServerClassMachine) {
576         set_client_emulation_mode_flags();
577       }
578     } else if (!has_c2() && !is_jvmci_compiler()) {
579       set_client_emulation_mode_flags();
580     }
581   }
582 
583   set_legacy_emulation_flags();
584   set_compilation_policy_flags();
585 
586 #if INCLUDE_JVMCI
587   // Check that JVMCI supports selected GC.
588   // Should be done after GCConfig::initialize() was called.
589   JVMCIGlobals::check_jvmci_supported_gc();
590 
591   // Do JVMCI specific settings
592   set_jvmci_specific_flags();
593 #endif
594 
595   if (PreloadOnly) {
596     // Disable profiling/counter updates in interpreter and C1.
597     // This effectively disables most of the normal JIT (re-)compilations.
598     FLAG_SET_DEFAULT(ProfileInterpreter, false);
599     FLAG_SET_DEFAULT(UseOnStackReplacement, false);
600     FLAG_SET_DEFAULT(UseLoopCounter, false);
601 
602     // Disable compilations through training data replay.
603     FLAG_SET_DEFAULT(AOTReplayTraining, false);
604   }
605 
606   if (UseOnStackReplacement && !UseLoopCounter) {
607     warning("On-stack-replacement requires loop counters; enabling loop counters");
608     FLAG_SET_DEFAULT(UseLoopCounter, true);
609   }
610 
611   if (ProfileInterpreter && CompilerConfig::is_c1_simple_only()) {
612     if (!FLAG_IS_DEFAULT(ProfileInterpreter)) {
613         warning("ProfileInterpreter disabled due to client emulation mode");
614     }
615     FLAG_SET_CMDLINE(ProfileInterpreter, false);
616   }
617 
618 #ifdef COMPILER2
619   if (!EliminateLocks) {
620     EliminateNestedLocks = false;
621   }
622   if (!Inline || !IncrementalInline) {
623     IncrementalInline = false;
624     IncrementalInlineMH = false;
625     IncrementalInlineVirtual = false;
< prev index next >