Mercurial > hg > graal-compiler
annotate src/share/vm/utilities/macros.hpp @ 1868:3dc12ef8735e
6989297: Integrate additional portability improvements
Reviewed-by: vladidan, dholmes
author | bobv |
---|---|
date | Thu, 07 Oct 2010 15:12:57 -0400 |
parents | 18c378513575 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 1 /* |
1692 | 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 // Use this to mark code that needs to be cleaned up (for development only) | |
26 #define NEEDS_CLEANUP | |
27 | |
28 // Makes a string of the argument (which is not macro-expanded) | |
29 #define STR(a) #a | |
30 | |
31 // Makes a string of the macro expansion of a | |
32 #define XSTR(a) STR(a) | |
33 | |
34 // KERNEL variant | |
35 #ifdef KERNEL | |
36 #define COMPILER1 | |
37 #define SERIALGC | |
38 | |
39 #define JVMTI_KERNEL | |
40 #define FPROF_KERNEL | |
41 #define VM_STRUCTS_KERNEL | |
42 #define JNICHECK_KERNEL | |
43 #define SERVICES_KERNEL | |
44 | |
45 #define KERNEL_RETURN {} | |
46 #define KERNEL_RETURN_(code) { code } | |
47 | |
48 #else // KERNEL | |
49 | |
50 #define KERNEL_RETURN /* next token must be ; */ | |
51 #define KERNEL_RETURN_(code) /* next token must be ; */ | |
52 | |
53 #endif // KERNEL | |
54 | |
55 // COMPILER1 variant | |
56 #ifdef COMPILER1 | |
57 #ifdef COMPILER2 | |
58 #define TIERED | |
59 #endif | |
60 #define COMPILER1_PRESENT(code) code | |
61 #else // COMPILER1 | |
62 #define COMPILER1_PRESENT(code) | |
63 #endif // COMPILER1 | |
64 | |
65 // COMPILER2 variant | |
66 #ifdef COMPILER2 | |
67 #define COMPILER2_PRESENT(code) code | |
453
c96030fff130
6684579: SoftReference processing can be made more efficient
ysr
parents:
337
diff
changeset
|
68 #define NOT_COMPILER2(code) |
0 | 69 #else // COMPILER2 |
70 #define COMPILER2_PRESENT(code) | |
453
c96030fff130
6684579: SoftReference processing can be made more efficient
ysr
parents:
337
diff
changeset
|
71 #define NOT_COMPILER2(code) code |
0 | 72 #endif // COMPILER2 |
73 | |
1783 | 74 #ifdef TIERED |
75 #define TIERED_ONLY(code) code | |
76 #define NOT_TIERED(code) | |
77 #else | |
78 #define TIERED_ONLY(code) | |
79 #define NOT_TIERED(code) code | |
80 #endif // TIERED | |
81 | |
0 | 82 |
83 // PRODUCT variant | |
84 #ifdef PRODUCT | |
85 #define PRODUCT_ONLY(code) code | |
86 #define NOT_PRODUCT(code) | |
1768
6ee479178066
6979444: add command line option to print command line flags descriptions
ikrylov
parents:
1692
diff
changeset
|
87 #define NOT_PRODUCT_ARG(arg) |
0 | 88 #define PRODUCT_RETURN {} |
89 #define PRODUCT_RETURN0 { return 0; } | |
90 #define PRODUCT_RETURN_(code) { code } | |
91 #else // PRODUCT | |
92 #define PRODUCT_ONLY(code) | |
93 #define NOT_PRODUCT(code) code | |
1768
6ee479178066
6979444: add command line option to print command line flags descriptions
ikrylov
parents:
1692
diff
changeset
|
94 #define NOT_PRODUCT_ARG(arg) arg, |
0 | 95 #define PRODUCT_RETURN /*next token must be ;*/ |
96 #define PRODUCT_RETURN0 /*next token must be ;*/ | |
97 #define PRODUCT_RETURN_(code) /*next token must be ;*/ | |
98 #endif // PRODUCT | |
99 | |
100 #ifdef CHECK_UNHANDLED_OOPS | |
101 #define CHECK_UNHANDLED_OOPS_ONLY(code) code | |
102 #define NOT_CHECK_UNHANDLED_OOPS(code) | |
103 #else | |
104 #define CHECK_UNHANDLED_OOPS_ONLY(code) | |
105 #define NOT_CHECK_UNHANDLED_OOPS(code) code | |
106 #endif // CHECK_UNHANDLED_OOPS | |
107 | |
108 #ifdef CC_INTERP | |
109 #define CC_INTERP_ONLY(code) code | |
110 #define NOT_CC_INTERP(code) | |
111 #else | |
112 #define CC_INTERP_ONLY(code) | |
113 #define NOT_CC_INTERP(code) code | |
114 #endif // CC_INTERP | |
115 | |
116 #ifdef ASSERT | |
117 #define DEBUG_ONLY(code) code | |
118 #define NOT_DEBUG(code) | |
809
6e2afda171db
6849716: BitMap - performance regression introduced with G1
jcoomes
parents:
453
diff
changeset
|
119 #define NOT_DEBUG_RETURN /*next token must be ;*/ |
0 | 120 // Historical. |
121 #define debug_only(code) code | |
122 #else // ASSERT | |
123 #define DEBUG_ONLY(code) | |
124 #define NOT_DEBUG(code) code | |
809
6e2afda171db
6849716: BitMap - performance regression introduced with G1
jcoomes
parents:
453
diff
changeset
|
125 #define NOT_DEBUG_RETURN {} |
0 | 126 #define debug_only(code) |
127 #endif // ASSERT | |
128 | |
129 #ifdef _LP64 | |
130 #define LP64_ONLY(code) code | |
131 #define NOT_LP64(code) | |
132 #else // !_LP64 | |
133 #define LP64_ONLY(code) | |
134 #define NOT_LP64(code) code | |
135 #endif // _LP64 | |
136 | |
137 #ifdef LINUX | |
138 #define LINUX_ONLY(code) code | |
139 #define NOT_LINUX(code) | |
140 #else | |
141 #define LINUX_ONLY(code) | |
142 #define NOT_LINUX(code) code | |
143 #endif | |
144 | |
145 #ifdef SOLARIS | |
146 #define SOLARIS_ONLY(code) code | |
147 #define NOT_SOLARIS(code) | |
148 #else | |
149 #define SOLARIS_ONLY(code) | |
150 #define NOT_SOLARIS(code) code | |
151 #endif | |
152 | |
153 #ifdef _WINDOWS | |
154 #define WINDOWS_ONLY(code) code | |
155 #define NOT_WINDOWS(code) | |
156 #else | |
157 #define WINDOWS_ONLY(code) | |
158 #define NOT_WINDOWS(code) code | |
159 #endif | |
160 | |
304 | 161 #if defined(IA32) || defined(AMD64) |
162 #define X86 | |
163 #define X86_ONLY(code) code | |
1692 | 164 #define NOT_X86(code) |
304 | 165 #else |
166 #undef X86 | |
167 #define X86_ONLY(code) | |
1692 | 168 #define NOT_X86(code) code |
304 | 169 #endif |
170 | |
0 | 171 #ifdef IA32 |
172 #define IA32_ONLY(code) code | |
173 #define NOT_IA32(code) | |
174 #else | |
175 #define IA32_ONLY(code) | |
176 #define NOT_IA32(code) code | |
177 #endif | |
178 | |
179 #ifdef IA64 | |
180 #define IA64_ONLY(code) code | |
181 #define NOT_IA64(code) | |
182 #else | |
183 #define IA64_ONLY(code) | |
184 #define NOT_IA64(code) code | |
185 #endif | |
186 | |
187 #ifdef AMD64 | |
188 #define AMD64_ONLY(code) code | |
189 #define NOT_AMD64(code) | |
190 #else | |
191 #define AMD64_ONLY(code) | |
192 #define NOT_AMD64(code) code | |
193 #endif | |
194 | |
195 #ifdef SPARC | |
196 #define SPARC_ONLY(code) code | |
197 #define NOT_SPARC(code) | |
198 #else | |
199 #define SPARC_ONLY(code) | |
200 #define NOT_SPARC(code) code | |
201 #endif | |
202 | |
1681
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
203 #ifdef PPC |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
204 #define PPC_ONLY(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
205 #define NOT_PPC(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
206 #else |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
207 #define PPC_ONLY(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
208 #define NOT_PPC(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
209 #endif |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
210 |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
211 #ifdef E500V2 |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
212 #define E500V2_ONLY(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
213 #define NOT_E500V2(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
214 #else |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
215 #define E500V2_ONLY(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
216 #define NOT_E500V2(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
217 #endif |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
218 |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
219 |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
220 #ifdef ARM |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
221 #define ARM_ONLY(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
222 #define NOT_ARM(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
223 #else |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
224 #define ARM_ONLY(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
225 #define NOT_ARM(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
226 #endif |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
227 |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
228 #ifdef JAVASE_EMBEDDED |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
229 #define EMBEDDED_ONLY(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
230 #define NOT_EMBEDDED(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
231 #else |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
232 #define EMBEDDED_ONLY(code) |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
233 #define NOT_EMBEDDED(code) code |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
234 #endif |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
235 |
0 | 236 #define define_pd_global(type, name, value) const type pd_##name = value; |