src/hotspot/share/compiler/compilerDefinitions.cpp
author coleenp
Wed, 13 Nov 2019 08:23:23 -0500
changeset 59056 15936b142f86
parent 59027 65dc025d5e7e
permissions -rw-r--r--
8233913: Remove implicit conversion from Method* to methodHandle Summary: Fix call sites to use existing THREAD local or pass down THREAD local for shallower callsites. Make linkResolver methods return Method* for caller to handleize if needed. Reviewed-by: iklam, thartmann, hseigel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42040
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     1
/*
53592
8da08ded586f 8217848: [Graal] vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java fails
iignatyev
parents: 52934
diff changeset
     2
 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
42040
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     4
 *
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     7
 * published by the Free Software Foundation.
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     8
 *
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    13
 * accompanied this code).
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    14
 *
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    18
 *
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    21
 * questions.
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    22
 *
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    23
 */
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    24
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    25
#include "precompiled.hpp"
52870
a76b7884b59a 8208277: Code cache heap (-XX:ReservedCodeCacheSize) doesn't work with 1GB LargePages
thartmann
parents: 51002
diff changeset
    26
#include "code/codeCache.hpp"
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    27
#include "runtime/globals.hpp"
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    28
#include "runtime/globals_extension.hpp"
42040
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    29
#include "compiler/compilerDefinitions.hpp"
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    30
#include "gc/shared/gcConfig.hpp"
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    31
#include "utilities/defaultStream.hpp"
42040
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    32
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    33
const char* compilertype2name_tab[compiler_number_of_types] = {
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    34
  "",
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    35
  "c1",
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    36
  "c2",
47687
fb290fd1f9d4 8171853: Remove Shark compiler
rkennke
parents: 47216
diff changeset
    37
  "jvmci"
42040
70ec5a09a0d5 8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
diff changeset
    38
};
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    39
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    40
#ifdef TIERED
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    41
bool CompilationModeFlag::_quick_only = false;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    42
bool CompilationModeFlag::_high_only = false;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    43
bool CompilationModeFlag::_high_only_quick_internal = false;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    44
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    45
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    46
bool CompilationModeFlag::initialize() {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    47
  if (CompilationMode != NULL) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    48
    if (strcmp(CompilationMode, "default") == 0) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    49
      // Do nothing, just support the "default" keyword.
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    50
    } else if (strcmp(CompilationMode, "quick-only") == 0) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    51
      _quick_only = true;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    52
    } else if (strcmp(CompilationMode, "high-only") == 0) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    53
      _high_only = true;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    54
    } else if (strcmp(CompilationMode, "high-only-quick-internal") == 0) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    55
      _high_only_quick_internal = true;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    56
    } else {
59027
65dc025d5e7e 8233885: Test fails with assert(comp != __null) failed: Ensure we have a compiler
jiefu
parents: 58926
diff changeset
    57
      jio_fprintf(defaultStream::error_stream(), "Unsupported compilation mode '%s', supported modes are: quick-only, high-only, high-only-quick-internal\n", CompilationMode);
65dc025d5e7e 8233885: Test fails with assert(comp != __null) failed: Ensure we have a compiler
jiefu
parents: 58926
diff changeset
    58
      return false;
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    59
    }
59027
65dc025d5e7e 8233885: Test fails with assert(comp != __null) failed: Ensure we have a compiler
jiefu
parents: 58926
diff changeset
    60
    if (disable_intermediate()) {
65dc025d5e7e 8233885: Test fails with assert(comp != __null) failed: Ensure we have a compiler
jiefu
parents: 58926
diff changeset
    61
      CompLevel_initial_compile = CompLevel_full_optimization;
65dc025d5e7e 8233885: Test fails with assert(comp != __null) failed: Ensure we have a compiler
jiefu
parents: 58926
diff changeset
    62
    }
65dc025d5e7e 8233885: Test fails with assert(comp != __null) failed: Ensure we have a compiler
jiefu
parents: 58926
diff changeset
    63
  }
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    64
  return true;
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    65
}
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    66
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    67
#endif
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
    68
