1 /*
  2  * Copyright (c) 1997, 2022, 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_(code) { code }
342 #else // PRODUCT
343 #define PRODUCT_ONLY(code)
344 #define NOT_PRODUCT(code) code
345 #define NOT_PRODUCT_ARG(arg) arg,
346 #define PRODUCT_RETURN  /*next token must be ;*/
347 #define PRODUCT_RETURN0 /*next token must be ;*/
348 #define PRODUCT_RETURN_(code)  /*next token must be ;*/
349 #endif // PRODUCT
350 
351 #ifdef CHECK_UNHANDLED_OOPS
352 #define CHECK_UNHANDLED_OOPS_ONLY(code) code
353 #define NOT_CHECK_UNHANDLED_OOPS(code)
354 #else
355 #define CHECK_UNHANDLED_OOPS_ONLY(code)
356 #define NOT_CHECK_UNHANDLED_OOPS(code)  code
357 #endif // CHECK_UNHANDLED_OOPS
358 
359 #ifdef ASSERT
360 #define DEBUG_ONLY(code) code
361 #define NOT_DEBUG(code)
362 #define NOT_DEBUG_RETURN  /*next token must be ;*/
363 // Historical.
364 #define debug_only(code) code
365 #else // ASSERT
366 #define DEBUG_ONLY(code)
367 #define NOT_DEBUG(code) code
368 #define NOT_DEBUG_RETURN {}
369 #define debug_only(code)
370 #endif // ASSERT
371 
372 #ifdef  _LP64
373 #define LP64_ONLY(code) code
374 #define NOT_LP64(code)
375 #else  // !_LP64
376 #define LP64_ONLY(code)
377 #define NOT_LP64(code) code
378 #endif // _LP64
379 
380 #ifdef LINUX
381 #define LINUX_ONLY(code) code
382 #define NOT_LINUX(code)
383 #else
384 #define LINUX_ONLY(code)
385 #define NOT_LINUX(code) code
386 #endif
387 
388 #ifdef __APPLE__
389 #define MACOS_ONLY(code) code
390 #define NOT_MACOS(code)
391 #else
392 #define MACOS_ONLY(code)
393 #define NOT_MACOS(code) code
394 #endif
395 
396 #ifdef AIX
397 #define AIX_ONLY(code) code
398 #define NOT_AIX(code)
399 #else
400 #define AIX_ONLY(code)
401 #define NOT_AIX(code) code
402 #endif
403 
404 #ifdef _WINDOWS
405 #define WINDOWS_ONLY(code) code
406 #define NOT_WINDOWS(code)
407 #else
408 #define WINDOWS_ONLY(code)
409 #define NOT_WINDOWS(code) code
410 #endif
411 
412 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
413 #ifndef BSD
414 #define BSD
415 #endif // BSD defined in <sys/param.h>
416 #define BSD_ONLY(code) code
417 #define NOT_BSD(code)
418 #else
419 #define BSD_ONLY(code)
420 #define NOT_BSD(code) code
421 #endif
422 
423 #ifdef _WIN64
424 #define WIN64_ONLY(code) code
425 #define NOT_WIN64(code)
426 #else
427 #define WIN64_ONLY(code)
428 #define NOT_WIN64(code) code
429 #endif
430 
431 #if defined(ZERO)
432 #define ZERO_ONLY(code) code
433 #define NOT_ZERO(code)
434 #define NOT_ZERO_RETURN {}
435 #else
436 #define ZERO_ONLY(code)
437 #define NOT_ZERO(code) code
438 #define NOT_ZERO_RETURN
439 #endif
440 
441 #if defined(IA32) || defined(AMD64)
442 #define X86
443 #define X86_ONLY(code) code
444 #define NOT_X86(code)
445 #else
446 #undef X86
447 #define X86_ONLY(code)
448 #define NOT_X86(code) code
449 #endif
450 
451 #ifdef IA32
452 #define IA32_ONLY(code) code
453 #define NOT_IA32(code)
454 #else
455 #define IA32_ONLY(code)
456 #define NOT_IA32(code) code
457 #endif
458 
459 // This is a REALLY BIG HACK, but on AIX <sys/systemcfg.h> unconditionally defines IA64.
460 // At least on AIX 7.1 this is a real problem because 'systemcfg.h' is indirectly included
461 // by 'pthread.h' and other common system headers.
462 
463 #if defined(IA64) && !defined(AIX)
464 #define IA64_ONLY(code) code
465 #define NOT_IA64(code)
466 #else
467 #define IA64_ONLY(code)
468 #define NOT_IA64(code) code
469 #endif
470 
471 #ifdef AMD64
472 #define AMD64_ONLY(code) code
473 #define NOT_AMD64(code)
474 #else
475 #define AMD64_ONLY(code)
476 #define NOT_AMD64(code) code
477 #endif
478 
479 #ifdef S390
480 #define S390_ONLY(code) code
481 #define NOT_S390(code)
482 #else
483 #define S390_ONLY(code)
484 #define NOT_S390(code) code
485 #endif
486 
487 #if defined(PPC32) || defined(PPC64)
488 #ifndef PPC
489 #define PPC
490 #endif
491 #define PPC_ONLY(code) code
492 #define NOT_PPC(code)
493 #else
494 #undef PPC
495 #define PPC_ONLY(code)
496 #define NOT_PPC(code) code
497 #endif
498 
499 #ifdef PPC32
500 #define PPC32_ONLY(code) code
501 #define NOT_PPC32(code)
502 #else
503 #define PPC32_ONLY(code)
504 #define NOT_PPC32(code) code
505 #endif
506 
507 #ifdef PPC64
508 #define PPC64_ONLY(code) code
509 #define NOT_PPC64(code)
510 #else
511 #define PPC64_ONLY(code)
512 #define NOT_PPC64(code) code
513 #endif
514 
515 #ifdef E500V2
516 #define E500V2_ONLY(code) code
517 #define NOT_E500V2(code)
518 #else
519 #define E500V2_ONLY(code)
520 #define NOT_E500V2(code) code
521 #endif
522 
523 // Note: There are two ARM ports. They set the following in the makefiles:
524 // 1. 32-bit port:   -DARM -DARM32 -DTARGET_ARCH_arm
525 // 2. 64-bit port:   -DAARCH64 -D_LP64 -DTARGET_ARCH_aarch64
526 #ifdef ARM
527 #define ARM_ONLY(code) code
528 #define NOT_ARM(code)
529 #else
530 #define ARM_ONLY(code)
531 #define NOT_ARM(code) code
532 #endif
533 
534 #ifdef ARM32
535 #define ARM32_ONLY(code) code
536 #define NOT_ARM32(code)
537 #else
538 #define ARM32_ONLY(code)
539 #define NOT_ARM32(code) code
540 #endif
541 
542 #ifdef AARCH64
543 #define AARCH64_ONLY(code) code
544 #define NOT_AARCH64(code)
545 #else
546 #define AARCH64_ONLY(code)
547 #define NOT_AARCH64(code) code
548 #endif
549 
550 #ifdef TARGET_ARCH_aarch64
551 #define AARCH64_PORT_ONLY(code) code
552 #else
553 #define AARCH64_PORT_ONLY(code)
554 #endif
555 
556 #define MACOS_AARCH64_ONLY(x) MACOS_ONLY(AARCH64_ONLY(x))
557 
558 #if defined(RISCV32) || defined(RISCV64)
559 #define RISCV
560 #define RISCV_ONLY(code) code
561 #define NOT_RISCV(code)
562 #else
563 #undef RISCV
564 #define RISCV_ONLY(code)
565 #define NOT_RISCV(code) code
566 #endif
567 
568 #ifdef RISCV32
569 #define RISCV32_ONLY(code) code
570 #define NOT_RISCV32(code)
571 #else
572 #define RISCV32_ONLY(code)
573 #define NOT_RISCV32(code) code
574 #endif
575 
576 #ifdef RISCV64
577 #define RISCV64_ONLY(code) code
578 #define NOT_RISCV64(code)
579 #else
580 #define RISCV64_ONLY(code)
581 #define NOT_RISCV64(code) code
582 #endif
583 
584 #ifdef VM_LITTLE_ENDIAN
585 #define LITTLE_ENDIAN_ONLY(code) code
586 #define BIG_ENDIAN_ONLY(code)
587 #else
588 #define LITTLE_ENDIAN_ONLY(code)
589 #define BIG_ENDIAN_ONLY(code) code
590 #endif
591 
592 #define define_pd_global(type, name, value) const type pd_##name = value;
593 
594 // Helper macros for constructing file names for includes.
595 #define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU)
596 #define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS)
597 #define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU))
598 #define COMPILER_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_COMPILER)
599 
600 // Include platform dependent files.
601 //
602 // This macro constructs from basename and INCLUDE_SUFFIX_OS /
603 // INCLUDE_SUFFIX_CPU / INCLUDE_SUFFIX_COMPILER, which are set on
604 // the command line, the name of platform dependent files to be included.
605 // Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_x86
606 //   CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_x86.inline.hpp
607 //   OS_CPU_HEADER(vmStructs)          --> vmStructs_linux_x86.hpp
608 //
609 // basename<cpu>.hpp / basename<cpu>.inline.hpp
610 #define CPU_HEADER_H(basename)         XSTR(CPU_HEADER_STEM(basename).h)
611 #define CPU_HEADER(basename)           XSTR(CPU_HEADER_STEM(basename).hpp)
612 #define CPU_HEADER_INLINE(basename)    XSTR(CPU_HEADER_STEM(basename).inline.hpp)
613 // basename<os>.hpp / basename<os>.inline.hpp
614 #define OS_HEADER_H(basename)          XSTR(OS_HEADER_STEM(basename).h)
615 #define OS_HEADER(basename)            XSTR(OS_HEADER_STEM(basename).hpp)
616 #define OS_HEADER_INLINE(basename)     XSTR(OS_HEADER_STEM(basename).inline.hpp)
617 // basename<os><cpu>.hpp / basename<os><cpu>.inline.hpp
618 #define OS_CPU_HEADER(basename)        XSTR(OS_CPU_HEADER_STEM(basename).hpp)
619 #define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp)
620 // basename<compiler>.hpp / basename<compiler>.inline.hpp
621 #define COMPILER_HEADER(basename)        XSTR(COMPILER_HEADER_STEM(basename).hpp)
622 #define COMPILER_HEADER_INLINE(basename) XSTR(COMPILER_HEADER_STEM(basename).inline.hpp)
623 
624 #if INCLUDE_CDS && INCLUDE_G1GC && defined(_LP64) && !defined(_WINDOWS)
625 #define INCLUDE_CDS_JAVA_HEAP 1
626 #define CDS_JAVA_HEAP_ONLY(x) x
627 #define NOT_CDS_JAVA_HEAP(x)
628 #define NOT_CDS_JAVA_HEAP_RETURN
629 #define NOT_CDS_JAVA_HEAP_RETURN_(code)
630 #else
631 #define INCLUDE_CDS_JAVA_HEAP 0
632 #define CDS_JAVA_HEAP_ONLY(x)
633 #define NOT_CDS_JAVA_HEAP(x) x
634 #define NOT_CDS_JAVA_HEAP_RETURN        {}
635 #define NOT_CDS_JAVA_HEAP_RETURN_(code) { return code; }
636 #endif
637 
638 #endif // SHARE_UTILITIES_MACROS_HPP