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;
|
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 // Current Leyden implementation requires SegmentedCodeCache: the archive-backed code
338 // cache would be initialized only then. Force SegmentedCodeCache if we are loading/storing
339 // cached code. TODO: Resolve this in code cache initialization code.
340 if (!SegmentedCodeCache && (LoadCachedCode || StoreCachedCode)) {
341 FLAG_SET_ERGO(SegmentedCodeCache, true);
342 }
343
344 if (CompileThresholdScaling < 0) {
345 vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", nullptr);
346 }
347
348 if (CompilationModeFlag::disable_intermediate()) {
349 if (FLAG_IS_DEFAULT(Tier0ProfilingStartPercentage)) {
350 FLAG_SET_DEFAULT(Tier0ProfilingStartPercentage, 33);
351 }
352
353 if (FLAG_IS_DEFAULT(Tier4InvocationThreshold)) {
354 FLAG_SET_DEFAULT(Tier4InvocationThreshold, 5000);
355 }
356 if (FLAG_IS_DEFAULT(Tier4MinInvocationThreshold)) {
357 FLAG_SET_DEFAULT(Tier4MinInvocationThreshold, 600);
358 }
359 if (FLAG_IS_DEFAULT(Tier4CompileThreshold)) {
360 FLAG_SET_DEFAULT(Tier4CompileThreshold, 10000);
361 }
362 if (FLAG_IS_DEFAULT(Tier4BackEdgeThreshold)) {
363 FLAG_SET_DEFAULT(Tier4BackEdgeThreshold, 15000);
570 if (NeverActAsServerClassMachine) {
571 set_client_emulation_mode_flags();
572 }
573 } else if (!has_c2() && !is_jvmci_compiler()) {
574 set_client_emulation_mode_flags();
575 }
576 }
577
578 set_legacy_emulation_flags();
579 set_compilation_policy_flags();
580
581 #if INCLUDE_JVMCI
582 // Check that JVMCI supports selected GC.
583 // Should be done after GCConfig::initialize() was called.
584 JVMCIGlobals::check_jvmci_supported_gc();
585
586 // Do JVMCI specific settings
587 set_jvmci_specific_flags();
588 #endif
589
590 if (PreloadOnly) {
591 // Disable profiling/counter updates in interpreter and C1.
592 // This effectively disables most of the normal JIT (re-)compilations.
593 FLAG_SET_DEFAULT(ProfileInterpreter, false);
594 FLAG_SET_DEFAULT(UseOnStackReplacement, false);
595 FLAG_SET_DEFAULT(UseLoopCounter, false);
596
597 // Disable compilations through training data replay.
598 FLAG_SET_DEFAULT(ReplayTraining, false);
599 }
600
601 if (UseOnStackReplacement && !UseLoopCounter) {
602 warning("On-stack-replacement requires loop counters; enabling loop counters");
603 FLAG_SET_DEFAULT(UseLoopCounter, true);
604 }
605
606 if (ProfileInterpreter && CompilerConfig::is_c1_simple_only()) {
607 if (!FLAG_IS_DEFAULT(ProfileInterpreter)) {
608 warning("ProfileInterpreter disabled due to client emulation mode");
609 }
610 FLAG_SET_CMDLINE(ProfileInterpreter, false);
611 }
612
613 #ifdef COMPILER2
614 if (!EliminateLocks) {
615 EliminateNestedLocks = false;
616 }
617 if (!Inline || !IncrementalInline) {
618 IncrementalInline = false;
619 IncrementalInlineMH = false;
620 IncrementalInlineVirtual = false;
|