47687
fb290fd1f9d4 8171853: Remove Shark compiler
rkennke
parents: 47216
diff changeset
    69
#if defined(COMPILER2)
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    70
CompLevel  CompLevel_highest_tier      = CompLevel_full_optimization;  // pure C2 and tiered or JVMCI and tiered
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    71
#elif defined(COMPILER1)
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    72
CompLevel  CompLevel_highest_tier      = CompLevel_simple;             // pure C1 or JVMCI
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    73
#else
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    74
CompLevel  CompLevel_highest_tier      = CompLevel_none;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    75
#endif
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    76
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    77
#if defined(TIERED)
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    78
CompLevel  CompLevel_initial_compile   = CompLevel_full_profile;        // tiered
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    79
#elif defined(COMPILER1) || INCLUDE_JVMCI
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    80
CompLevel  CompLevel_initial_compile   = CompLevel_simple;              // pure C1 or JVMCI
47687
fb290fd1f9d4 8171853: Remove Shark compiler
rkennke
parents: 47216
diff changeset
    81
#elif defined(COMPILER2)
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    82
CompLevel  CompLevel_initial_compile   = CompLevel_full_optimization;   // pure C2
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    83
#else
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    84
CompLevel  CompLevel_initial_compile   = CompLevel_none;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    85
#endif
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    86
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    87
#if defined(COMPILER2)
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    88
CompMode  Compilation_mode             = CompMode_server;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    89
#elif defined(COMPILER1)
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    90
CompMode  Compilation_mode             = CompMode_client;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    91
#else
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    92
CompMode  Compilation_mode             = CompMode_none;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    93
#endif
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
    94
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    95
// Returns threshold scaled with CompileThresholdScaling
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    96
intx CompilerConfig::scaled_compile_threshold(intx threshold) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    97
  return scaled_compile_threshold(threshold, CompileThresholdScaling);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    98
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
    99
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   100
// Returns freq_log scaled with CompileThresholdScaling
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   101
intx CompilerConfig::scaled_freq_log(intx freq_log) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   102
  return scaled_freq_log(freq_log, CompileThresholdScaling);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   103
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   104
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   105
// Returns threshold scaled with the value of scale.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   106
// If scale < 0.0, threshold is returned without scaling.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   107
intx CompilerConfig::scaled_compile_threshold(intx threshold, double scale) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   108
  if (scale == 1.0 || scale < 0.0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   109
    return threshold;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   110
  } else {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   111
    return (intx)(threshold * scale);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   112
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   113
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   114
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   115
// Returns freq_log scaled with the value of scale.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   116
// Returned values are in the range of [0, InvocationCounter::number_of_count_bits + 1].
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   117
// If scale < 0.0, freq_log is returned without scaling.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   118
intx CompilerConfig::scaled_freq_log(intx freq_log, double scale) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   119
  // Check if scaling is necessary or if negative value was specified.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   120
  if (scale == 1.0 || scale < 0.0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   121
    return freq_log;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   122
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   123
  // Check values to avoid calculating log2 of 0.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   124
  if (scale == 0.0 || freq_log == 0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   125
    return 0;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   126
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   127
  // Determine the maximum notification frequency value currently supported.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   128
  // The largest mask value that the interpreter/C1 can handle is
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   129
  // of length InvocationCounter::number_of_count_bits. Mask values are always
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   130
  // one bit shorter then the value of the notification frequency. Set
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   131
  // max_freq_bits accordingly.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   132
  intx max_freq_bits = InvocationCounter::number_of_count_bits + 1;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   133
  intx scaled_freq = scaled_compile_threshold((intx)1 << freq_log, scale);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   134
  if (scaled_freq == 0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   135
    // Return 0 right away to avoid calculating log2 of 0.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   136
    return 0;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   137
  } else if (scaled_freq > nth_bit(max_freq_bits)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   138
    return max_freq_bits;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   139
  } else {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   140
    return log2_intptr(scaled_freq);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   141
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   142
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   143
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   144
#ifdef TIERED
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   145
void set_client_compilation_mode() {
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   146
  Compilation_mode = CompMode_client;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   147
  CompLevel_highest_tier = CompLevel_simple;
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   148
  CompLevel_initial_compile = CompLevel_simple;
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   149
  FLAG_SET_ERGO(TieredCompilation, false);
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   150
  FLAG_SET_ERGO(ProfileInterpreter, false);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   151
#if INCLUDE_JVMCI
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   152
  FLAG_SET_ERGO(EnableJVMCI, false);
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   153
  FLAG_SET_ERGO(UseJVMCICompiler, false);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   154
#endif
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   155
#if INCLUDE_AOT
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   156
  FLAG_SET_ERGO(UseAOT, false);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   157
#endif
43473
3beee3e324cf 8173037: V [jvm.dll+0x2343fc] GraphBuilder::args_list_for_profiling+0x8c
jcm
parents: 43455
diff changeset
   158
  if (FLAG_IS_DEFAULT(NeverActAsServerClassMachine)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   159
    FLAG_SET_ERGO(NeverActAsServerClassMachine, true);
43473
3beee3e324cf 8173037: V [jvm.dll+0x2343fc] GraphBuilder::args_list_for_profiling+0x8c
jcm
parents: 43455
diff changeset
   160
  }
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   161
  if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   162
    FLAG_SET_ERGO(InitialCodeCacheSize, 160*K);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   163
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   164
  if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   165
    FLAG_SET_ERGO(ReservedCodeCacheSize, 32*M);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   166
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   167
  if (FLAG_IS_DEFAULT(NonProfiledCodeHeapSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   168
    FLAG_SET_ERGO(NonProfiledCodeHeapSize, 27*M);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   169
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   170
  if (FLAG_IS_DEFAULT(ProfiledCodeHeapSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   171
    FLAG_SET_ERGO(ProfiledCodeHeapSize, 0);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   172
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   173
  if (FLAG_IS_DEFAULT(NonNMethodCodeHeapSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   174
    FLAG_SET_ERGO(NonNMethodCodeHeapSize, 5*M);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   175
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   176
  if (FLAG_IS_DEFAULT(CodeCacheExpansionSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   177
    FLAG_SET_ERGO(CodeCacheExpansionSize, 32*K);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   178
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   179
  if (FLAG_IS_DEFAULT(MetaspaceSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   180
    FLAG_SET_ERGO(MetaspaceSize, MIN2(12*M, MaxMetaspaceSize));
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   181
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   182
  if (FLAG_IS_DEFAULT(MaxRAM)) {
44320
27047c8fa964 8176573: Do not use FLAG_SET_ERGO to update MaxRAM for emulated client
jcm
parents: 43473
diff changeset
   183
    // Do not use FLAG_SET_ERGO to update MaxRAM, as this will impact
27047c8fa964 8176573: Do not use FLAG_SET_ERGO to update MaxRAM for emulated client
jcm
parents: 43473
diff changeset
   184
    // heap setting done based on available phys_mem (see Arguments::set_heap_size).
27047c8fa964 8176573: Do not use FLAG_SET_ERGO to update MaxRAM for emulated client
jcm
parents: 43473
diff changeset
   185
    FLAG_SET_DEFAULT(MaxRAM, 1ULL*G);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   186
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   187
  if (FLAG_IS_DEFAULT(CompileThreshold)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   188
    FLAG_SET_ERGO(CompileThreshold, 1500);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   189
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   190
  if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   191
    FLAG_SET_ERGO(OnStackReplacePercentage, 933);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   192
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   193
  if (FLAG_IS_DEFAULT(CICompilerCount)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   194
    FLAG_SET_ERGO(CICompilerCount, 1);
43455
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   195
  }
96560cffef4d 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 42040
diff changeset
   196
}
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   197
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   198
bool compilation_mode_selected() {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   199
  return !FLAG_IS_DEFAULT(TieredCompilation) ||
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   200
         !FLAG_IS_DEFAULT(TieredStopAtLevel) ||
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   201
         !FLAG_IS_DEFAULT(UseAOT)
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   202
         JVMCI_ONLY(|| !FLAG_IS_DEFAULT(EnableJVMCI)
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   203
                    || !FLAG_IS_DEFAULT(UseJVMCICompiler));
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   204
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   205
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   206
void select_compilation_mode_ergonomically() {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   207
#if defined(_WINDOWS) && !defined(_LP64)
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   208
  if (FLAG_IS_DEFAULT(NeverActAsServerClassMachine)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   209
    FLAG_SET_ERGO(NeverActAsServerClassMachine, true);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   210
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   211
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   212
  if (NeverActAsServerClassMachine) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   213
    set_client_compilation_mode();
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   214
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   215
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   216
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   217
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   218
void CompilerConfig::set_tiered_flags() {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   219
  // Increase the code cache size - tiered compiles a lot more.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   220
  if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   221
    FLAG_SET_ERGO(ReservedCodeCacheSize,
50676
8c0a5b51559b 8203030: Zero s390 31 bit size_t type conflicts in shared code
chrisphi
parents: 50589
diff changeset
   222
                  MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)ReservedCodeCacheSize * 5));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   223
  }
52870
a76b7884b59a 8208277: Code cache heap (-XX:ReservedCodeCacheSize) doesn't work with 1GB LargePages
thartmann
parents: 51002
diff changeset
   224
  // Enable SegmentedCodeCache if TieredCompilation is enabled, ReservedCodeCacheSize >= 240M
a76b7884b59a 8208277: Code cache heap (-XX:ReservedCodeCacheSize) doesn't work with 1GB LargePages
thartmann
parents: 51002
diff changeset
   225
  // and the code cache contains at least 8 pages (segmentation disables advantage of huge pages).
a76b7884b59a 8208277: Code cache heap (-XX:ReservedCodeCacheSize) doesn't work with 1GB LargePages
thartmann
parents: 51002
diff changeset
   226
  if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M &&
a76b7884b59a 8208277: Code cache heap (-XX:ReservedCodeCacheSize) doesn't work with 1GB LargePages
thartmann
parents: 51002
diff changeset
   227
      8 * CodeCache::page_size() <= ReservedCodeCacheSize) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   228
    FLAG_SET_ERGO(SegmentedCodeCache, true);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   229
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   230
  if (!UseInterpreter) { // -Xcomp
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   231
    Tier3InvokeNotifyFreqLog = 0;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   232
    Tier4InvocationThreshold = 0;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   233
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   234
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   235
  if (CompileThresholdScaling < 0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   236
    vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", NULL);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   237
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   238
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   239
  if (CompilationModeFlag::disable_intermediate()) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   240
    if (FLAG_IS_DEFAULT(Tier0ProfilingStartPercentage)) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   241
      FLAG_SET_DEFAULT(Tier0ProfilingStartPercentage, 33);
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   242
    }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   243
  }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   244
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   245
  // Scale tiered compilation thresholds.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   246
  // CompileThresholdScaling == 0.0 is equivalent to -Xint and leaves compilation thresholds unchanged.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   247
  if (!FLAG_IS_DEFAULT(CompileThresholdScaling) && CompileThresholdScaling > 0.0) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   248
    FLAG_SET_ERGO(Tier0InvokeNotifyFreqLog, scaled_freq_log(Tier0InvokeNotifyFreqLog));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   249
    FLAG_SET_ERGO(Tier0BackedgeNotifyFreqLog, scaled_freq_log(Tier0BackedgeNotifyFreqLog));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   250
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   251
    FLAG_SET_ERGO(Tier3InvocationThreshold, scaled_compile_threshold(Tier3InvocationThreshold));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   252
    FLAG_SET_ERGO(Tier3MinInvocationThreshold, scaled_compile_threshold(Tier3MinInvocationThreshold));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   253
    FLAG_SET_ERGO(Tier3CompileThreshold, scaled_compile_threshold(Tier3CompileThreshold));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   254
    FLAG_SET_ERGO(Tier3BackEdgeThreshold, scaled_compile_threshold(Tier3BackEdgeThreshold));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   255
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   256
    // Tier2{Invocation,MinInvocation,Compile,Backedge}Threshold should be scaled here
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   257
    // once these thresholds become supported.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   258
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   259
    FLAG_SET_ERGO(Tier2InvokeNotifyFreqLog, scaled_freq_log(Tier2InvokeNotifyFreqLog));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   260
    FLAG_SET_ERGO(Tier2BackedgeNotifyFreqLog, scaled_freq_log(Tier2BackedgeNotifyFreqLog));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   261
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   262
    FLAG_SET_ERGO(Tier3InvokeNotifyFreqLog, scaled_freq_log(Tier3InvokeNotifyFreqLog));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   263
    FLAG_SET_ERGO(Tier3BackedgeNotifyFreqLog, scaled_freq_log(Tier3BackedgeNotifyFreqLog));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   264
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   265
    FLAG_SET_ERGO(Tier23InlineeNotifyFreqLog, scaled_freq_log(Tier23InlineeNotifyFreqLog));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   266
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   267
    FLAG_SET_ERGO(Tier4InvocationThreshold, scaled_compile_threshold(Tier4InvocationThreshold));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   268
    FLAG_SET_ERGO(Tier4MinInvocationThreshold, scaled_compile_threshold(Tier4MinInvocationThreshold));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   269
    FLAG_SET_ERGO(Tier4CompileThreshold, scaled_compile_threshold(Tier4CompileThreshold));
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   270
    FLAG_SET_ERGO(Tier4BackEdgeThreshold, scaled_compile_threshold(Tier4BackEdgeThreshold));
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   271
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   272
    if (CompilationModeFlag::disable_intermediate()) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   273
      FLAG_SET_ERGO(Tier40InvocationThreshold, scaled_compile_threshold(Tier40InvocationThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   274
      FLAG_SET_ERGO(Tier40MinInvocationThreshold, scaled_compile_threshold(Tier40MinInvocationThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   275
      FLAG_SET_ERGO(Tier40CompileThreshold, scaled_compile_threshold(Tier40CompileThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   276
      FLAG_SET_ERGO(Tier40BackEdgeThreshold, scaled_compile_threshold(Tier40BackEdgeThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   277
    }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   278
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   279
#if INCLUDE_AOT
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   280
    if (UseAOT) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   281
      FLAG_SET_ERGO(Tier3AOTInvocationThreshold, scaled_compile_threshold(Tier3AOTInvocationThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   282
      FLAG_SET_ERGO(Tier3AOTMinInvocationThreshold, scaled_compile_threshold(Tier3AOTMinInvocationThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   283
      FLAG_SET_ERGO(Tier3AOTCompileThreshold, scaled_compile_threshold(Tier3AOTCompileThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   284
      FLAG_SET_ERGO(Tier3AOTBackEdgeThreshold, scaled_compile_threshold(Tier3AOTBackEdgeThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   285
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   286
      if (CompilationModeFlag::disable_intermediate()) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   287
        FLAG_SET_ERGO(Tier0AOTInvocationThreshold, scaled_compile_threshold(Tier0AOTInvocationThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   288
        FLAG_SET_ERGO(Tier0AOTMinInvocationThreshold, scaled_compile_threshold(Tier0AOTMinInvocationThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   289
        FLAG_SET_ERGO(Tier0AOTCompileThreshold, scaled_compile_threshold(Tier0AOTCompileThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   290
        FLAG_SET_ERGO(Tier0AOTBackEdgeThreshold, scaled_compile_threshold(Tier0AOTBackEdgeThreshold));
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   291
      }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   292
    }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   293
#endif // INCLUDE_AOT
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   294
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   295
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   296
58926
ecb801342b8c 8233429: Minimal and zero VM build broken after JDK-8227003
jiefu
parents: 58894
diff changeset
   297
#endif // TIERED
ecb801342b8c 8233429: Minimal and zero VM build broken after JDK-8227003
jiefu
parents: 58894
diff changeset
   298
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   299
#if INCLUDE_JVMCI
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   300
void set_jvmci_specific_flags() {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   301
  if (UseJVMCICompiler) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   302
    Compilation_mode = CompMode_server;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   303
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   304
    if (FLAG_IS_DEFAULT(TypeProfileWidth)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   305
      FLAG_SET_DEFAULT(TypeProfileWidth, 8);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   306
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   307
    if (FLAG_IS_DEFAULT(TypeProfileLevel)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   308
      FLAG_SET_DEFAULT(TypeProfileLevel, 0);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   309
    }
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   310
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   311
    if (UseJVMCINativeLibrary) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   312
      // SVM compiled code requires more stack space
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   313
      if (FLAG_IS_DEFAULT(CompilerThreadStackSize)) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   314
        // Duplicate logic in the implementations of os::create_thread
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   315
        // so that we can then double the computed stack size. Once
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   316
        // the stack size requirements of SVM are better understood,
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   317
        // this logic can be pushed down into os::create_thread.
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   318
        int stack_size = CompilerThreadStackSize;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   319
        if (stack_size == 0) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   320
          stack_size = VMThreadStackSize;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   321
        }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   322
        if (stack_size != 0) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   323
          FLAG_SET_DEFAULT(CompilerThreadStackSize, stack_size * 2);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   324
        }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   325
      }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   326
    } else {
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   327
#ifdef TIERED
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   328
      if (!TieredCompilation) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   329
         warning("Disabling tiered compilation with non-native JVMCI compiler is not recommended. "
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   330
                 "Turning on tiered compilation and disabling intermediate compilation levels instead. ");
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   331
         FLAG_SET_ERGO(TieredCompilation, true);
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   332
         if (CompilationModeFlag::normal()) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   333
           CompilationModeFlag::set_high_only_quick_internal(true);
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   334
         }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   335
         if (CICompilerCount < 2 && CompilationModeFlag::quick_internal()) {
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   336
            warning("Increasing number of compiler threads for JVMCI compiler.");
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   337
            FLAG_SET_ERGO(CICompilerCount, 2);
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   338
         }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   339
      }
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   340
#else // TIERED
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   341
      // Adjust the on stack replacement percentage to avoid early
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   342
      // OSR compilations while JVMCI itself is warming up
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   343
      if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   344
        FLAG_SET_DEFAULT(OnStackReplacePercentage, 933);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   345
      }
58894
b95bead30957 8227003: Add high-level JIT compilation mode control mechanism
iveresov
parents: 58367
diff changeset
   346
#endif // !TIERED
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   347
      // JVMCI needs values not less than defaults
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   348
      if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   349
        FLAG_SET_DEFAULT(ReservedCodeCacheSize, MAX2(64*M, ReservedCodeCacheSize));
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   350
      }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   351
      if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   352
        FLAG_SET_DEFAULT(InitialCodeCacheSize, MAX2(16*M, InitialCodeCacheSize));
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   353
      }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   354
      if (FLAG_IS_DEFAULT(MetaspaceSize)) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   355
        FLAG_SET_DEFAULT(MetaspaceSize, MIN2(MAX2(12*M, MetaspaceSize), MaxMetaspaceSize));
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   356
      }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   357
      if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   358
        FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease));
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   359
      }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   360
    } // !UseJVMCINativeLibrary
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   361
  } // UseJVMCICompiler
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   362
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   363
#endif // INCLUDE_JVMCI
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   364
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   365
bool CompilerConfig::check_args_consistency(bool status) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   366
  // Check lower bounds of the code cache
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   367
  // Template Interpreter code is approximately 3X larger in debug builds.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   368
  uint min_code_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   369
  if (ReservedCodeCacheSize < InitialCodeCacheSize) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   370
    jio_fprintf(defaultStream::error_stream(),
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   371
                "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   372
                ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   373
    status = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   374
  } else if (ReservedCodeCacheSize < min_code_cache_size) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   375
    jio_fprintf(defaultStream::error_stream(),
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   376
                "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   377
                min_code_cache_size/K);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   378
    status = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   379
  } else if (ReservedCodeCacheSize > CODE_CACHE_SIZE_LIMIT) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   380
    // Code cache size larger than CODE_CACHE_SIZE_LIMIT is not supported.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   381
    jio_fprintf(defaultStream::error_stream(),
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   382
                "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   383
                CODE_CACHE_SIZE_LIMIT/M);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   384
    status = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   385
  } else if (NonNMethodCodeHeapSize < min_code_cache_size) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   386
    jio_fprintf(defaultStream::error_stream(),
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   387
                "Invalid NonNMethodCodeHeapSize=%dK. Must be at least %uK.\n", NonNMethodCodeHeapSize/K,
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   388
                min_code_cache_size/K);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   389
    status = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   390
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   391
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   392
#ifdef _LP64
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   393
  if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   394
    warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   395
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   396
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   397
52934
8deeb7bba516 8214917: CTW testlibrary shouldn't ignore errors raised by the library itself
iignatyev
parents: 52870
diff changeset
   398
  if (BackgroundCompilation && ReplayCompiles) {
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   399
    if (!FLAG_IS_DEFAULT(BackgroundCompilation)) {
52934
8deeb7bba516 8214917: CTW testlibrary shouldn't ignore errors raised by the library itself
iignatyev
parents: 52870
diff changeset
   400
      warning("BackgroundCompilation disabled due to ReplayCompiles option.");
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   401
    }
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   402
    FLAG_SET_CMDLINE(BackgroundCompilation, false);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   403
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   404
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   405
#ifdef COMPILER2
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   406
  if (PostLoopMultiversioning && !RangeCheckElimination) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   407
    if (!FLAG_IS_DEFAULT(PostLoopMultiversioning)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   408
      warning("PostLoopMultiversioning disabled because RangeCheckElimination is disabled.");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   409
    }
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   410
    FLAG_SET_CMDLINE(PostLoopMultiversioning, false);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   411
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   412
  if (UseCountedLoopSafepoints && LoopStripMiningIter == 0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   413
    if (!FLAG_IS_DEFAULT(UseCountedLoopSafepoints) || !FLAG_IS_DEFAULT(LoopStripMiningIter)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   414
      warning("When counted loop safepoints are enabled, LoopStripMiningIter must be at least 1 (a safepoint every 1 iteration): setting it to 1");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   415
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   416
    LoopStripMiningIter = 1;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   417
  } else if (!UseCountedLoopSafepoints && LoopStripMiningIter > 0) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   418
    if (!FLAG_IS_DEFAULT(UseCountedLoopSafepoints) || !FLAG_IS_DEFAULT(LoopStripMiningIter)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   419
      warning("Disabling counted safepoints implies no loop strip mining: setting LoopStripMiningIter to 0");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   420
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   421
    LoopStripMiningIter = 0;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   422
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   423
#endif // COMPILER2
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   424
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   425
  if (Arguments::is_interpreter_only()) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   426
    if (UseCompiler) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   427
      if (!FLAG_IS_DEFAULT(UseCompiler)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   428
        warning("UseCompiler disabled due to -Xint.");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   429
      }
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   430
      FLAG_SET_CMDLINE(UseCompiler, false);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   431
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   432
    if (ProfileInterpreter) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   433
      if (!FLAG_IS_DEFAULT(ProfileInterpreter)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   434
        warning("ProfileInterpreter disabled due to -Xint.");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   435
      }
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   436
      FLAG_SET_CMDLINE(ProfileInterpreter, false);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   437
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   438
    if (TieredCompilation) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   439
      if (!FLAG_IS_DEFAULT(TieredCompilation)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   440
        warning("TieredCompilation disabled due to -Xint.");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   441
      }
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   442
      FLAG_SET_CMDLINE(TieredCompilation, false);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   443
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   444
#if INCLUDE_JVMCI
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   445
    if (EnableJVMCI) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   446
      if (!FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   447
        warning("JVMCI Compiler disabled due to -Xint.");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   448
      }
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   449
      FLAG_SET_CMDLINE(EnableJVMCI, false);
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   450
      FLAG_SET_CMDLINE(UseJVMCICompiler, false);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   451
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   452
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   453
  } else {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   454
#if INCLUDE_JVMCI
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   455
    status = status && JVMCIGlobals::check_jvmci_flags_are_consistent();
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   456
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   457
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   458
  return status;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   459
}
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   460
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   461
void CompilerConfig::ergo_initialize() {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   462
  if (Arguments::is_interpreter_only()) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   463
    return; // Nothing to do.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   464
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   465
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   466
#ifdef TIERED
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   467
  if (!compilation_mode_selected()) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   468
    select_compilation_mode_ergonomically();
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   469
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   470
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   471
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   472
#if INCLUDE_JVMCI
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   473
  // Check that JVMCI compiler supports selested GC.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   474
  // Should be done after GCConfig::initialize() was called.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   475
  JVMCIGlobals::check_jvmci_supported_gc();
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   476
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 53592
diff changeset
   477
  // Do JVMCI specific settings
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   478
  set_jvmci_specific_flags();
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   479
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   480
58926
ecb801342b8c 8233429: Minimal and zero VM build broken after JDK-8227003
jiefu
parents: 58894
diff changeset
   481
#ifdef TIERED
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   482
  if (TieredCompilation) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   483
    set_tiered_flags();
58926
ecb801342b8c 8233429: Minimal and zero VM build broken after JDK-8227003
jiefu
parents: 58894
diff changeset
   484
  } else
ecb801342b8c 8233429: Minimal and zero VM build broken after JDK-8227003
jiefu
parents: 58894
diff changeset
   485
#endif
ecb801342b8c 8233429: Minimal and zero VM build broken after JDK-8227003
jiefu
parents: 58894
diff changeset
   486
  {
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   487
    // Scale CompileThreshold
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   488
    // CompileThresholdScaling == 0.0 is equivalent to -Xint and leaves CompileThreshold unchanged.
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   489
    if (!FLAG_IS_DEFAULT(CompileThresholdScaling) && CompileThresholdScaling > 0.0) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   490
      FLAG_SET_ERGO(CompileThreshold, scaled_compile_threshold(CompileThreshold));
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   491
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   492
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   493
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   494
  if (UseOnStackReplacement && !UseLoopCounter) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   495
    warning("On-stack-replacement requires loop counters; enabling loop counters");
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   496
    FLAG_SET_DEFAULT(UseLoopCounter, true);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   497
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   498
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   499
#ifdef COMPILER2
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   500
  if (!EliminateLocks) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   501
    EliminateNestedLocks = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   502
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   503
  if (!Inline) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   504
    IncrementalInline = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   505
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   506
#ifndef PRODUCT
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   507
  if (!IncrementalInline) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   508
    AlwaysIncrementalInline = false;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   509
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   510
  if (PrintIdealGraphLevel > 0) {
54983
81becad91321 8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents: 54669
diff changeset
   511
    FLAG_SET_ERGO(PrintIdealGraph, true);
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   512
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   513
#endif
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   514
  if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   515
    // nothing to use the profiling, turn if off
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   516
    FLAG_SET_DEFAULT(TypeProfileLevel, 0);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   517
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   518
  if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   519
    FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   520
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   521
  if (FLAG_IS_DEFAULT(LoopStripMiningIterShortLoop)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   522
    // blind guess
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   523
    LoopStripMiningIterShortLoop = LoopStripMiningIter / 10;
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   524
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   525
#endif // COMPILER2
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 47687
diff changeset
   526
}