Tue, 11 Nov 2014 11:05:41 +0100
8056071: compiler/whitebox/IsMethodCompilableTest.java fails with 'method() is not compilable after 3 iterations'
Summary: Always use MDO if valid and always compile trivial methods with C1 if available.
Reviewed-by: kvn, iveresov
1 /*
2 * Copyright (c) 2003, 2013, 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 */
25 #ifndef SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
26 #define SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
28 #include "runtime/globals.hpp"
29 #include "utilities/macros.hpp"
30 #include "utilities/top.hpp"
32 // Construct enum of Flag_<cmdline-arg> constants.
34 // Parens left off in the following for the enum decl below.
35 #define FLAG_MEMBER(flag) Flag_##flag
37 #define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
38 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
39 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
40 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
41 #define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
42 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
43 #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
44 #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
45 #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
47 #ifdef _LP64
48 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
49 #else
50 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) /* flag is constant */
51 #endif // _LP64
53 #define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
54 #define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
55 #define C1_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
56 #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
57 #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
58 #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
60 #define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
61 #define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
62 #define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
63 #define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
64 #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
65 #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
66 #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
68 #define ARCH_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
69 #define ARCH_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
70 #define ARCH_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
71 #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
72 #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
74 typedef enum {
75 RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER, RUNTIME_LP64_PRODUCT_FLAG_MEMBER)
76 RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER)
77 #if INCLUDE_ALL_GCS
78 G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER)
79 #endif // INCLUDE_ALL_GCS
80 #ifdef COMPILER1
81 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, C1_PD_DEVELOP_FLAG_MEMBER, C1_PRODUCT_FLAG_MEMBER, C1_PD_PRODUCT_FLAG_MEMBER, C1_DIAGNOSTIC_FLAG_MEMBER, C1_NOTPRODUCT_FLAG_MEMBER)
82 #endif
83 #ifdef COMPILER2
84 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER, C2_PD_DEVELOP_FLAG_MEMBER, C2_PRODUCT_FLAG_MEMBER, C2_PD_PRODUCT_FLAG_MEMBER, C2_DIAGNOSTIC_FLAG_MEMBER, C2_EXPERIMENTAL_FLAG_MEMBER, C2_NOTPRODUCT_FLAG_MEMBER)
85 #endif
86 ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER, ARCH_PRODUCT_FLAG_MEMBER, ARCH_DIAGNOSTIC_FLAG_MEMBER, ARCH_EXPERIMENTAL_FLAG_MEMBER, ARCH_NOTPRODUCT_FLAG_MEMBER)
87 COMMANDLINEFLAG_EXT
88 NUM_CommandLineFlag
89 } CommandLineFlag;
91 // Construct enum of Flag_<cmdline-arg>_<type> constants.
93 #define FLAG_MEMBER_WITH_TYPE(flag,type) Flag_##flag##_##type
95 #define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
96 #define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
97 #define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
98 #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
99 #define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
100 #define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
101 #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
102 #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
103 #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
105 #define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
106 #define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
107 #define C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
108 #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
109 #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
110 #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
112 #ifdef _LP64
113 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
114 #else
115 #define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */
116 #endif // _LP64
118 #define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
119 #define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
120 #define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
121 #define C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
122 #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
123 #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
124 #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
126 #define ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
127 #define ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
128 #define ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
129 #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
130 #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
132 typedef enum {
133 RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
134 RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
135 RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
136 RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
137 RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
138 RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
139 RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
140 RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
141 RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
142 RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE)
143 RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
144 RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
145 RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
146 RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
147 RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
148 RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
149 #if INCLUDE_ALL_GCS
150 G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
151 RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
152 RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
153 RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
154 RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
155 RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
156 RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
157 RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
158 RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE)
159 #endif // INCLUDE_ALL_GCS
160 #ifdef COMPILER1
161 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE,
162 C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
163 C1_PRODUCT_FLAG_MEMBER_WITH_TYPE,
164 C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
165 C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
166 C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
167 #endif
168 #ifdef COMPILER2
169 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER_WITH_TYPE,
170 C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
171 C2_PRODUCT_FLAG_MEMBER_WITH_TYPE,
172 C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
173 C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
174 C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
175 C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
176 #endif
177 ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE,
178 ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE,
179 ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
180 ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
181 ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
182 COMMANDLINEFLAGWITHTYPE_EXT
183 NUM_CommandLineFlagWithType
184 } CommandLineFlagWithType;
186 #define FLAG_IS_DEFAULT(name) (CommandLineFlagsEx::is_default(FLAG_MEMBER(name)))
187 #define FLAG_IS_ERGO(name) (CommandLineFlagsEx::is_ergo(FLAG_MEMBER(name)))
188 #define FLAG_IS_CMDLINE(name) (CommandLineFlagsEx::is_cmdline(FLAG_MEMBER(name)))
190 #define FLAG_SET_DEFAULT(name, value) ((name) = (value))
192 #define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::COMMAND_LINE))
193 #define FLAG_SET_ERGO(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::ERGONOMIC))
195 // Can't put the following in CommandLineFlags because
196 // of a circular dependency on the enum definition.
197 class CommandLineFlagsEx : CommandLineFlags {
198 public:
199 static void boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin);
200 static void intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin);
201 static void uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin);
202 static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin);
203 static void doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin);
204 // Contract: Flag will make private copy of the incoming value
205 static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin);
207 static bool is_default(CommandLineFlag flag);
208 static bool is_ergo(CommandLineFlag flag);
209 static bool is_cmdline(CommandLineFlag flag);
210 };
212 #endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP