src/hotspot/share/jvmci/jvmci_globals.cpp
author kvn
Mon, 06 May 2019 20:05:19 -0700
changeset 54732 2d012a75d35c
parent 54669 ad45b3802d4e
child 54982 b18c8301b8c2
permissions -rw-r--r--
8223332: Update JVMCI Reviewed-by: never, dnsimon
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     1
/*
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
     2
 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     4
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     8
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    13
 * accompanied this code).
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    14
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    18
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    21
 * questions.
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    22
 *
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    23
 */
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    24
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    25
#include "precompiled.hpp"
47765
b7c7428eaab9 8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents: 47216
diff changeset
    26
#include "jvm.h"
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    27
#include "jvmci/jvmci_globals.hpp"
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
    28
#include "gc/shared/gcConfig.hpp"
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    29
#include "utilities/defaultStream.hpp"
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
    30
#include "utilities/ostream.hpp"
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    31
#include "runtime/globals_extension.hpp"
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    32
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
    33
fileStream* JVMCIGlobals::_jni_config_file = NULL;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
    34
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    35
JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    36
            MATERIALIZE_PD_DEVELOPER_FLAG, \
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    37
            MATERIALIZE_PRODUCT_FLAG, \
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    38
            MATERIALIZE_PD_PRODUCT_FLAG, \
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    39
            MATERIALIZE_DIAGNOSTIC_FLAG, \
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
    40
            MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    41
            MATERIALIZE_EXPERIMENTAL_FLAG, \
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    42
            MATERIALIZE_NOTPRODUCT_FLAG,
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
diff changeset
    43
            IGNORE_RANGE, \
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 36313
diff changeset
    44
            IGNORE_CONSTRAINT, \
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 36313
diff changeset
    45
            IGNORE_WRITEABLE)
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    46
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    47
// Return true if jvmci flags are consistent.
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    48
bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    49
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    50
#ifndef PRODUCT
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    51
#define APPLY_JVMCI_FLAGS(params3, params4) \
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    52
  JVMCI_FLAGS(params4, params3, params4, params3, params4, params3, params4, params4, IGNORE_RANGE, IGNORE_CONSTRAINT, IGNORE_WRITEABLE)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    53
#define JVMCI_DECLARE_CHECK4(type, name, value, doc) bool name##checked = false;
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    54
#define JVMCI_DECLARE_CHECK3(type, name, doc)        bool name##checked = false;
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    55
#define JVMCI_FLAG_CHECKED(name)                          name##checked = true;
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    56
  APPLY_JVMCI_FLAGS(JVMCI_DECLARE_CHECK3, JVMCI_DECLARE_CHECK4)
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    57
#else
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    58
#define JVMCI_FLAG_CHECKED(name)
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    59
#endif
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    60
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    61
  // Checks that a given flag is not set if a given guard flag is false.
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    62
#define CHECK_NOT_SET(FLAG, GUARD)                     \
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    63
  JVMCI_FLAG_CHECKED(FLAG)                             \
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    64
  if (!GUARD && !FLAG_IS_DEFAULT(FLAG)) {              \
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    65
    jio_fprintf(defaultStream::error_stream(),         \
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    66
        "Improperly specified VM option '%s': '%s' must be enabled\n", #FLAG, #GUARD); \
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    67
    return false;                                      \
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    68
  }
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    69
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    70
  JVMCI_FLAG_CHECKED(UseJVMCICompiler)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    71
  JVMCI_FLAG_CHECKED(EnableJVMCI)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    72
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    73
  CHECK_NOT_SET(BootstrapJVMCI,   UseJVMCICompiler)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    74
  CHECK_NOT_SET(PrintBootstrap,   UseJVMCICompiler)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    75
  CHECK_NOT_SET(JVMCIThreads,     UseJVMCICompiler)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    76
  CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler)
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    77
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    78
  if (UseJVMCICompiler) {
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    79
    if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) {
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    80
      jio_fprintf(defaultStream::error_stream(),
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    81
          "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n");
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    82
      return false;
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    83
    }
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
    84
    FLAG_SET_DEFAULT(EnableJVMCI, true);
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
    85
    if (BootstrapJVMCI && UseJVMCINativeLibrary) {
54732
2d012a75d35c 8223332: Update JVMCI
kvn
parents: 54669
diff changeset
    86
      jio_fprintf(defaultStream::error_stream(), "-XX:+BootstrapJVMCI is not compatible with -XX:+UseJVMCINativeLibrary\n");
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
    87
      return false;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
    88
    }
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    89
  }
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
    90
