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