1 /*
2 * Copyright (c) 1997, 2024, 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 */
24
25 #ifndef SHARE_UTILITIES_MACROS_HPP
26 #define SHARE_UTILITIES_MACROS_HPP
27
28 // Use this to mark code that needs to be cleaned up (for development only)
29 #define NEEDS_CLEANUP
30
31 // Makes a string of the argument (which is not macro-expanded)
32 #define STR(a) #a
33
34 // Makes a string of the macro expansion of a
35 #define XSTR(a) STR(a)
36
37 // Allow commas in macro arguments.
38 #define COMMA ,
39
40 // Apply pre-processor token pasting to the expansions of x and y.
41 // The token pasting operator (##) prevents its arguments from being
42 // expanded. This macro allows expansion of its arguments before the
43 // concatenation is performed. Note: One auxiliary level ought to be
44 // sufficient, but two are used because of bugs in some preprocesors.
45 #define PASTE_TOKENS(x, y) PASTE_TOKENS_AUX(x, y)
46 #define PASTE_TOKENS_AUX(x, y) PASTE_TOKENS_AUX2(x, y)
47 #define PASTE_TOKENS_AUX2(x, y) x ## y
48
49 // Convenience macro that produces a string literal with the filename
50 // and linenumber of the location where the macro was used.
51 #ifndef FILE_AND_LINE
52 #define FILE_AND_LINE __FILE__ ":" XSTR(__LINE__)
53 #endif
54
55 // -DINCLUDE_<something>=0 | 1 can be specified on the command line to include
56 // or exclude functionality.
57
58 #ifndef FILE_AND_LINE
59 #define FILE_AND_LINE __FILE__ ":" XSTR(__LINE__)
60 #endif
61
62 #ifndef INCLUDE_JVMTI
63 #define INCLUDE_JVMTI 1
64 #endif // INCLUDE_JVMTI
65
66 #if INCLUDE_JVMTI
67 #define JVMTI_ONLY(x) x
68 #define NOT_JVMTI(x)
69 #define NOT_JVMTI_RETURN
70 #define NOT_JVMTI_RETURN_(code) /* next token must be ; */
71 #else
72 #define JVMTI_ONLY(x)
73 #define NOT_JVMTI(x) x
74 #define NOT_JVMTI_RETURN { return; }
75 #define NOT_JVMTI_RETURN_(code) { return code; }
76 #endif // INCLUDE_JVMTI
77
78 #ifndef INCLUDE_VM_STRUCTS
79 #define INCLUDE_VM_STRUCTS 1
80 #endif
81
82 #if INCLUDE_VM_STRUCTS
83 #define NOT_VM_STRUCTS_RETURN /* next token must be ; */
84 #define NOT_VM_STRUCTS_RETURN_(code) /* next token must be ; */
85 #else
86 #define NOT_VM_STRUCTS_RETURN {}
87 #define NOT_VM_STRUCTS_RETURN_(code) { return code; }
88 #endif // INCLUDE_VM_STRUCTS
89
90 #ifndef INCLUDE_JNI_CHECK
91 #define INCLUDE_JNI_CHECK 1
92 #endif
93
94 #if INCLUDE_JNI_CHECK
95 #define NOT_JNI_CHECK_RETURN /* next token must be ; */
96 #define NOT_JNI_CHECK_RETURN_(code) /* next token must be ; */
97 #else
98 #define NOT_JNI_CHECK_RETURN {}
99 #define NOT_JNI_CHECK_RETURN_(code) { return code; }
100 #endif // INCLUDE_JNI_CHECK
101
102 #ifndef INCLUDE_SERVICES
103 #define INCLUDE_SERVICES 1
104 #endif
105
106 #if INCLUDE_SERVICES
107 #define NOT_SERVICES_RETURN /* next token must be ; */
108 #define NOT_SERVICES_RETURN_(code) /* next token must be ; */
109 #else
110 #define NOT_SERVICES_RETURN {}
111 #define NOT_SERVICES_RETURN_(code) { return code; }
112 #endif // INCLUDE_SERVICES
113
114 #ifndef INCLUDE_CDS
115 #define INCLUDE_CDS 1
116 #endif
117
118 #if INCLUDE_CDS
119 #define CDS_ONLY(x) x
120 #define NOT_CDS(x)
121 #define NOT_CDS_RETURN /* next token must be ; */
122 #define NOT_CDS_RETURN0 /* next token must be ; */
123 #define NOT_CDS_RETURN_(code) /* next token must be ; */
124 #else
125 #define CDS_ONLY(x)
126 #define NOT_CDS(x) x
127 #define NOT_CDS_RETURN {}
128 #define NOT_CDS_RETURN0 { return 0; }
129 #define NOT_CDS_RETURN_(code) { return code; }
130 #endif // INCLUDE_CDS
131
132 #ifndef INCLUDE_MANAGEMENT
133 #define INCLUDE_MANAGEMENT 1
134 #endif // INCLUDE_MANAGEMENT
135
136 #if INCLUDE_MANAGEMENT
137 #define NOT_MANAGEMENT_RETURN /* next token must be ; */
138 #define NOT_MANAGEMENT_RETURN_(code) /* next token must be ; */
139 #define MANAGEMENT_ONLY(x) x
140 #else
141 #define NOT_MANAGEMENT_RETURN {}
142 #define NOT_MANAGEMENT_RETURN_(code) { return code; }
143 #define MANAGEMENT_ONLY(x)
144 #endif // INCLUDE_MANAGEMENT
145
146 #ifndef INCLUDE_EPSILONGC
147 #define INCLUDE_EPSILONGC 1
148 #endif // INCLUDE_EPSILONGC
149
150 #if INCLUDE_EPSILONGC
151 #define EPSILONGC_ONLY(x) x
152 #define EPSILONGC_ONLY_ARG(arg) arg,
153 #define NOT_EPSILONGC(x)
154 #define NOT_EPSILONGC_RETURN /* next token must be ; */
155 #define NOT_EPSILONGC_RETURN_(code) /* next token must be ; */
156 #else
157 #define EPSILONGC_ONLY(x)
158 #define EPSILONGC_ONLY_ARG(arg)
159 #define NOT_EPSILONGC(x) x
160 #define NOT_EPSILONGC_RETURN {}
161 #define NOT_EPSILONGC_RETURN_(code) { return code; }
162 #endif // INCLUDE_EPSILONGC
163
164 #ifndef INCLUDE_G1GC
165 #define INCLUDE_G1GC 1
166 #endif // INCLUDE_G1GC
167
168 #if INCLUDE_G1GC
169 #define G1GC_ONLY(x) x
170 #define G1GC_ONLY_ARG(arg) arg,
171 #define NOT_G1GC(x)
172 #define NOT_G1GC_RETURN /* next token must be ; */
173 #define NOT_G1GC_RETURN_(code) /* next token must be ; */
174 #else
175 #define G1GC_ONLY(x)
176 #define G1GC_ONLY_ARG(arg)
177 #define NOT_G1GC(x) x
178 #define NOT_G1GC_RETURN {}
179 #define NOT_G1GC_RETURN_(code) { return code; }
180 #endif // INCLUDE_G1GC
181
182 #ifndef INCLUDE_PARALLELGC
183 #define INCLUDE_PARALLELGC 1
184 #endif // INCLUDE_PARALLELGC
185
186 #if INCLUDE_PARALLELGC
187 #define PARALLELGC_ONLY(x) x
188 #define PARALLELGC_ONLY_ARG(arg) arg,
189 #define NOT_PARALLELGC(x)
190 #define NOT_PARALLELGC_RETURN /* next token must be ; */
191 #define NOT_PARALLELGC_RETURN_(code) /* next token must be ; */
192 #else
193 #define PARALLELGC_ONLY(x)
194 #define PARALLELGC_ONLY_ARG(arg)
195 #define NOT_PARALLELGC(x) x
196 #define NOT_PARALLELGC_RETURN {}
197 #define NOT_PARALLELGC_RETURN_(code) { return code; }
198 #endif // INCLUDE_PARALLELGC
199
200 #ifndef INCLUDE_SERIALGC
201 #define INCLUDE_SERIALGC 1
202 #endif // INCLUDE_SERIALGC
203
204 #if INCLUDE_SERIALGC
205 #define SERIALGC_ONLY(x) x
206 #define SERIALGC_ONLY_ARG(arg) arg,
207 #define NOT_SERIALGC(x)
208 #define NOT_SERIALGC_RETURN /* next token must be ; */
209 #define NOT_SERIALGC_RETURN_(code) /* next token must be ; */
210 #else
211 #define SERIALGC_ONLY(x)
212 #define SERIALGC_ONLY_ARG(arg)
213 #define NOT_SERIALGC(x) x
214 #define NOT_SERIALGC_RETURN {}
215 #define NOT_SERIALGC_RETURN_(code) { return code; }
216 #endif // INCLUDE_SERIALGC
217
218 #ifndef INCLUDE_SHENANDOAHGC
219 #define INCLUDE_SHENANDOAHGC 1
220 #endif // INCLUDE_SHENANDOAHGC
221
222 #if INCLUDE_SHENANDOAHGC
223 #define SHENANDOAHGC_ONLY(x) x
224 #define SHENANDOAHGC_ONLY_ARG(arg) arg,
225 #define NOT_SHENANDOAHGC(x)
226 #define NOT_SHENANDOAHGC_RETURN /* next token must be ; */
227 #define NOT_SHENANDOAHGC_RETURN_(code) /* next token must be ; */
228 #else
229 #define SHENANDOAHGC_ONLY(x)
230 #define SHENANDOAHGC_ONLY_ARG(arg)
231 #define NOT_SHENANDOAHGC(x) x
232 #define NOT_SHENANDOAHGC_RETURN {}
233 #define NOT_SHENANDOAHGC_RETURN_(code) { return code; }
234 #endif // INCLUDE_SHENANDOAHGC
235
236 #ifndef INCLUDE_ZGC
237 #define INCLUDE_ZGC 1
238 #endif // INCLUDE_ZGC
239
240 #if INCLUDE_ZGC
241 #define ZGC_ONLY(x) x
242 #define ZGC_ONLY_ARG(arg) arg,
243 #define NOT_ZGC(x)
244 #define NOT_ZGC_RETURN /* next token must be ; */
245 #define NOT_ZGC_RETURN_(code) /* next token must be ; */
246 #else
247 #define ZGC_ONLY(x)
248 #define ZGC_ONLY_ARG(arg)
249 #define NOT_ZGC(x) x
250 #define NOT_ZGC_RETURN {}
251 #define NOT_ZGC_RETURN_(code) { return code; }
252 #endif // INCLUDE_ZGC
253
254 #ifndef INCLUDE_JFR
255 #define INCLUDE_JFR 1
256 #endif
257
258 #if INCLUDE_JFR
259 #define JFR_ONLY(code) code
260 #define NOT_JFR_RETURN() /* next token must be ; */
261 #define NOT_JFR_RETURN_(code) /* next token must be ; */
262 #else
263 #define JFR_ONLY(code)
264 #define NOT_JFR_RETURN() {}
265 #define NOT_JFR_RETURN_(code) { return code; }
266 #endif
267
268 #ifndef INCLUDE_JVMCI
269 #define INCLUDE_JVMCI 1
270 #endif
271
272 #if INCLUDE_JVMCI
273 #define JVMCI_ONLY(code) code
274 #define NOT_JVMCI(code)
275 #define NOT_JVMCI_RETURN /* next token must be ; */
276 #else
277 #define JVMCI_ONLY(code)
278 #define NOT_JVMCI(code) code
279 #define NOT_JVMCI_RETURN {}
280 #endif // INCLUDE_JVMCI
281
282 // COMPILER1 variant
283 #ifdef COMPILER1
284 #define COMPILER1_PRESENT(code) code
285 #define NOT_COMPILER1(code)
286 #else // COMPILER1
287 #define COMPILER1_PRESENT(code)
288 #define NOT_COMPILER1(code) code
289 #endif // COMPILER1
290
291 // COMPILER2 variant
292 #ifdef COMPILER2
293 #define COMPILER2_PRESENT(code) code
294 #define NOT_COMPILER2(code)
295 #else // COMPILER2
296 #define COMPILER2_PRESENT(code)
297 #define NOT_COMPILER2(code) code
298 #endif // COMPILER2
299
300 // COMPILER2 or JVMCI
301 #if defined(COMPILER2) || INCLUDE_JVMCI
302 #define COMPILER2_OR_JVMCI 1
303 #define COMPILER2_OR_JVMCI_PRESENT(code) code
304 #define NOT_COMPILER2_OR_JVMCI(code)
305 #define NOT_COMPILER2_OR_JVMCI_RETURN /* next token must be ; */
306 #define NOT_COMPILER2_OR_JVMCI_RETURN_(code) /* next token must be ; */
307 #else
308 #define COMPILER2_OR_JVMCI 0
309 #define COMPILER2_OR_JVMCI_PRESENT(code)
310 #define NOT_COMPILER2_OR_JVMCI(code) code
311 #define NOT_COMPILER2_OR_JVMCI_RETURN {}
312 #define NOT_COMPILER2_OR_JVMCI_RETURN_(code) { return code; }
313 #endif
314
315 // COMPILER1 and COMPILER2
316 #if defined(COMPILER1) && defined(COMPILER2)
317 #define COMPILER1_AND_COMPILER2 1
318 #define COMPILER1_AND_COMPILER2_PRESENT(code) code
319 #else
320 #define COMPILER1_AND_COMPILER2 0
321 #define COMPILER1_AND_COMPILER2_PRESENT(code)
322 #endif
323
324 // COMPILER1 or COMPILER2
325 #if defined(COMPILER1) || defined(COMPILER2)
326 #define COMPILER1_OR_COMPILER2 1
327 #define COMPILER1_OR_COMPILER2_PRESENT(code) code
328 #else
329 #define COMPILER1_OR_COMPILER2 0
330 #define COMPILER1_OR_COMPILER2_PRESENT(code)
331 #endif
332
333
334 // PRODUCT variant
335 #ifdef PRODUCT
336 #define PRODUCT_ONLY(code) code
337 #define NOT_PRODUCT(code)
338 #define NOT_PRODUCT_ARG(arg)
339 #define PRODUCT_RETURN {}
340 #define PRODUCT_RETURN0 { return 0; }
341 #define PRODUCT_RETURN_NULL { return nullptr; }
342 #define PRODUCT_RETURN_(code) { code }
343 #else // PRODUCT
344 #define PRODUCT_ONLY(code)
345 #define NOT_PRODUCT(code) code
346 #define NOT_PRODUCT_ARG(arg) arg,
347 #define PRODUCT_RETURN /*next token must be ;*/
348 #define PRODUCT_RETURN0 /*next token must be ;*/
349 #define PRODUCT_RETURN_NULL /* next token must be ;*/
350 #define PRODUCT_RETURN_(code) /*next token must be ;*/
351 #endif // PRODUCT
352
353 #ifdef CHECK_UNHANDLED_OOPS
354 #define CHECK_UNHANDLED_OOPS_ONLY(code) code
355 #define NOT_CHECK_UNHANDLED_OOPS(code)
356 #else
357 #define CHECK_UNHANDLED_OOPS_ONLY(code)
358 #define NOT_CHECK_UNHANDLED_OOPS(code) code
359 #endif // CHECK_UNHANDLED_OOPS
360
361 // Enable collection of TaskQueue statistics.
362 // Enabled by default in debug builds. Otherwise, disabled by default.
363 #ifndef TASKQUEUE_STATS
364 #ifdef ASSERT
365 #define TASKQUEUE_STATS 1
366 #else
367 #define TASKQUEUE_STATS 0
368 #endif // ASSERT
369 #endif // TASKQUEUE_STATS
370 #if TASKQUEUE_STATS
371 #define TASKQUEUE_STATS_ONLY(code) code
372 #else
373 #define TASKQUEUE_STATS_ONLY(code)
374 #endif // TASKQUEUE_STATS
375
376 #ifdef ASSERT
377 #define DEBUG_ONLY(code) code
378 #define NOT_DEBUG(code)
379 #define NOT_DEBUG_RETURN /*next token must be ;*/
380 #else // ASSERT
381 #define DEBUG_ONLY(code)
382 #define NOT_DEBUG(code) code
383 #define NOT_DEBUG_RETURN {}
384 #endif // ASSERT
385
386 #ifdef _LP64
387 #define LP64_ONLY(code) code
388 #define NOT_LP64(code)
389 #else // !_LP64
390 #define LP64_ONLY(code)
391 #define NOT_LP64(code) code
392 #endif // _LP64
393
394 #ifdef LINUX
395 #define LINUX_ONLY(code) code
396 #define NOT_LINUX(code)
397 #else
398 #define LINUX_ONLY(code)
399 #define NOT_LINUX(code) code
400 #endif
401
402 #ifdef __APPLE__
403 #define MACOS_ONLY(code) code
404 #define NOT_MACOS(code)
405 #else
406 #define MACOS_ONLY(code)
407 #define NOT_MACOS(code) code
408 #endif
409
410 #ifdef AIX
411 #define AIX_ONLY(code) code
412 #define NOT_AIX(code)
413 #else
414 #define AIX_ONLY(code)
415 #define NOT_AIX(code) code
416 #endif
417
418 #ifdef _WINDOWS
419 #define WINDOWS_ONLY(code) code
420 #define NOT_WINDOWS(code)
421 #else
422 #define WINDOWS_ONLY(code)
423 #define NOT_WINDOWS(code) code
424 #endif
425
426 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
427 #ifndef BSD
428 #define BSD
429 #endif // BSD defined in <sys/param.h>
430 #define BSD_ONLY(code) code
431 #define NOT_BSD(code)
432 #else
433 #define BSD_ONLY(code)
434 #define NOT_BSD(code) code
435 #endif
436
437 #ifdef _WIN64
438 #define WIN64_ONLY(code) code
439 #define NOT_WIN64(code)
440 #else
441 #define WIN64_ONLY(code)
442 #define NOT_WIN64(code) code
443 #endif
444
445 #if defined(ZERO)
446 #define ZERO_ONLY(code) code
447 #define NOT_ZERO(code)
448 #define NOT_ZERO_RETURN {}
449 #else
450 #define ZERO_ONLY(code)
451 #define NOT_ZERO(code) code
452 #define NOT_ZERO_RETURN
453 #endif
454
455 #if defined(IA32) || defined(AMD64)
456 #define X86
457 #define X86_ONLY(code) code
458 #define NOT_X86(code)
459 #else
460 #undef X86
461 #define X86_ONLY(code)
462 #define NOT_X86(code) code
463 #endif
464
465 #ifdef IA32
466 #define IA32_ONLY(code) code
467 #define NOT_IA32(code)
468 #else
469 #define IA32_ONLY(code)
470 #define NOT_IA32(code) code
471 #endif
472
473 #ifdef AMD64
474 #define AMD64_ONLY(code) code
475 #define NOT_AMD64(code)
476 #else
477 #define AMD64_ONLY(code)
478 #define NOT_AMD64(code) code
479 #endif
480
481 #ifdef S390
482 #define S390_ONLY(code) code
483 #define NOT_S390(code)
484 #else
485 #define S390_ONLY(code)
486 #define NOT_S390(code) code
487 #endif
488
489 #if defined(PPC32) || defined(PPC64)
490 #ifndef PPC
491 #define PPC
492 #endif
493 #define PPC_ONLY(code) code
494 #define NOT_PPC(code)
495 #else
496 #undef PPC
497 #define PPC_ONLY(code)
498 #define NOT_PPC(code) code
499 #endif
500
501 #ifdef PPC32
502 #define PPC32_ONLY(code) code
503 #define NOT_PPC32(code)
504 #else
505 #define PPC32_ONLY(code)
506 #define NOT_PPC32(code) code
507 #endif
508
509 #ifdef PPC64
510 #define PPC64_ONLY(code) code
511 #define NOT_PPC64(code)
512 #else
513 #define PPC64_ONLY(code)
514 #define NOT_PPC64(code) code
515 #endif
516
517 #ifdef E500V2
518 #define E500V2_ONLY(code) code
519 #define NOT_E500V2(code)
520 #else
521 #define E500V2_ONLY(code)
522 #define NOT_E500V2(code) code
523 #endif
524
525 // Note: There are two ARM ports. They set the following in the makefiles:
526 // 1. 32-bit port: -DARM -DARM32 -DTARGET_ARCH_arm
527 // 2. 64-bit port: -DAARCH64 -D_LP64 -DTARGET_ARCH_aarch64
528 #ifdef ARM
529 #define ARM_ONLY(code) code
530 #define NOT_ARM(code)
531 #else
532 #define ARM_ONLY(code)
533 #define NOT_ARM(code) code
534 #endif
535
536 #ifdef ARM32
537 #define ARM32_ONLY(code) code
538 #define NOT_ARM32(code)
539 #else
540 #define ARM32_ONLY(code)
541 #define NOT_ARM32(code) code
542 #endif
543
544 #ifdef AARCH64
545 #define AARCH64_ONLY(code) code
546 #define NOT_AARCH64(code)
547 #else
548 #define AARCH64_ONLY(code)
549 #define NOT_AARCH64(code) code
550 #endif
551
552 #ifdef TARGET_ARCH_aarch64
553 #define AARCH64_PORT_ONLY(code) code
554 #else
555 #define AARCH64_PORT_ONLY(code)
556 #endif
557
558 #define MACOS_AARCH64_ONLY(x) MACOS_ONLY(AARCH64_ONLY(x))
559
560 #if defined(RISCV32) || defined(RISCV64)
561 #define RISCV
562 #define RISCV_ONLY(code) code
563 #define NOT_RISCV(code)
564 #else
565 #undef RISCV
566 #define RISCV_ONLY(code)
567 #define NOT_RISCV(code) code
568 #endif
569
570 #ifdef RISCV32
571 #define RISCV32_ONLY(code) code
572 #define NOT_RISCV32(code)
573 #else
574 #define RISCV32_ONLY(code)
575 #define NOT_RISCV32(code) code
576 #endif
577
578 #ifdef RISCV64
579 #define RISCV64_ONLY(code) code
580 #define NOT_RISCV64(code)
581 #else
582 #define RISCV64_ONLY(code)
583 #define NOT_RISCV64(code) code
584 #endif
585
586 #ifdef VM_LITTLE_ENDIAN
587 #define LITTLE_ENDIAN_ONLY(code) code
588 #define BIG_ENDIAN_ONLY(code)
589 #else
590 #define LITTLE_ENDIAN_ONLY(code)
591 #define BIG_ENDIAN_ONLY(code) code
592 #endif
593
594 #define define_pd_global(type, name, value) const type pd_##name = value;
595
596 // Helper macros for constructing file names for includes.
597 #define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU)
598 #define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS)
599 #define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU))
600 #define COMPILER_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_COMPILER)
601
602 // Include platform dependent files.
603 //
604 // This macro constructs from basename and INCLUDE_SUFFIX_OS /
605 // INCLUDE_SUFFIX_CPU / INCLUDE_SUFFIX_COMPILER, which are set on
606 // the command line, the name of platform dependent files to be included.
607 // Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_x86
608 // CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_x86.inline.hpp
609 // OS_CPU_HEADER(vmStructs) --> vmStructs_linux_x86.hpp
610 //
611 // basename<cpu>.hpp / basename<cpu>.inline.hpp
612 #define CPU_HEADER_H(basename) XSTR(CPU_HEADER_STEM(basename).h)
613 #define CPU_HEADER(basename) XSTR(CPU_HEADER_STEM(basename).hpp)
614 #define CPU_HEADER_INLINE(basename) XSTR(CPU_HEADER_STEM(basename).inline.hpp)
615 // basename<os>.hpp / basename<os>.inline.hpp
616 #define OS_HEADER_H(basename) XSTR(OS_HEADER_STEM(basename).h)
617 #define OS_HEADER(basename) XSTR(OS_HEADER_STEM(basename).hpp)
618 #define OS_HEADER_INLINE(basename) XSTR(OS_HEADER_STEM(basename).inline.hpp)
619 // basename<os><cpu>.hpp / basename<os><cpu>.inline.hpp
620 #define OS_CPU_HEADER(basename) XSTR(OS_CPU_HEADER_STEM(basename).hpp)
621 #define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp)
622 // basename<compiler>.hpp / basename<compiler>.inline.hpp
623 #define COMPILER_HEADER(basename) XSTR(COMPILER_HEADER_STEM(basename).hpp)
624 #define COMPILER_HEADER_INLINE(basename) XSTR(COMPILER_HEADER_STEM(basename).inline.hpp)
625
626 #if INCLUDE_CDS && INCLUDE_G1GC && defined(_LP64)
627 #define INCLUDE_CDS_JAVA_HEAP 1
628 #define CDS_JAVA_HEAP_ONLY(x) x
629 #define NOT_CDS_JAVA_HEAP(x)
630 #define NOT_CDS_JAVA_HEAP_RETURN
631 #define NOT_CDS_JAVA_HEAP_RETURN_(code)
632 #else
633 #define INCLUDE_CDS_JAVA_HEAP 0
634 #define CDS_JAVA_HEAP_ONLY(x)
635 #define NOT_CDS_JAVA_HEAP(x) x
636 #define NOT_CDS_JAVA_HEAP_RETURN {}
637 #define NOT_CDS_JAVA_HEAP_RETURN_(code) { return code; }
638 #endif
639
640 #ifdef ADDRESS_SANITIZER
641 #define INCLUDE_ASAN 1
642 #else
643 #define INCLUDE_ASAN 0
644 #endif
645
646 #if defined(AARCH64) || defined(AMD64) || defined(RISCV64)
647 #define PREEMPT_ON_INIT_SUPPORTED_ONLY(code) code
648 #else
649 #define PREEMPT_ON_INIT_SUPPORTED_ONLY(code)
650 #endif
651
652 #endif // SHARE_UTILITIES_MACROS_HPP