49191
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    91
  if (!EnableJVMCI) {
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    92
    // Switch off eager JVMCI initialization if JVMCI is disabled.
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    93
    // Don't throw error if EagerJVMCI is set to allow testing.
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    94
    if (EagerJVMCI) {
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    95
      FLAG_SET_DEFAULT(EagerJVMCI, false);
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    96
    }
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    97
  }
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    98
  JVMCI_FLAG_CHECKED(EagerJVMCI)
13378aa8527e 8195632: [Graal] Introduce EagerJVMCI flag to force eager JVMCI initialization
kvn
parents: 47765
diff changeset
    99
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   100
  CHECK_NOT_SET(JVMCITraceLevel,              EnableJVMCI)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   101
  CHECK_NOT_SET(JVMCICounterSize,             EnableJVMCI)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   102
  CHECK_NOT_SET(JVMCICountersExcludeCompiler, EnableJVMCI)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   103
  CHECK_NOT_SET(JVMCIUseFastLocking,          EnableJVMCI)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   104
  CHECK_NOT_SET(JVMCINMethodSizeLimit,        EnableJVMCI)
40869
2f53be0a45ee 8163864: [JVMCI] move MethodProfileWidth to jvmci_globals.hpp
dnsimon
parents: 40081
diff changeset
   105
  CHECK_NOT_SET(MethodProfileWidth,           EnableJVMCI)
41687
6b97c4598667 8167194: [JVMCI] no reliable mechanism for querying JVMCI system properties
dnsimon
parents: 40869
diff changeset
   106
  CHECK_NOT_SET(JVMCIPrintProperties,         EnableJVMCI)
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   107
  CHECK_NOT_SET(UseJVMCINativeLibrary,        EnableJVMCI)
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   108
  CHECK_NOT_SET(JVMCILibPath,                 EnableJVMCI)
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   109
  CHECK_NOT_SET(JVMCILibDumpJNIConfig,        EnableJVMCI)
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
   110
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
   111
#ifndef PRODUCT
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   112
#define JVMCI_CHECK4(type, name, value, doc) assert(name##checked, #name " flag not checked");
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   113
#define JVMCI_CHECK3(type, name, doc)        assert(name##checked, #name " flag not checked");
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   114
  // Ensures that all JVMCI flags are checked by this method.
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   115
  APPLY_JVMCI_FLAGS(JVMCI_CHECK3, JVMCI_CHECK4)
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   116
#undef APPLY_JVMCI_FLAGS
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   117
#undef JVMCI_DECLARE_CHECK3
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   118
#undef JVMCI_DECLARE_CHECK4
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   119
#undef JVMCI_CHECK3
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   120
#undef JVMCI_CHECK4
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   121
#undef JVMCI_FLAG_CHECKED
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   122
#endif // PRODUCT
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   123
#undef CHECK_NOT_SET
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   124
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   125
  if (JVMCILibDumpJNIConfig != NULL) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   126
    _jni_config_file = new(ResourceObj::C_HEAP, mtJVMCI) fileStream(JVMCILibDumpJNIConfig);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   127
    if (_jni_config_file == NULL || !_jni_config_file->is_open()) {
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   128
      jio_fprintf(defaultStream::error_stream(),
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   129
          "Could not open file for dumping JVMCI shared library JNI config: %s\n", JVMCILibDumpJNIConfig);
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   130
      return false;
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   131
    }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   132
  }
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   133
40081
50be9fe0e9c2 8161265: [JVMCI] EnableJVMCI should only be required when its not implied by other flags
dnsimon
parents: 40046
diff changeset
   134
  return true;
36313
e7eff81d7f1d 8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents: 33160
diff changeset
   135
}
54669
ad45b3802d4e 8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents: 50589
diff changeset
   136
50589
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   137
void JVMCIGlobals::check_jvmci_supported_gc() {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   138
  if (EnableJVMCI) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   139
    // Check if selected GC is supported by JVMCI and Java compiler
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   140
    if (!(UseSerialGC || UseParallelGC || UseParallelOldGC || UseG1GC)) {
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   141
      vm_exit_during_initialization("JVMCI Compiler does not support selected GC", GCConfig::hs_err_name());
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   142
      FLAG_SET_DEFAULT(EnableJVMCI, false);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   143
      FLAG_SET_DEFAULT(UseJVMCICompiler, false);
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   144
    }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   145
  }
e5d741569070 8184349: There should be some verification that EnableJVMCI is disabled if a GC not supporting JVMCI is selected
kvn
parents: 49191
diff changeset
   146
}