Path: blob/master/src/hotspot/share/jvmci/jvmci_globals.hpp
40949 views
/*1* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_JVMCI_JVMCI_GLOBALS_HPP25#define SHARE_JVMCI_JVMCI_GLOBALS_HPP2627#include "runtime/globals_shared.hpp"28#include "utilities/vmEnums.hpp"2930class fileStream;3132//33// Declare all global flags used by the JVMCI compiler. Only flags that need34// to be accessible to the JVMCI C++ code should be defined here.35//36#define JVMCI_FLAGS(develop, \37develop_pd, \38product, \39product_pd, \40notproduct, \41range, \42constraint) \43\44product(bool, EnableJVMCI, false, EXPERIMENTAL, \45"Enable JVMCI") \46\47product(bool, EnableJVMCIProduct, false, EXPERIMENTAL, \48"Allow JVMCI to be used in product mode. This alters a subset of "\49"JVMCI flags to be non-experimental, defaults UseJVMCICompiler " \50"and EnableJVMCI to true and defaults UseJVMCINativeLibrary " \51"to true if a JVMCI native library is available.") \52\53product(bool, UseJVMCICompiler, false, EXPERIMENTAL, \54"Use JVMCI as the default compiler. Defaults to true if " \55"EnableJVMCIProduct is true.") \56\57product(bool, JVMCIPrintProperties, false, EXPERIMENTAL, \58"Prints properties used by the JVMCI compiler and exits") \59\60product(bool, BootstrapJVMCI, false, EXPERIMENTAL, \61"Bootstrap JVMCI before running Java main method. This " \62"initializes the compile queue with a small set of methods " \63"and processes the queue until it is empty. Combining this with " \64"-XX:-TieredCompilation makes JVMCI compile more of itself.") \65\66product(bool, EagerJVMCI, false, EXPERIMENTAL, \67"Force eager JVMCI initialization") \68\69product(bool, PrintBootstrap, true, EXPERIMENTAL, \70"Print JVMCI bootstrap progress and summary") \71\72product(intx, JVMCIThreads, 1, EXPERIMENTAL, \73"Force number of JVMCI compiler threads to use. Ignored if " \74"UseJVMCICompiler is false.") \75range(1, max_jint) \76\77product(intx, JVMCIHostThreads, 1, EXPERIMENTAL, \78"Force number of C1 compiler threads. Ignored if " \79"UseJVMCICompiler is false.") \80range(1, max_jint) \81\82NOT_COMPILER2(product(intx, MaxVectorSize, 64, \83"Max vector size in bytes, " \84"actual size could be less depending on elements type") \85range(0, max_jint)) \86\87NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true, \88"Defer write barriers of young objects")) \89\90product(intx, JVMCIEventLogLevel, 1, EXPERIMENTAL, \91"Event log level for JVMCI") \92range(0, 4) \93\94product(intx, JVMCITraceLevel, 0, EXPERIMENTAL, \95"Trace level for JVMCI") \96range(0, 4) \97\98product(intx, JVMCICounterSize, 0, EXPERIMENTAL, \99"Reserved size for benchmark counters") \100range(0, 1000000) \101\102product(bool, JVMCICountersExcludeCompiler, true, EXPERIMENTAL, \103"Exclude JVMCI compiler threads from benchmark counters") \104\105develop(bool, JVMCIUseFastLocking, true, \106"Use fast inlined locking code") \107\108product(intx, JVMCINMethodSizeLimit, (80*K)*wordSize, EXPERIMENTAL, \109"Maximum size of a compiled method.") \110range(0, max_jint) \111\112product(ccstr, JVMCILibPath, NULL, EXPERIMENTAL, \113"LD path for loading the JVMCI shared library") \114\115product(ccstr, JVMCILibDumpJNIConfig, NULL, EXPERIMENTAL, \116"Dumps to the given file a description of the classes, fields " \117"and methods the JVMCI shared library must provide") \118\119product(bool, UseJVMCINativeLibrary, false, EXPERIMENTAL, \120"Execute JVMCI Java code from a shared library " \121"instead of loading it from class files and executing it " \122"on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \123"true and a JVMCI native library is available.") \124\125NOT_COMPILER2(product(bool, UseMultiplyToLenIntrinsic, false, DIAGNOSTIC, \126"Enables intrinsification of BigInteger.multiplyToLen()")) \127\128NOT_COMPILER2(product(bool, UseSquareToLenIntrinsic, false, DIAGNOSTIC, \129"Enables intrinsification of BigInteger.squareToLen()")) \130\131NOT_COMPILER2(product(bool, UseMulAddIntrinsic, false, DIAGNOSTIC, \132"Enables intrinsification of BigInteger.mulAdd()")) \133\134NOT_COMPILER2(product(bool, UseMontgomeryMultiplyIntrinsic, false, DIAGNOSTIC, \135"Enables intrinsification of BigInteger.montgomeryMultiply()")) \136\137NOT_COMPILER2(product(bool, UseMontgomerySquareIntrinsic, false, DIAGNOSTIC, \138"Enables intrinsification of BigInteger.montgomerySquare()"))139140// end of JVMCI_FLAGS141142DECLARE_FLAGS(JVMCI_FLAGS)143144// The base name for the shared library containing the JVMCI based compiler145#define JVMCI_SHARED_LIBRARY_NAME "jvmcicompiler"146147class JVMCIGlobals {148private:149static fileStream* _jni_config_file;150public:151152// Returns true if jvmci flags are consistent. If not consistent,153// an error message describing the inconsistency is printed before154// returning false.155static bool check_jvmci_flags_are_consistent();156157// Convert JVMCI experimental flags to product158static bool enable_jvmci_product_mode(JVMFlagOrigin);159160// Returns true iff the GC fully supports JVMCI.161static bool gc_supports_jvmci();162163// Check and turn off EnableJVMCI if selected GC does not support JVMCI.164static void check_jvmci_supported_gc();165166static fileStream* get_jni_config_file() { return _jni_config_file; }167};168#endif // SHARE_JVMCI_JVMCI_GLOBALS_HPP169170171