annotate src/share/vm/jvmci/jvmci_globals.cpp @ 24144:b0077339d77e

use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
author Doug Simon <doug.simon@oracle.com>
date Thu, 15 Jun 2017 12:04:08 +0200
parents 15ab3e226b0d
children 2f2299c68571
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7125
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 *
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 */
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 #include "precompiled.hpp"
22495
740feb10d15a rename jvmciGlobals to be consistent with c1_globals and c2_globals
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 21559
diff changeset
26 #include "jvmci/jvmci_globals.hpp"
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
27 #include "utilities/defaultStream.hpp"
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
28 #include "runtime/globals_extension.hpp"
24143
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
29 #include "runtime/arguments.hpp"
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
30 #ifdef TARGET_OS_FAMILY_linux
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
31 # include "os_linux.inline.hpp"
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
32 #endif
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
33 #ifdef TARGET_OS_FAMILY_solaris
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
34 # include "os_solaris.inline.hpp"
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
35 #endif
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
36 #ifdef TARGET_OS_FAMILY_windows
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
37 # include "os_windows.inline.hpp"
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
38 #endif
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
39 #ifdef TARGET_OS_FAMILY_aix
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
40 # include "os_aix.inline.hpp"
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
41 #endif
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
42 #ifdef TARGET_OS_FAMILY_bsd
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
43 # include "os_bsd.inline.hpp"
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
44 #endif
7125
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 7125
diff changeset
46 JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
47
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
48 bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
49 #ifndef PRODUCT
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
50 #define APPLY_JVMCI_FLAGS(params3, params4) \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
51 JVMCI_FLAGS(params4, params3, params4, params3, params4)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
52 #define JVMCI_DECLARE_CHECK4(type, name, value, doc) bool name##checked = false;
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
53 #define JVMCI_DECLARE_CHECK3(type, name, doc) bool name##checked = false;
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
54 #define JVMCI_FLAG_CHECKED(name) name##checked = true;
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
55 APPLY_JVMCI_FLAGS(JVMCI_DECLARE_CHECK3, JVMCI_DECLARE_CHECK4)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
56 #else
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
57 #define JVMCI_FLAG_CHECKED(name)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
58 #endif
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
59
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
60 // Checks that a given flag is not set if a given guard flag is false.
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
61 #define CHECK_NOT_SET(FLAG, GUARD) \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
62 JVMCI_FLAG_CHECKED(FLAG) \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
63 if (!GUARD && !FLAG_IS_DEFAULT(FLAG)) { \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
64 jio_fprintf(defaultStream::error_stream(), \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
65 "Improperly specified VM option '%s': '%s' must be enabled\n", #FLAG, #GUARD); \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
66 return false; \
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
67 }
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
68
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
69 JVMCI_FLAG_CHECKED(UseJVMCICompiler)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
70 JVMCI_FLAG_CHECKED(EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
71
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
72 CHECK_NOT_SET(BootstrapJVMCI, UseJVMCICompiler)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
73 CHECK_NOT_SET(PrintBootstrap, UseJVMCICompiler)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
74 CHECK_NOT_SET(JVMCIThreads, UseJVMCICompiler)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
75 CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
76
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
77 if (UseJVMCICompiler) {
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
78 if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) {
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
79 jio_fprintf(defaultStream::error_stream(),
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
80 "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n");
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
81 return false;
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
82 }
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
83 FLAG_SET_DEFAULT(EnableJVMCI, true);
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
84 }
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
85 CHECK_NOT_SET(UseJVMCIClassLoader, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
86 CHECK_NOT_SET(CodeInstallSafepointChecks, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
87 CHECK_NOT_SET(JVMCITraceLevel, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
88 CHECK_NOT_SET(JVMCICounterSize, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
89 CHECK_NOT_SET(JVMCICountersExcludeCompiler, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
90 CHECK_NOT_SET(JVMCIUseFastLocking, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
91 CHECK_NOT_SET(JVMCINMethodSizeLimit, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
92 CHECK_NOT_SET(MethodProfileWidth, EnableJVMCI)
23783
1523f2f7832f renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents: 23779
diff changeset
93 CHECK_NOT_SET(JVMCIPrintProperties, EnableJVMCI)
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
94 CHECK_NOT_SET(TraceUncollectedSpeculations, EnableJVMCI)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
95
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
96 #ifndef PRODUCT
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
97 #define JVMCI_CHECK4(type, name, value, doc) assert(name##checked, #name " flag not checked");
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
98 #define JVMCI_CHECK3(type, name, doc) assert(name##checked, #name " flag not checked");
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
99 // Ensures that all JVMCI flags are checked by this method.
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
100 APPLY_JVMCI_FLAGS(JVMCI_CHECK3, JVMCI_CHECK4)
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
101 #undef APPLY_JVMCI_FLAGS
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
102 #undef JVMCI_DECLARE_CHECK3
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
103 #undef JVMCI_DECLARE_CHECK4
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
104 #undef JVMCI_CHECK3
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
105 #undef JVMCI_CHECK4
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
106 #undef JVMCI_FLAG_CHECKED
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
107 #endif
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
108 #undef CHECK_NOT_SET
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
109 if (UseJVMCICompiler) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
110 if(JVMCIThreads < 1) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
111 // Check the minimum number of JVMCI compiler threads
23761
1fece5f8307c jvmci_globals: add missing argument
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 23760
diff changeset
112 jio_fprintf(defaultStream::error_stream(), "JVMCIThreads of " INTX_FORMAT " is invalid; must be at least 1\n", JVMCIThreads);
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
113 return false;
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
114 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
115 }
23775
d66c74920c43 move MethodProfileWidth to jvmci_globals.hpp (JDK-8163864)
Doug Simon <doug.simon@oracle.com>
parents: 23763
diff changeset
116 return true;
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
117 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
118
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
119 void JVMCIGlobals::set_jvmci_specific_flags() {
24143
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
120 if (FLAG_IS_DEFAULT(UseJVMCICompiler) && !UseJVMCICompiler) {
24144
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24143
diff changeset
121 char filename[JVM_MAXPATHLEN];
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24143
diff changeset
122 const char* fileSep = os::file_separator();
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24143
diff changeset
123 jio_snprintf(filename, sizeof(filename), "%s%slib%suse-jvmci-compiler-by-default", Arguments::get_java_home(), fileSep, fileSep);
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24143
diff changeset
124 struct stat statbuf;
b0077339d77e use existence of <java.home>/lib/use-jvmci-compiler-by-default to override default value of UseJVMCICompiler
Doug Simon <doug.simon@oracle.com>
parents: 24143
diff changeset
125 if (os::stat(filename, &statbuf) == 0) {
24143
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
126 FLAG_SET_ERGO(bool, UseJVMCICompiler, true);
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
127 }
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
128 }
15ab3e226b0d set +UseJVMCICompiler ergonomically if jvmci.class.path.append is defined or there is at least one jar file in jre/lib/jvmci apart from the JVMCI API jars
Doug Simon <doug.simon@oracle.com>
parents: 23783
diff changeset
129
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
130 if (UseJVMCICompiler) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
131 if (FLAG_IS_DEFAULT(TypeProfileWidth)) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
132 FLAG_SET_DEFAULT(TypeProfileWidth, 8);
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
133 }
23763
bf2d00fc162b jvmci_globals: comment flag
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 23761
diff changeset
134 // Adjust the on stack replacement percentage to avoid early
bf2d00fc162b jvmci_globals: comment flag
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 23761
diff changeset
135 // OSR compilations while JVMCI itself is warming up
23760
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
136 if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
137 FLAG_SET_DEFAULT(OnStackReplacePercentage, 933);
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
138 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
139 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
140 FLAG_SET_DEFAULT(ReservedCodeCacheSize, 64*M);
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
141 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
142 if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
143 FLAG_SET_DEFAULT(InitialCodeCacheSize, 16*M);
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
144 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
145 if (FLAG_IS_DEFAULT(MetaspaceSize)) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
146 FLAG_SET_DEFAULT(MetaspaceSize, 12*M);
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
147 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
148 if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
149 FLAG_SET_DEFAULT(NewSizeThreadIncrease, 4*K);
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
150 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
151 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
152 if (!ScavengeRootsInCode) {
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
153 warning("forcing ScavengeRootsInCode non-zero because JVMCI is enabled");
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
154 ScavengeRootsInCode = 1;
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
155 }
655fd63024d0 move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents: 22495
diff changeset
156 }