annotate src/share/vm/utilities/macros.hpp @ 304:dc7f315e41f7

5108146: Merge i486 and amd64 cpu directories 6459804: Want client (c1) compiler for x86_64 (amd64) for faster start-up Reviewed-by: kvn
author never
date Wed, 27 Aug 2008 00:21:55 -0700
parents a61af66fc99e
children 9ee9cf798b59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // Use this to mark code that needs to be cleaned up (for development only)
a61af66fc99e Initial load
duke
parents:
diff changeset
26 #define NEEDS_CLEANUP
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // Makes a string of the argument (which is not macro-expanded)
a61af66fc99e Initial load
duke
parents:
diff changeset
29 #define STR(a) #a
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Makes a string of the macro expansion of a
a61af66fc99e Initial load
duke
parents:
diff changeset
32 #define XSTR(a) STR(a)
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // KERNEL variant
a61af66fc99e Initial load
duke
parents:
diff changeset
35 #ifdef KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
36 #define COMPILER1
a61af66fc99e Initial load
duke
parents:
diff changeset
37 #define SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 #define JVMTI_KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
40 #define FPROF_KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
41 #define VM_STRUCTS_KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
42 #define JNICHECK_KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
43 #define SERVICES_KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 #define KERNEL_RETURN {}
a61af66fc99e Initial load
duke
parents:
diff changeset
46 #define KERNEL_RETURN_(code) { code }
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 #else // KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 #define KERNEL_RETURN /* next token must be ; */
a61af66fc99e Initial load
duke
parents:
diff changeset
51 #define KERNEL_RETURN_(code) /* next token must be ; */
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 #endif // KERNEL
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // COMPILER1 variant
a61af66fc99e Initial load
duke
parents:
diff changeset
56 #ifdef COMPILER1
a61af66fc99e Initial load
duke
parents:
diff changeset
57 #ifdef COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
58 #define TIERED
a61af66fc99e Initial load
duke
parents:
diff changeset
59 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
60 #define COMPILER1_PRESENT(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
61 #else // COMPILER1
a61af66fc99e Initial load
duke
parents:
diff changeset
62 #define COMPILER1_PRESENT(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
63 #endif // COMPILER1
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // COMPILER2 variant
a61af66fc99e Initial load
duke
parents:
diff changeset
66 #ifdef COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
67 #define COMPILER2_PRESENT(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
68 #else // COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
69 #define COMPILER2_PRESENT(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
70 #endif // COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // PRODUCT variant
a61af66fc99e Initial load
duke
parents:
diff changeset
74 #ifdef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
75 #define PRODUCT_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
76 #define NOT_PRODUCT(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
77 #define PRODUCT_RETURN {}
a61af66fc99e Initial load
duke
parents:
diff changeset
78 #define PRODUCT_RETURN0 { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
79 #define PRODUCT_RETURN_(code) { code }
a61af66fc99e Initial load
duke
parents:
diff changeset
80 #else // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
81 #define PRODUCT_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
82 #define NOT_PRODUCT(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
83 #define PRODUCT_RETURN /*next token must be ;*/
a61af66fc99e Initial load
duke
parents:
diff changeset
84 #define PRODUCT_RETURN0 /*next token must be ;*/
a61af66fc99e Initial load
duke
parents:
diff changeset
85 #define PRODUCT_RETURN_(code) /*next token must be ;*/
a61af66fc99e Initial load
duke
parents:
diff changeset
86 #endif // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 #ifdef CHECK_UNHANDLED_OOPS
a61af66fc99e Initial load
duke
parents:
diff changeset
89 #define CHECK_UNHANDLED_OOPS_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
90 #define NOT_CHECK_UNHANDLED_OOPS(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
91 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
92 #define CHECK_UNHANDLED_OOPS_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
93 #define NOT_CHECK_UNHANDLED_OOPS(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
94 #endif // CHECK_UNHANDLED_OOPS
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 #ifdef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
97 #define CC_INTERP_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
98 #define NOT_CC_INTERP(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
99 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
100 #define CC_INTERP_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
101 #define NOT_CC_INTERP(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
102 #endif // CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
105 #define DEBUG_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
106 #define NOT_DEBUG(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // Historical.
a61af66fc99e Initial load
duke
parents:
diff changeset
108 #define debug_only(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
109 #else // ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
110 #define DEBUG_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
111 #define NOT_DEBUG(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
112 #define debug_only(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
113 #endif // ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 #ifdef _LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
116 #define LP64_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
117 #define NOT_LP64(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
118 #else // !_LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
119 #define LP64_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
120 #define NOT_LP64(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
121 #endif // _LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 #ifdef LINUX
a61af66fc99e Initial load
duke
parents:
diff changeset
124 #define LINUX_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
125 #define NOT_LINUX(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
126 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
127 #define LINUX_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
128 #define NOT_LINUX(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
129 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 #ifdef SOLARIS
a61af66fc99e Initial load
duke
parents:
diff changeset
132 #define SOLARIS_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
133 #define NOT_SOLARIS(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
134 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
135 #define SOLARIS_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
136 #define NOT_SOLARIS(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
137 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 #ifdef _WINDOWS
a61af66fc99e Initial load
duke
parents:
diff changeset
140 #define WINDOWS_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
141 #define NOT_WINDOWS(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
142 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
143 #define WINDOWS_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
144 #define NOT_WINDOWS(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
145 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
146
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
147 #if defined(IA32) || defined(AMD64)
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
148 #define X86
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
149 #define X86_ONLY(code) code
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
150 #else
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
151 #undef X86
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
152 #define X86_ONLY(code)
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
153 #endif
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
154
0
a61af66fc99e Initial load
duke
parents:
diff changeset
155 #ifdef IA32
a61af66fc99e Initial load
duke
parents:
diff changeset
156 #define IA32_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
157 #define NOT_IA32(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
158 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
159 #define IA32_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
160 #define NOT_IA32(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
161 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 #ifdef IA64
a61af66fc99e Initial load
duke
parents:
diff changeset
164 #define IA64_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
165 #define NOT_IA64(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
166 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
167 #define IA64_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
168 #define NOT_IA64(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
169 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 #ifdef AMD64
a61af66fc99e Initial load
duke
parents:
diff changeset
172 #define AMD64_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
173 #define NOT_AMD64(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
174 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
175 #define AMD64_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
176 #define NOT_AMD64(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
177 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 #ifdef SPARC
a61af66fc99e Initial load
duke
parents:
diff changeset
180 #define SPARC_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
181 #define NOT_SPARC(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
182 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
183 #define SPARC_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
184 #define NOT_SPARC(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
185 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 #define FIX_THIS(code) report_assertion_failure("FIX_THIS",__FILE__, __LINE__, "")
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 #define define_pd_global(type, name, value) const type pd_##name = value;