1 /*
   2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_JVMCI_JVMCIGLOBALS_HPP
  26 #define SHARE_VM_JVMCI_JVMCIGLOBALS_HPP
  27 
  28 #include "runtime/globals.hpp"
  29 
  30 //
  31 // Defines all global flags used by the JVMCI compiler. Only flags that need
  32 // to be accessible to the JVMCI C++ code should be defined here. All other
  33 // JVMCI flags should be defined in JVMCIOptions.java.
  34 //
  35 #define JVMCI_FLAGS(develop, \
  36                     develop_pd, \
  37                     product, \
  38                     product_pd, \
  39                     diagnostic, \
  40                     diagnostic_pd, \
  41                     experimental, \
  42                     notproduct, \
  43                     range, \
  44                     constraint, \
  45                     writeable) \
  46                                                                             \
  47   experimental(bool, EnableJVMCI, false,                                    \
  48           "Enable JVMCI")                                                   \
  49                                                                             \
  50   experimental(bool, UseJVMCICompiler, false,                               \
  51           "Use JVMCI as the default compiler")                              \
  52                                                                             \
  53   experimental(bool, BootstrapJVMCI, false,                                 \
  54           "Bootstrap JVMCI before running Java main method")                \
  55                                                                             \
  56   experimental(bool, PrintBootstrap, true,                                  \
  57           "Print JVMCI bootstrap progress and summary")                     \
  58                                                                             \
  59   experimental(intx, JVMCIThreads, 1,                                       \
  60           "Force number of JVMCI compiler threads to use")                  \
  61           range(1, max_jint)                                                \
  62                                                                             \
  63   experimental(intx, JVMCIHostThreads, 1,                                   \
  64           "Force number of compiler threads for JVMCI host compiler")       \
  65           range(1, max_jint)                                                \
  66                                                                             \
  67   experimental(bool, CodeInstallSafepointChecks, true,                      \
  68           "Perform explicit safepoint checks while installing code")        \
  69                                                                             \
  70   NOT_COMPILER2(product(intx, MaxVectorSize, 64,                            \
  71           "Max vector size in bytes, "                                      \
  72           "actual size could be less depending on elements type"))          \
  73                                                                             \
  74   NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true,                 \
  75           "Defer write barriers of young objects"))                         \
  76                                                                             \
  77   experimental(intx, JVMCITraceLevel, 0,                                    \
  78           "Trace level for JVMCI: "                                         \
  79           "1 means emit a message for each CompilerToVM call,"              \
  80           "levels greater than 1 provide progressively greater detail")     \
  81                                                                             \
  82   experimental(intx, JVMCICounterSize, 0,                                   \
  83           "Reserved size for benchmark counters")                           \
  84           range(0, max_jint)                                                \
  85                                                                             \
  86   experimental(bool, JVMCICountersExcludeCompiler, true,                    \
  87           "Exclude JVMCI compiler threads from benchmark counters")         \
  88                                                                             \
  89   develop(bool, JVMCIUseFastLocking, true,                                  \
  90           "Use fast inlined locking code")                                  \
  91                                                                             \
  92   experimental(intx, JVMCINMethodSizeLimit, (80*K)*wordSize,                \
  93           "Maximum size of a compiled method.")                             \
  94                                                                             \
  95   develop(bool, TraceUncollectedSpeculations, false,                        \
  96           "Print message when a failed speculation was not collected")
  97 
  98 
  99 // Read default values for JVMCI globals
 100 
 101 JVMCI_FLAGS(DECLARE_DEVELOPER_FLAG, \
 102             DECLARE_PD_DEVELOPER_FLAG, \
 103             DECLARE_PRODUCT_FLAG, \
 104             DECLARE_PD_PRODUCT_FLAG, \
 105             DECLARE_DIAGNOSTIC_FLAG, \
 106             DECLARE_PD_DIAGNOSTIC_FLAG, \
 107             DECLARE_EXPERIMENTAL_FLAG, \
 108             DECLARE_NOTPRODUCT_FLAG, \
 109             IGNORE_RANGE, \
 110             IGNORE_CONSTRAINT, \
 111             IGNORE_WRITEABLE)
 112 
 113 class JVMCIGlobals {
 114  public:
 115   // Return true if jvmci flags are consistent.
 116   static bool check_jvmci_flags_are_consistent();
 117   // Print jvmci arguments inconsistency error message.
 118   static void print_jvmci_args_inconsistency_error_message();
 119 };
 120 #endif // SHARE_VM_JVMCI_JVMCIGLOBALS_HPP