Mercurial > hg > graal-jvmci-8
annotate src/share/vm/jvmci/jvmci_globals.cpp @ 23760:655fd63024d0
move jvmci flag handling to JVMCIGlobals
author | David Leopoldseder <david.d.leopoldseder@oracle.com> |
---|---|
date | Fri, 23 Sep 2016 16:33:12 +0200 |
parents | 740feb10d15a |
children | 1fece5f8307c |
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" |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
30 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
|
31 |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
32 bool JVMCIGlobals::check_jvmci_flags_are_consistent() { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
33 bool status = true; |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
34 if (!EnableJVMCI) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
35 #define JVMCI_CHECK3(type, name, doc) JVMCI_CHECK_FLAG(name) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
36 #define JVMCI_CHECK4(type, name, value, doc) JVMCI_CHECK_FLAG(name) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
37 #define JVMCI_CHECK_FLAG(FLAG) \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
38 if (strcmp(#FLAG, "EnableJVMCI") && !FLAG_IS_DEFAULT(FLAG)) { \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
39 jio_fprintf(defaultStream::error_stream(), "EnableJVMCI must be enabled to use VM option '%s'\n", #FLAG); \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
40 status = false; \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
41 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
42 JVMCI_FLAGS(JVMCI_CHECK4, JVMCI_CHECK3, JVMCI_CHECK4, JVMCI_CHECK3, JVMCI_CHECK4) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
43 #undef JVMCI_CHECK3 |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
44 #undef JVMCI_CHECK4 |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
45 #undef JVMCI_CHECK_FLAG |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
46 } else { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
47 #ifndef TIERED |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
48 // JVMCI is only usable as a jit compiler if the VM supports tiered compilation. |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
49 #define JVMCI_CHECK_FLAG(FLAG) \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
50 if (!FLAG_IS_DEFAULT(FLAG)) { \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
51 jio_fprintf(defaultStream::error_stream(), "VM option '%s' cannot be set in non-tiered VM\n", #FLAG); \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
52 status = false; \ |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
53 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
54 JVMCI_CHECK_FLAG(UseJVMCICompiler) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
55 JVMCI_CHECK_FLAG(BootstrapJVMCI) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
56 JVMCI_CHECK_FLAG(PrintBootstrap) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
57 JVMCI_CHECK_FLAG(JVMCIThreads) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
58 JVMCI_CHECK_FLAG(JVMCIHostThreads) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
59 JVMCI_CHECK_FLAG(JVMCICountersExcludeCompiler) |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
60 #undef JVMCI_CHECK_FLAG |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
61 #endif |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
62 if (BootstrapJVMCI && !UseJVMCICompiler) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
63 warning("BootstrapJVMCI has no effect if UseJVMCICompiler is disabled"); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
64 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
65 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
66 if (UseJVMCICompiler) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
67 if(JVMCIThreads < 1) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
68 // Check the minimum number of JVMCI compiler threads |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
69 jio_fprintf(defaultStream::error_stream(), "JVMCIThreads of " INTX_FORMAT " is invalid; must be at least 1\n"); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
70 status = false; |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
71 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
72 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
73 return status; |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
74 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
75 |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
76 void JVMCIGlobals::set_jvmci_specific_flags() { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
77 if (UseJVMCICompiler) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
78 if (FLAG_IS_DEFAULT(TypeProfileWidth)) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
79 FLAG_SET_DEFAULT(TypeProfileWidth, 8); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
80 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
81 if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
82 FLAG_SET_DEFAULT(OnStackReplacePercentage, 933); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
83 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
84 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
85 FLAG_SET_DEFAULT(ReservedCodeCacheSize, 64*M); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
86 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
87 if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
88 FLAG_SET_DEFAULT(InitialCodeCacheSize, 16*M); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
89 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
90 if (FLAG_IS_DEFAULT(MetaspaceSize)) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
91 FLAG_SET_DEFAULT(MetaspaceSize, 12*M); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
92 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
93 if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
94 FLAG_SET_DEFAULT(NewSizeThreadIncrease, 4*K); |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
95 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
96 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
97 if (!ScavengeRootsInCode) { |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
98 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
|
99 ScavengeRootsInCode = 1; |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
100 } |
655fd63024d0
move jvmci flag handling to JVMCIGlobals
David Leopoldseder <david.d.leopoldseder@oracle.com>
parents:
22495
diff
changeset
|
101 } |