< prev index next >

src/hotspot/share/jvmci/jvmci_globals.hpp

Print this page


  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_JVMCI_JVMCI_GLOBALS_HPP
  26 #define SHARE_JVMCI_JVMCI_GLOBALS_HPP
  27 
  28 #include "runtime/flags/jvmFlag.hpp"
  29 
  30 class fileStream;
  31 
  32 //
  33 // Defines all global flags used by the JVMCI compiler. Only flags that need
  34 // to be accessible to the JVMCI C++ code should be defined here.
  35 //
  36 #define JVMCI_FLAGS(develop, \
  37                     develop_pd, \
  38                     product, \
  39                     product_pd, \
  40                     diagnostic, \
  41                     diagnostic_pd, \
  42                     experimental, \
  43                     notproduct, \
  44                     range, \
  45                     constraint) \
  46                                                                             \
  47   experimental(bool, EnableJVMCI, false,                                    \
  48           "Enable JVMCI")                                                   \
  49                                                                             \
  50   experimental(bool, EnableJVMCIProduct, false,                             \
  51           "Allow JVMCI to be used in product mode. This alters a subset of "\
  52           "JVMCI flags to be non-experimental, defaults UseJVMCICompiler "  \
  53           "and EnableJVMCI to true and defaults UseJVMCINativeLibrary "     \
  54           "to true if a JVMCI native library is available.")                \
  55                                                                             \
  56   experimental(bool, UseJVMCICompiler, false,                               \
  57           "Use JVMCI as the default compiler. Defaults to true if "         \
  58           "EnableJVMCIProduct is true.")                                    \
  59                                                                             \
  60   experimental(bool, JVMCIPrintProperties, false,                           \
  61           "Prints properties used by the JVMCI compiler and exits")         \
  62                                                                             \
  63   experimental(bool, BootstrapJVMCI, false,                                 \
  64           "Bootstrap JVMCI before running Java main method. This "          \
  65           "initializes the compile queue with a small set of methods "      \
  66           "and processes the queue until it is empty. Combining this with " \
  67           "-XX:-TieredCompilation makes JVMCI compile more of itself.")     \
  68                                                                             \
  69   experimental(bool, EagerJVMCI, false,                                     \
  70           "Force eager JVMCI initialization")                               \
  71                                                                             \
  72   experimental(bool, PrintBootstrap, true,                                  \
  73           "Print JVMCI bootstrap progress and summary")                     \
  74                                                                             \
  75   experimental(intx, JVMCIThreads, 1,                                       \
  76           "Force number of JVMCI compiler threads to use. Ignored if "      \
  77           "UseJVMCICompiler is false.")                                     \
  78           range(1, max_jint)                                                \
  79                                                                             \
  80   experimental(intx, JVMCIHostThreads, 1,                                   \
  81           "Force number of C1 compiler threads. Ignored if "                \
  82           "UseJVMCICompiler is false.")                                     \
  83           range(1, max_jint)                                                \
  84                                                                             \
  85   NOT_COMPILER2(product(intx, MaxVectorSize, 64,                            \
  86           "Max vector size in bytes, "                                      \
  87           "actual size could be less depending on elements type")           \
  88           range(0, max_jint))                                               \
  89                                                                             \
  90   NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true,                 \
  91           "Defer write barriers of young objects"))                         \
  92                                                                             \
  93   experimental(intx, JVMCITraceLevel, 0,                                    \
  94           "Trace level for JVMCI: "                                         \
  95           "1 means emit a message for each CompilerToVM call,"              \
  96           "levels greater than 1 provide progressively greater detail")     \
  97           range(0, 6)                                                       \
  98                                                                             \
  99   experimental(intx, JVMCICounterSize, 0,                                   \
 100           "Reserved size for benchmark counters")                           \
 101           range(0, 1000000)                                                 \
 102                                                                             \
 103   experimental(bool, JVMCICountersExcludeCompiler, true,                    \
 104           "Exclude JVMCI compiler threads from benchmark counters")         \
 105                                                                             \
 106   develop(bool, JVMCIUseFastLocking, true,                                  \
 107           "Use fast inlined locking code")                                  \
 108                                                                             \
 109   experimental(intx, JVMCINMethodSizeLimit, (80*K)*wordSize,                \
 110           "Maximum size of a compiled method.")                             \
 111           range(0, max_jint)                                                \
 112                                                                             \
 113   experimental(ccstr, JVMCILibPath, NULL,                                   \
 114           "LD path for loading the JVMCI shared library")                   \
 115                                                                             \
 116   experimental(ccstr, JVMCILibDumpJNIConfig, NULL,                          \
 117           "Dumps to the given file a description of the classes, fields "   \
 118           "and methods the JVMCI shared library must provide")              \
 119                                                                             \
 120   experimental(bool, UseJVMCINativeLibrary, false,                          \
 121           "Execute JVMCI Java code from a shared library "                  \
 122           "instead of loading it from class files and executing it "        \
 123           "on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \
 124           "true and a JVMCI native library is available.")                  \
 125                                                                             \
 126   NOT_COMPILER2(diagnostic(bool, UseMultiplyToLenIntrinsic, false,          \
 127           "Enables intrinsification of BigInteger.multiplyToLen()"))        \
 128                                                                             \
 129   NOT_COMPILER2(diagnostic(bool, UseSquareToLenIntrinsic, false,            \
 130           "Enables intrinsification of BigInteger.squareToLen()"))          \
 131                                                                             \
 132   NOT_COMPILER2(diagnostic(bool, UseMulAddIntrinsic, false,                 \
 133           "Enables intrinsification of BigInteger.mulAdd()"))               \
 134                                                                             \
 135   NOT_COMPILER2(diagnostic(bool, UseMontgomeryMultiplyIntrinsic, false,     \
 136           "Enables intrinsification of BigInteger.montgomeryMultiply()"))   \
 137                                                                             \
 138   NOT_COMPILER2(diagnostic(bool, UseMontgomerySquareIntrinsic, false,       \
 139           "Enables intrinsification of BigInteger.montgomerySquare()"))
 140 
 141 // The base name for the shared library containing the JVMCI based compiler
 142 #define JVMCI_SHARED_LIBRARY_NAME "jvmcicompiler"
 143 
 144 class JVMCIGlobals {
 145  private:
 146   static fileStream* _jni_config_file;
 147  public:
 148 
 149   // Returns true if jvmci flags are consistent. If not consistent,
 150   // an error message describing the inconsistency is printed before
 151   // returning false.
 152   static bool check_jvmci_flags_are_consistent();
 153 
 154   // Convert JVMCI experimental flags to product
 155   static bool enable_jvmci_product_mode(JVMFlag::Flags);
 156 
 157   // Check and exit VM with error if selected GC is not supported by JVMCI.
 158   static void check_jvmci_supported_gc();
 159 


  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_JVMCI_JVMCI_GLOBALS_HPP
  26 #define SHARE_JVMCI_JVMCI_GLOBALS_HPP
  27 
  28 #include "runtime/flags/jvmFlag.hpp"
  29 
  30 class fileStream;
  31 
  32 //
  33 // Declare all global flags used by the JVMCI compiler. Only flags that need
  34 // to be accessible to the JVMCI C++ code should be defined here.
  35 //
  36 #include "utilities/macros.hpp"
  37 #if INCLUDE_JVMCI
  38 #include "runtime/flags/jvmFlag.hpp"
  39 PRODUCT_FLAG(bool,     EnableJVMCI, false, JVMFlag::EXPERIMENTAL,
  40                        "Enable JVMCI");
  41 
  42 PRODUCT_FLAG(bool,     EnableJVMCIProduct, false, JVMFlag::EXPERIMENTAL,
  43                        "Allow JVMCI to be used in product mode. This alters a subset of "
  44                        "JVMCI flags to be non-experimental, defaults UseJVMCICompiler "
  45                        "and EnableJVMCI to true and defaults UseJVMCINativeLibrary "
  46                        "to true if a JVMCI native library is available.");
  47 
  48 PRODUCT_FLAG(bool,     UseJVMCICompiler, false, JVMFlag::EXPERIMENTAL,
  49                        "Use JVMCI as the default compiler. Defaults to true if "
  50                        "EnableJVMCIProduct is true.");
  51 
  52 PRODUCT_FLAG(bool,     JVMCIPrintProperties, false, JVMFlag::EXPERIMENTAL,
  53                        "Prints properties used by the JVMCI compiler and exits");
  54 
  55 PRODUCT_FLAG(bool,     BootstrapJVMCI, false, JVMFlag::EXPERIMENTAL,
  56                        "Bootstrap JVMCI before running Java main method. This "
  57                        "initializes the compile queue with a small set of methods "
  58                        "and processes the queue until it is empty. Combining this with "
  59                        "-XX:-TieredCompilation makes JVMCI compile more of itself.");
  60 
  61 PRODUCT_FLAG(bool,     EagerJVMCI, false, JVMFlag::EXPERIMENTAL,
  62                        "Force eager JVMCI initialization");
  63 
  64 PRODUCT_FLAG(bool,     PrintBootstrap, true, JVMFlag::EXPERIMENTAL,
  65                        "Print JVMCI bootstrap progress and summary");
  66 
  67 PRODUCT_FLAG(intx,     JVMCIThreads, 1, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  68                        "Force number of JVMCI compiler threads to use. Ignored if "
  69                        "UseJVMCICompiler is false.");
  70    FLAG_RANGE(         JVMCIThreads, 1, max_jint);
  71 
  72 PRODUCT_FLAG(intx,     JVMCIHostThreads, 1, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  73                        "Force number of C1 compiler threads. Ignored if "
  74                        "UseJVMCICompiler is false.");
  75    FLAG_RANGE(         JVMCIHostThreads, 1, max_jint);
  76 
  77 NOT_COMPILER2(PRODUCT_FLAG(intx,     MaxVectorSize, 64, JVMFlag::RANGE,
  78                        "Max vector size in bytes, "
  79                        "actual size could be less depending on elements type");)
  80 
  81 NOT_COMPILER2(PRODUCT_FLAG(bool,     ReduceInitialCardMarks, true, JVMFlag::DEFAULT,
  82                        "Defer write barriers of young objects");)
  83 
  84 PRODUCT_FLAG(intx,     JVMCITraceLevel, 0, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  85                        "Trace level for JVMCI: "
  86                        "1 means emit a message for each CompilerToVM call,"
  87                        "levels greater than 1 provide progressively greater detail");
  88    FLAG_RANGE(         JVMCITraceLevel, 0, 6);
  89 
  90 PRODUCT_FLAG(intx,     JVMCICounterSize, 0, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
  91                        "Reserved size for benchmark counters");
  92    FLAG_RANGE(         JVMCICounterSize, 0, 1000000);
  93 
  94 PRODUCT_FLAG(bool,     JVMCICountersExcludeCompiler, true, JVMFlag::EXPERIMENTAL,
  95                        "Exclude JVMCI compiler threads from benchmark counters");
  96 
  97 DEVELOP_FLAG(bool,     JVMCIUseFastLocking, true, JVMFlag::DEFAULT,
  98                        "Use fast inlined locking code");
  99 
 100 PRODUCT_FLAG(intx,     JVMCINMethodSizeLimit, (80*K)*wordSize, JVMFlag::EXPERIMENTAL | JVMFlag::RANGE,
 101                        "Maximum size of a compiled method.");
 102    FLAG_RANGE(         JVMCINMethodSizeLimit, 0, max_jint);
 103 
 104 PRODUCT_FLAG(ccstr,    JVMCILibPath, NULL, JVMFlag::EXPERIMENTAL,
 105                        "LD path for loading the JVMCI shared library");
 106 
 107 PRODUCT_FLAG(ccstr,    JVMCILibDumpJNIConfig, NULL, JVMFlag::EXPERIMENTAL,
 108                        "Dumps to the given file a description of the classes, fields "
 109                        "and methods the JVMCI shared library must provide");
 110 
 111 PRODUCT_FLAG(bool,     UseJVMCINativeLibrary, false, JVMFlag::EXPERIMENTAL,
 112                        "Execute JVMCI Java code from a shared library "
 113                        "instead of loading it from class files and executing it "
 114                        "on the HotSpot heap. Defaults to true if EnableJVMCIProduct is "
 115                        "true and a JVMCI native library is available.");
 116 
 117 NOT_COMPILER2(PRODUCT_FLAG(bool,     UseMultiplyToLenIntrinsic, false, JVMFlag::DIAGNOSTIC,
 118                        "Enables intrinsification of BigInteger.multiplyToLen()");)
 119 
 120 NOT_COMPILER2(PRODUCT_FLAG(bool,     UseSquareToLenIntrinsic, false, JVMFlag::DIAGNOSTIC,
 121                        "Enables intrinsification of BigInteger.squareToLen()");)
 122 
 123 NOT_COMPILER2(PRODUCT_FLAG(bool,     UseMulAddIntrinsic, false, JVMFlag::DIAGNOSTIC,
 124                        "Enables intrinsification of BigInteger.mulAdd()");)
 125 
 126 NOT_COMPILER2(PRODUCT_FLAG(bool,     UseMontgomeryMultiplyIntrinsic, false, JVMFlag::DIAGNOSTIC,
 127                        "Enables intrinsification of BigInteger.montgomeryMultiply()");)
 128 #endif // INCLUDE_JVMCI











 129 
 130 // The base name for the shared library containing the JVMCI based compiler
 131 #define JVMCI_SHARED_LIBRARY_NAME "jvmcicompiler"
 132 
 133 class JVMCIGlobals {
 134  private:
 135   static fileStream* _jni_config_file;
 136  public:
 137 
 138   // Returns true if jvmci flags are consistent. If not consistent,
 139   // an error message describing the inconsistency is printed before
 140   // returning false.
 141   static bool check_jvmci_flags_are_consistent();
 142 
 143   // Convert JVMCI experimental flags to product
 144   static bool enable_jvmci_product_mode(JVMFlag::Flags);
 145 
 146   // Check and exit VM with error if selected GC is not supported by JVMCI.
 147   static void check_jvmci_supported_gc();
 148 
< prev index next >