annotate src/share/vm/utilities/macros.hpp @ 453:c96030fff130

6684579: SoftReference processing can be made more efficient Summary: For current soft-ref clearing policies, we can decide at marking time if a soft-reference will definitely not be cleared, postponing the decision of whether it will definitely be cleared to the final reference processing phase. This can be especially beneficial in the case of concurrent collectors where the marking is usually concurrent but reference processing is usually not. Reviewed-by: jmasa
author ysr
date Thu, 20 Nov 2008 16:56:09 -0800
parents 9ee9cf798b59
children 6e2afda171db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
337
9ee9cf798b59 6754988: Update copyright year
xdono
parents: 304
diff changeset
2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
0
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
453
c96030fff130 6684579: SoftReference processing can be made more efficient
ysr
parents: 337
diff changeset
68 #define NOT_COMPILER2(code)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
69 #else // COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
72 #endif // COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // PRODUCT variant
a61af66fc99e Initial load
duke
parents:
diff changeset
76 #ifdef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
77 #define PRODUCT_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
78 #define NOT_PRODUCT(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
79 #define PRODUCT_RETURN {}
a61af66fc99e Initial load
duke
parents:
diff changeset
80 #define PRODUCT_RETURN0 { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 #define PRODUCT_RETURN_(code) { code }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 #else // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
83 #define PRODUCT_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
84 #define NOT_PRODUCT(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
85 #define PRODUCT_RETURN /*next token must be ;*/
a61af66fc99e Initial load
duke
parents:
diff changeset
86 #define PRODUCT_RETURN0 /*next token must be ;*/
a61af66fc99e Initial load
duke
parents:
diff changeset
87 #define PRODUCT_RETURN_(code) /*next token must be ;*/
a61af66fc99e Initial load
duke
parents:
diff changeset
88 #endif // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 #ifdef CHECK_UNHANDLED_OOPS
a61af66fc99e Initial load
duke
parents:
diff changeset
91 #define CHECK_UNHANDLED_OOPS_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
92 #define NOT_CHECK_UNHANDLED_OOPS(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
93 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
94 #define CHECK_UNHANDLED_OOPS_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
95 #define NOT_CHECK_UNHANDLED_OOPS(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
96 #endif // CHECK_UNHANDLED_OOPS
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 #ifdef CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
99 #define CC_INTERP_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
100 #define NOT_CC_INTERP(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
101 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
102 #define CC_INTERP_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
103 #define NOT_CC_INTERP(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
104 #endif // CC_INTERP
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
107 #define DEBUG_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
108 #define NOT_DEBUG(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // Historical.
a61af66fc99e Initial load
duke
parents:
diff changeset
110 #define debug_only(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
111 #else // ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
112 #define DEBUG_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
113 #define NOT_DEBUG(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
114 #define debug_only(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
115 #endif // ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 #ifdef _LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
118 #define LP64_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
119 #define NOT_LP64(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
120 #else // !_LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
121 #define LP64_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
122 #define NOT_LP64(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
123 #endif // _LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 #ifdef LINUX
a61af66fc99e Initial load
duke
parents:
diff changeset
126 #define LINUX_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
127 #define NOT_LINUX(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
128 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
129 #define LINUX_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
130 #define NOT_LINUX(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
131 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 #ifdef SOLARIS
a61af66fc99e Initial load
duke
parents:
diff changeset
134 #define SOLARIS_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
135 #define NOT_SOLARIS(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
136 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
137 #define SOLARIS_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
138 #define NOT_SOLARIS(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
139 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 #ifdef _WINDOWS
a61af66fc99e Initial load
duke
parents:
diff changeset
142 #define WINDOWS_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
143 #define NOT_WINDOWS(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
144 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
145 #define WINDOWS_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
146 #define NOT_WINDOWS(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
147 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
148
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
149 #if defined(IA32) || defined(AMD64)
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
150 #define X86
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
151 #define X86_ONLY(code) code
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
152 #else
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
153 #undef X86
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
154 #define X86_ONLY(code)
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
155 #endif
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
156
0
a61af66fc99e Initial load
duke
parents:
diff changeset
157 #ifdef IA32
a61af66fc99e Initial load
duke
parents:
diff changeset
158 #define IA32_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
159 #define NOT_IA32(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
160 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
161 #define IA32_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
162 #define NOT_IA32(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
163 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 #ifdef IA64
a61af66fc99e Initial load
duke
parents:
diff changeset
166 #define IA64_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
167 #define NOT_IA64(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
168 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
169 #define IA64_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
170 #define NOT_IA64(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
171 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 #ifdef AMD64
a61af66fc99e Initial load
duke
parents:
diff changeset
174 #define AMD64_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
175 #define NOT_AMD64(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
176 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
177 #define AMD64_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
178 #define NOT_AMD64(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
179 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181 #ifdef SPARC
a61af66fc99e Initial load
duke
parents:
diff changeset
182 #define SPARC_ONLY(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
183 #define NOT_SPARC(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
184 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
185 #define SPARC_ONLY(code)
a61af66fc99e Initial load
duke
parents:
diff changeset
186 #define NOT_SPARC(code) code
a61af66fc99e Initial load
duke
parents:
diff changeset
187 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 #define FIX_THIS(code) report_assertion_failure("FIX_THIS",__FILE__, __LINE__, "")
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 #define define_pd_global(type, name, value) const type pd_##name = value;