2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2019-01-10 15:13:51 -05:00
|
|
|
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-01-10 15:13:51 -05:00
|
|
|
#ifndef SHARE_UTILITIES_MACROS_HPP
|
|
|
|
#define SHARE_UTILITIES_MACROS_HPP
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Use this to mark code that needs to be cleaned up (for development only)
|
|
|
|
#define NEEDS_CLEANUP
|
|
|
|
|
|
|
|
// Makes a string of the argument (which is not macro-expanded)
|
|
|
|
#define STR(a) #a
|
|
|
|
|
|
|
|
// Makes a string of the macro expansion of a
|
|
|
|
#define XSTR(a) STR(a)
|
|
|
|
|
2016-05-25 13:46:05 -04:00
|
|
|
// Allow commas in macro arguments.
|
|
|
|
#define COMMA ,
|
|
|
|
|
2015-06-09 15:05:47 -04:00
|
|
|
// Apply pre-processor token pasting to the expansions of x and y.
|
|
|
|
// The token pasting operator (##) prevents its arguments from being
|
|
|
|
// expanded. This macro allows expansion of its arguments before the
|
|
|
|
// concatenation is performed. Note: One auxilliary level ought to be
|
|
|
|
// sufficient, but two are used because of bugs in some preprocesors.
|
|
|
|
#define PASTE_TOKENS(x, y) PASTE_TOKENS_AUX(x, y)
|
|
|
|
#define PASTE_TOKENS_AUX(x, y) PASTE_TOKENS_AUX2(x, y)
|
|
|
|
#define PASTE_TOKENS_AUX2(x, y) x ## y
|
|
|
|
|
2012-10-10 14:35:58 -04:00
|
|
|
// -DINCLUDE_<something>=0 | 1 can be specified on the command line to include
|
|
|
|
// or exclude functionality.
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2012-10-10 14:35:58 -04:00
|
|
|
#ifndef INCLUDE_JVMTI
|
|
|
|
#define INCLUDE_JVMTI 1
|
|
|
|
#endif // INCLUDE_JVMTI
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2012-10-10 14:35:58 -04:00
|
|
|
#if INCLUDE_JVMTI
|
|
|
|
#define JVMTI_ONLY(x) x
|
|
|
|
#define NOT_JVMTI(x)
|
|
|
|
#define NOT_JVMTI_RETURN
|
|
|
|
#define NOT_JVMTI_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define JVMTI_ONLY(x)
|
|
|
|
#define NOT_JVMTI(x) x
|
|
|
|
#define NOT_JVMTI_RETURN { return; }
|
|
|
|
#define NOT_JVMTI_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_JVMTI
|
|
|
|
|
|
|
|
#ifndef INCLUDE_VM_STRUCTS
|
|
|
|
#define INCLUDE_VM_STRUCTS 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if INCLUDE_VM_STRUCTS
|
|
|
|
#define NOT_VM_STRUCTS_RETURN /* next token must be ; */
|
|
|
|
#define NOT_VM_STRUCTS_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define NOT_VM_STRUCTS_RETURN {}
|
|
|
|
#define NOT_VM_STRUCTS_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_VM_STRUCTS
|
|
|
|
|
|
|
|
#ifndef INCLUDE_JNI_CHECK
|
|
|
|
#define INCLUDE_JNI_CHECK 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if INCLUDE_JNI_CHECK
|
|
|
|
#define NOT_JNI_CHECK_RETURN /* next token must be ; */
|
|
|
|
#define NOT_JNI_CHECK_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define NOT_JNI_CHECK_RETURN {}
|
|
|
|
#define NOT_JNI_CHECK_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_JNI_CHECK
|
|
|
|
|
|
|
|
#ifndef INCLUDE_SERVICES
|
|
|
|
#define INCLUDE_SERVICES 1
|
|
|
|
#endif
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2012-10-10 14:35:58 -04:00
|
|
|
#if INCLUDE_SERVICES
|
|
|
|
#define NOT_SERVICES_RETURN /* next token must be ; */
|
|
|
|
#define NOT_SERVICES_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define NOT_SERVICES_RETURN {}
|
|
|
|
#define NOT_SERVICES_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_SERVICES
|
|
|
|
|
|
|
|
#ifndef INCLUDE_CDS
|
|
|
|
#define INCLUDE_CDS 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if INCLUDE_CDS
|
|
|
|
#define CDS_ONLY(x) x
|
|
|
|
#define NOT_CDS(x)
|
|
|
|
#define NOT_CDS_RETURN /* next token must be ; */
|
2018-04-11 13:52:23 +02:00
|
|
|
#define NOT_CDS_RETURN0 /* next token must be ; */
|
2012-10-10 14:35:58 -04:00
|
|
|
#define NOT_CDS_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define CDS_ONLY(x)
|
|
|
|
#define NOT_CDS(x) x
|
2018-04-11 13:52:23 +02:00
|
|
|
#define NOT_CDS_RETURN {}
|
|
|
|
#define NOT_CDS_RETURN0 { return 0; }
|
2012-10-10 14:35:58 -04:00
|
|
|
#define NOT_CDS_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_CDS
|
|
|
|
|
|
|
|
#ifndef INCLUDE_MANAGEMENT
|
|
|
|
#define INCLUDE_MANAGEMENT 1
|
|
|
|
#endif // INCLUDE_MANAGEMENT
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2012-10-10 14:35:58 -04:00
|
|
|
#if INCLUDE_MANAGEMENT
|
|
|
|
#define NOT_MANAGEMENT_RETURN /* next token must be ; */
|
|
|
|
#define NOT_MANAGEMENT_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define NOT_MANAGEMENT_RETURN {}
|
|
|
|
#define NOT_MANAGEMENT_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_MANAGEMENT
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2018-05-04 11:41:35 +02:00
|
|
|
#ifndef INCLUDE_CMSGC
|
|
|
|
#define INCLUDE_CMSGC 1
|
|
|
|
#endif // INCLUDE_CMSGC
|
|
|
|
|
|
|
|
#if INCLUDE_CMSGC
|
|
|
|
#define CMSGC_ONLY(x) x
|
|
|
|
#define CMSGC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_CMSGC(x)
|
|
|
|
#define NOT_CMSGC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_CMSGC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define CMSGC_ONLY(x)
|
|
|
|
#define CMSGC_ONLY_ARG(x)
|
|
|
|
#define NOT_CMSGC(x) x
|
|
|
|
#define NOT_CMSGC_RETURN {}
|
|
|
|
#define NOT_CMSGC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_CMSGC
|
|
|
|
|
2018-06-12 15:03:00 +02:00
|
|
|
#ifndef INCLUDE_EPSILONGC
|
|
|
|
#define INCLUDE_EPSILONGC 1
|
|
|
|
#endif // INCLUDE_EPSILONGC
|
|
|
|
|
|
|
|
#if INCLUDE_EPSILONGC
|
|
|
|
#define EPSILONGC_ONLY(x) x
|
|
|
|
#define EPSILONGC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_EPSILONGC(x)
|
|
|
|
#define NOT_EPSILONGC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_EPSILONGC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define EPSILONGC_ONLY(x)
|
|
|
|
#define EPSILONGC_ONLY_ARG(arg)
|
|
|
|
#define NOT_EPSILONGC(x) x
|
|
|
|
#define NOT_EPSILONGC_RETURN {}
|
|
|
|
#define NOT_EPSILONGC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_EPSILONGC
|
|
|
|
|
2018-05-04 11:41:35 +02:00
|
|
|
#ifndef INCLUDE_G1GC
|
|
|
|
#define INCLUDE_G1GC 1
|
|
|
|
#endif // INCLUDE_G1GC
|
|
|
|
|
|
|
|
#if INCLUDE_G1GC
|
|
|
|
#define G1GC_ONLY(x) x
|
|
|
|
#define G1GC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_G1GC(x)
|
|
|
|
#define NOT_G1GC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_G1GC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define G1GC_ONLY(x)
|
|
|
|
#define G1GC_ONLY_ARG(arg)
|
|
|
|
#define NOT_G1GC(x) x
|
|
|
|
#define NOT_G1GC_RETURN {}
|
|
|
|
#define NOT_G1GC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_G1GC
|
|
|
|
|
|
|
|
#ifndef INCLUDE_PARALLELGC
|
|
|
|
#define INCLUDE_PARALLELGC 1
|
|
|
|
#endif // INCLUDE_PARALLELGC
|
|
|
|
|
|
|
|
#if INCLUDE_PARALLELGC
|
|
|
|
#define PARALLELGC_ONLY(x) x
|
|
|
|
#define PARALLELGC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_PARALLELGC(x)
|
|
|
|
#define NOT_PARALLELGC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_PARALLELGC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define PARALLELGC_ONLY(x)
|
|
|
|
#define PARALLELGC_ONLY_ARG(arg)
|
|
|
|
#define NOT_PARALLELGC(x) x
|
|
|
|
#define NOT_PARALLELGC_RETURN {}
|
|
|
|
#define NOT_PARALLELGC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_PARALLELGC
|
|
|
|
|
|
|
|
#ifndef INCLUDE_SERIALGC
|
|
|
|
#define INCLUDE_SERIALGC 1
|
|
|
|
#endif // INCLUDE_SERIALGC
|
|
|
|
|
|
|
|
#if INCLUDE_SERIALGC
|
|
|
|
#define SERIALGC_ONLY(x) x
|
|
|
|
#define SERIALGC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_SERIALGC(x)
|
|
|
|
#define NOT_SERIALGC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_SERIALGC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define SERIALGC_ONLY(x)
|
|
|
|
#define SERIALGC_ONLY_ARG(arg)
|
|
|
|
#define NOT_SERIALGC(x) x
|
|
|
|
#define NOT_SERIALGC_RETURN {}
|
|
|
|
#define NOT_SERIALGC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_SERIALGC
|
|
|
|
|
2018-12-10 15:47:44 +01:00
|
|
|
#ifndef INCLUDE_SHENANDOAHGC
|
|
|
|
#define INCLUDE_SHENANDOAHGC 1
|
|
|
|
#endif // INCLUDE_SHENANDOAHGC
|
|
|
|
|
|
|
|
#if INCLUDE_SHENANDOAHGC
|
|
|
|
#define SHENANDOAHGC_ONLY(x) x
|
|
|
|
#define SHENANDOAHGC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_SHENANDOAHGC(x)
|
|
|
|
#define NOT_SHENANDOAHGC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_SHENANDOAHGC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define SHENANDOAHGC_ONLY(x)
|
|
|
|
#define SHENANDOAHGC_ONLY_ARG(arg)
|
|
|
|
#define NOT_SHENANDOAHGC(x) x
|
|
|
|
#define NOT_SHENANDOAHGC_RETURN {}
|
|
|
|
#define NOT_SHENANDOAHGC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_SHENANDOAHGC
|
|
|
|
|
8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Erik Osterlund <erik.osterlund@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Kim Barrett <kim.barrett@oracle.com>
Co-authored-by: Nils Eliasson <nils.eliasson@oracle.com>
Co-authored-by: Rickard Backman <rickard.backman@oracle.com>
Co-authored-by: Roland Westrelin <rwestrel@redhat.com>
Co-authored-by: Coleen Phillimore <coleen.phillimore@oracle.com>
Co-authored-by: Robbin Ehn <robbin.ehn@oracle.com>
Co-authored-by: Gerard Ziemski <gerard.ziemski@oracle.com>
Co-authored-by: Hugh Wilkinson <hugh.wilkinson@intel.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Co-authored-by: Bill Wheeler <bill.npo.wheeler@intel.com>
Co-authored-by: Vinay K. Awasthi <vinay.k.awasthi@intel.com>
Co-authored-by: Yasumasa Suenaga <yasuenag@gmail.com>
Reviewed-by: pliden, stefank, eosterlund, ehelin, sjohanss, rbackman, coleenp, ihse, jgeorge, lmesnik, rkennke
2018-06-12 17:40:28 +02:00
|
|
|
#ifndef INCLUDE_ZGC
|
|
|
|
#define INCLUDE_ZGC 1
|
|
|
|
#endif // INCLUDE_ZGC
|
|
|
|
|
|
|
|
#if INCLUDE_ZGC
|
|
|
|
#define ZGC_ONLY(x) x
|
|
|
|
#define ZGC_ONLY_ARG(arg) arg,
|
|
|
|
#define NOT_ZGC(x)
|
|
|
|
#define NOT_ZGC_RETURN /* next token must be ; */
|
|
|
|
#define NOT_ZGC_RETURN_(code) /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define ZGC_ONLY(x)
|
|
|
|
#define ZGC_ONLY_ARG(arg)
|
|
|
|
#define NOT_ZGC(x) x
|
|
|
|
#define NOT_ZGC_RETURN {}
|
|
|
|
#define NOT_ZGC_RETURN_(code) { return code; }
|
|
|
|
#endif // INCLUDE_ZGC
|
|
|
|
|
2012-10-10 14:35:58 -04:00
|
|
|
#ifndef INCLUDE_NMT
|
|
|
|
#define INCLUDE_NMT 1
|
|
|
|
#endif // INCLUDE_NMT
|
|
|
|
|
|
|
|
#if INCLUDE_NMT
|
|
|
|
#define NOT_NMT_RETURN /* next token must be ; */
|
|
|
|
#define NOT_NMT_RETURN_(code) /* next token must be ; */
|
2018-05-05 18:55:31 +02:00
|
|
|
#define NMT_ONLY(x) x
|
|
|
|
#define NOT_NMT(x)
|
2012-10-10 14:35:58 -04:00
|
|
|
#else
|
|
|
|
#define NOT_NMT_RETURN {}
|
|
|
|
#define NOT_NMT_RETURN_(code) { return code; }
|
2018-05-05 18:55:31 +02:00
|
|
|
#define NMT_ONLY(x)
|
|
|
|
#define NOT_NMT(x) x
|
2012-10-10 14:35:58 -04:00
|
|
|
#endif // INCLUDE_NMT
|
2007-12-01 00:00:00 +00:00
|
|
|
|
2018-05-15 20:24:34 +02:00
|
|
|
#ifndef INCLUDE_JFR
|
|
|
|
#define INCLUDE_JFR 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if INCLUDE_JFR
|
|
|
|
#define JFR_ONLY(code) code
|
2019-04-18 07:02:07 -04:00
|
|
|
#define NOT_JFR_RETURN_(code) /* next token must be ; */
|
2018-05-15 20:24:34 +02:00
|
|
|
#else
|
|
|
|
#define JFR_ONLY(code)
|
2019-04-18 07:02:07 -04:00
|
|
|
#define NOT_JFR_RETURN_(code) { return code; }
|
2018-05-15 20:24:34 +02:00
|
|
|
#endif
|
2013-06-10 11:30:51 +02:00
|
|
|
|
2015-10-08 12:49:30 -10:00
|
|
|
#ifndef INCLUDE_JVMCI
|
|
|
|
#define INCLUDE_JVMCI 1
|
|
|
|
#endif
|
|
|
|
|
2018-05-03 09:07:40 -07:00
|
|
|
#ifndef INCLUDE_AOT
|
|
|
|
#define INCLUDE_AOT 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if INCLUDE_AOT && !INCLUDE_JVMCI
|
|
|
|
# error "Must have JVMCI for AOT"
|
2016-12-11 19:07:04 -08:00
|
|
|
#endif
|
|
|
|
|
2015-10-08 12:49:30 -10:00
|
|
|
#if INCLUDE_JVMCI
|
|
|
|
#define JVMCI_ONLY(code) code
|
|
|
|
#define NOT_JVMCI(code)
|
|
|
|
#define NOT_JVMCI_RETURN /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define JVMCI_ONLY(code)
|
|
|
|
#define NOT_JVMCI(code) code
|
|
|
|
#define NOT_JVMCI_RETURN {}
|
|
|
|
#endif // INCLUDE_JVMCI
|
|
|
|
|
2016-12-11 19:07:04 -08:00
|
|
|
#if INCLUDE_AOT
|
|
|
|
#define AOT_ONLY(code) code
|
|
|
|
#define NOT_AOT(code)
|
|
|
|
#define NOT_AOT_RETURN /* next token must be ; */
|
|
|
|
#else
|
|
|
|
#define AOT_ONLY(code)
|
|
|
|
#define NOT_AOT(code) code
|
|
|
|
#define NOT_AOT_RETURN {}
|
|
|
|
#endif // INCLUDE_AOT
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// COMPILER1 variant
|
|
|
|
#ifdef COMPILER1
|
|
|
|
#ifdef COMPILER2
|
|
|
|
#define TIERED
|
|
|
|
#endif
|
|
|
|
#define COMPILER1_PRESENT(code) code
|
2018-04-26 20:42:43 +02:00
|
|
|
#define NOT_COMPILER1(code)
|
2007-12-01 00:00:00 +00:00
|
|
|
#else // COMPILER1
|
|
|
|
#define COMPILER1_PRESENT(code)
|
2018-04-26 20:42:43 +02:00
|
|
|
#define NOT_COMPILER1(code) code
|
2007-12-01 00:00:00 +00:00
|
|
|
#endif // COMPILER1
|
|
|
|
|
|
|
|
// COMPILER2 variant
|
|
|
|
#ifdef COMPILER2
|
|
|
|
#define COMPILER2_PRESENT(code) code
|
2008-11-20 16:56:09 -08:00
|
|
|
#define NOT_COMPILER2(code)
|
2007-12-01 00:00:00 +00:00
|
|
|
#else // COMPILER2
|
|
|
|
#define COMPILER2_PRESENT(code)
|
2008-11-20 16:56:09 -08:00
|
|
|
#define NOT_COMPILER2(code) code
|
2007-12-01 00:00:00 +00:00
|
|
|
#endif // COMPILER2
|
|
|
|
|
2016-03-30 09:52:02 -07:00
|
|
|
// COMPILER2 or JVMCI
|
|
|
|
#if defined(COMPILER2) || INCLUDE_JVMCI
|
|
|
|
#define COMPILER2_OR_JVMCI 1
|
|
|
|
#define COMPILER2_OR_JVMCI_PRESENT(code) code
|
|
|
|
#define NOT_COMPILER2_OR_JVMCI(code)
|
|
|
|
#else
|
|
|
|
#define COMPILER2_OR_JVMCI 0
|
|
|
|
#define COMPILER2_OR_JVMCI_PRESENT(code)
|
|
|
|
#define NOT_COMPILER2_OR_JVMCI(code) code
|
|
|
|
#endif
|
|
|
|
|
2010-09-03 17:51:07 -07:00
|
|
|
#ifdef TIERED
|
|
|
|
#define TIERED_ONLY(code) code
|
|
|
|
#define NOT_TIERED(code)
|
2015-10-08 12:49:30 -10:00
|
|
|
#else // TIERED
|
2010-09-03 17:51:07 -07:00
|
|
|
#define TIERED_ONLY(code)
|
|
|
|
#define NOT_TIERED(code) code
|
|
|
|
#endif // TIERED
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// PRODUCT variant
|
|
|
|
#ifdef PRODUCT
|
|
|
|
#define PRODUCT_ONLY(code) code
|
|
|
|
#define NOT_PRODUCT(code)
|
2010-08-31 03:14:00 -07:00
|
|
|
#define NOT_PRODUCT_ARG(arg)
|
2007-12-01 00:00:00 +00:00
|
|
|
#define PRODUCT_RETURN {}
|
|
|
|
#define PRODUCT_RETURN0 { return 0; }
|
|
|
|
#define PRODUCT_RETURN_(code) { code }
|
|
|
|
#else // PRODUCT
|
|
|
|
#define PRODUCT_ONLY(code)
|
|
|
|
#define NOT_PRODUCT(code) code
|
2010-08-31 03:14:00 -07:00
|
|
|
#define NOT_PRODUCT_ARG(arg) arg,
|
2007-12-01 00:00:00 +00:00
|
|
|
#define PRODUCT_RETURN /*next token must be ;*/
|
|
|
|
#define PRODUCT_RETURN0 /*next token must be ;*/
|
|
|
|
#define PRODUCT_RETURN_(code) /*next token must be ;*/
|
|
|
|
#endif // PRODUCT
|
|
|
|
|
|
|
|
#ifdef CHECK_UNHANDLED_OOPS
|
|
|
|
#define CHECK_UNHANDLED_OOPS_ONLY(code) code
|
|
|
|
#define NOT_CHECK_UNHANDLED_OOPS(code)
|
|
|
|
#else
|
|
|
|
#define CHECK_UNHANDLED_OOPS_ONLY(code)
|
|
|
|
#define NOT_CHECK_UNHANDLED_OOPS(code) code
|
|
|
|
#endif // CHECK_UNHANDLED_OOPS
|
|
|
|
|
|
|
|
#ifdef CC_INTERP
|
|
|
|
#define CC_INTERP_ONLY(code) code
|
|
|
|
#define NOT_CC_INTERP(code)
|
|
|
|
#else
|
|
|
|
#define CC_INTERP_ONLY(code)
|
|
|
|
#define NOT_CC_INTERP(code) code
|
|
|
|
#endif // CC_INTERP
|
|
|
|
|
|
|
|
#ifdef ASSERT
|
|
|
|
#define DEBUG_ONLY(code) code
|
|
|
|
#define NOT_DEBUG(code)
|
2009-06-11 13:31:01 -07:00
|
|
|
#define NOT_DEBUG_RETURN /*next token must be ;*/
|
2007-12-01 00:00:00 +00:00
|
|
|
// Historical.
|
|
|
|
#define debug_only(code) code
|
|
|
|
#else // ASSERT
|
|
|
|
#define DEBUG_ONLY(code)
|
|
|
|
#define NOT_DEBUG(code) code
|
2009-06-11 13:31:01 -07:00
|
|
|
#define NOT_DEBUG_RETURN {}
|
2007-12-01 00:00:00 +00:00
|
|
|
#define debug_only(code)
|
|
|
|
#endif // ASSERT
|
|
|
|
|
|
|
|
#ifdef _LP64
|
|
|
|
#define LP64_ONLY(code) code
|
|
|
|
#define NOT_LP64(code)
|
|
|
|
#else // !_LP64
|
|
|
|
#define LP64_ONLY(code)
|
|
|
|
#define NOT_LP64(code) code
|
|
|
|
#endif // _LP64
|
|
|
|
|
|
|
|
#ifdef LINUX
|
|
|
|
#define LINUX_ONLY(code) code
|
|
|
|
#define NOT_LINUX(code)
|
|
|
|
#else
|
|
|
|
#define LINUX_ONLY(code)
|
|
|
|
#define NOT_LINUX(code) code
|
|
|
|
#endif
|
|
|
|
|
2013-08-22 09:39:54 -07:00
|
|
|
#ifdef AIX
|
|
|
|
#define AIX_ONLY(code) code
|
|
|
|
#define NOT_AIX(code)
|
|
|
|
#else
|
|
|
|
#define AIX_ONLY(code)
|
|
|
|
#define NOT_AIX(code) code
|
|
|
|
#endif
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
#ifdef SOLARIS
|
|
|
|
#define SOLARIS_ONLY(code) code
|
|
|
|
#define NOT_SOLARIS(code)
|
|
|
|
#else
|
|
|
|
#define SOLARIS_ONLY(code)
|
|
|
|
#define NOT_SOLARIS(code) code
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WINDOWS
|
|
|
|
#define WINDOWS_ONLY(code) code
|
|
|
|
#define NOT_WINDOWS(code)
|
|
|
|
#else
|
|
|
|
#define WINDOWS_ONLY(code)
|
|
|
|
#define NOT_WINDOWS(code) code
|
|
|
|
#endif
|
|
|
|
|
2011-09-25 16:03:29 -07:00
|
|
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
|
2017-10-31 11:55:09 -04:00
|
|
|
#ifndef BSD
|
2016-07-13 12:23:05 +02:00
|
|
|
#define BSD
|
2017-10-31 11:55:09 -04:00
|
|
|
#endif // BSD defined in <sys/param.h>
|
2011-09-25 16:03:29 -07:00
|
|
|
#define BSD_ONLY(code) code
|
|
|
|
#define NOT_BSD(code)
|
|
|
|
#else
|
|
|
|
#define BSD_ONLY(code)
|
|
|
|
#define NOT_BSD(code) code
|
|
|
|
#endif
|
|
|
|
|
2011-02-28 06:07:12 -08:00
|
|
|
#ifdef _WIN64
|
|
|
|
#define WIN64_ONLY(code) code
|
|
|
|
#define NOT_WIN64(code)
|
|
|
|
#else
|
|
|
|
#define WIN64_ONLY(code)
|
|
|
|
#define NOT_WIN64(code) code
|
|
|
|
#endif
|
|
|
|
|
2012-10-29 11:08:48 -07:00
|
|
|
#if defined(ZERO)
|
|
|
|
#define ZERO_ONLY(code) code
|
|
|
|
#define NOT_ZERO(code)
|
|
|
|
#else
|
|
|
|
#define ZERO_ONLY(code)
|
|
|
|
#define NOT_ZERO(code) code
|
|
|
|
#endif
|
|
|
|
|
2008-08-27 00:21:55 -07:00
|
|
|
#if defined(IA32) || defined(AMD64)
|
|
|
|
#define X86
|
|
|
|
#define X86_ONLY(code) code
|
2010-08-11 05:51:21 -07:00
|
|
|
#define NOT_X86(code)
|
2008-08-27 00:21:55 -07:00
|
|
|
#else
|
|
|
|
#undef X86
|
|
|
|
#define X86_ONLY(code)
|
2010-08-11 05:51:21 -07:00
|
|
|
#define NOT_X86(code) code
|
2008-08-27 00:21:55 -07:00
|
|
|
#endif
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
#ifdef IA32
|
|
|
|
#define IA32_ONLY(code) code
|
|
|
|
#define NOT_IA32(code)
|
|
|
|
#else
|
|
|
|
#define IA32_ONLY(code)
|
|
|
|
#define NOT_IA32(code) code
|
|
|
|
#endif
|
|
|
|
|
2013-07-05 22:17:47 +02:00
|
|
|
// This is a REALLY BIG HACK, but on AIX <sys/systemcfg.h> unconditionally defines IA64.
|
|
|
|
// At least on AIX 7.1 this is a real problem because 'systemcfg.h' is indirectly included
|
|
|
|
// by 'pthread.h' and other common system headers.
|
|
|
|
|
|
|
|
#if defined(IA64) && !defined(AIX)
|
2007-12-01 00:00:00 +00:00
|
|
|
#define IA64_ONLY(code) code
|
|
|
|
#define NOT_IA64(code)
|
|
|
|
#else
|
|
|
|
#define IA64_ONLY(code)
|
|
|
|
#define NOT_IA64(code) code
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef AMD64
|
|
|
|
#define AMD64_ONLY(code) code
|
|
|
|
#define NOT_AMD64(code)
|
|
|
|
#else
|
|
|
|
#define AMD64_ONLY(code)
|
|
|
|
#define NOT_AMD64(code) code
|
|
|
|
#endif
|
|
|
|
|
2016-09-22 18:23:15 +02:00
|
|
|
#ifdef S390
|
|
|
|
#define S390_ONLY(code) code
|
|
|
|
#define NOT_S390(code)
|
|
|
|
#else
|
|
|
|
#define S390_ONLY(code)
|
|
|
|
#define NOT_S390(code) code
|
|
|
|
#endif
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
#ifdef SPARC
|
|
|
|
#define SPARC_ONLY(code) code
|
|
|
|
#define NOT_SPARC(code)
|
|
|
|
#else
|
|
|
|
#define SPARC_ONLY(code)
|
|
|
|
#define NOT_SPARC(code) code
|
|
|
|
#endif
|
|
|
|
|
2013-06-19 12:29:30 +02:00
|
|
|
#if defined(PPC32) || defined(PPC64)
|
|
|
|
#ifndef PPC
|
|
|
|
#define PPC
|
|
|
|
#endif
|
2010-08-03 08:13:38 -04:00
|
|
|
#define PPC_ONLY(code) code
|
|
|
|
#define NOT_PPC(code)
|
|
|
|
#else
|
2013-06-19 12:29:30 +02:00
|
|
|
#undef PPC
|
2010-08-03 08:13:38 -04:00
|
|
|
#define PPC_ONLY(code)
|
|
|
|
#define NOT_PPC(code) code
|
|
|
|
#endif
|
|
|
|
|
2013-06-19 12:29:30 +02:00
|
|
|
#ifdef PPC32
|
|
|
|
#define PPC32_ONLY(code) code
|
|
|
|
#define NOT_PPC32(code)
|
|
|
|
#else
|
|
|
|
#define PPC32_ONLY(code)
|
|
|
|
#define NOT_PPC32(code) code
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PPC64
|
|
|
|
#define PPC64_ONLY(code) code
|
|
|
|
#define NOT_PPC64(code)
|
|
|
|
#else
|
|
|
|
#define PPC64_ONLY(code)
|
|
|
|
#define NOT_PPC64(code) code
|
|
|
|
#endif
|
|
|
|
|
2010-08-03 08:13:38 -04:00
|
|
|
#ifdef E500V2
|
|
|
|
#define E500V2_ONLY(code) code
|
|
|
|
#define NOT_E500V2(code)
|
|
|
|
#else
|
|
|
|
#define E500V2_ONLY(code)
|
|
|
|
#define NOT_E500V2(code) code
|
|
|
|
#endif
|
|
|
|
|
2018-10-30 10:39:19 -04:00
|
|
|
// Note: There are two ARM ports. They set the following in the makefiles:
|
|
|
|
// 1. 32-bit port: -DARM -DARM32 -DTARGET_ARCH_arm
|
|
|
|
// 2. 64-bit port: -DAARCH64 -D_LP64 -DTARGET_ARCH_aaarch64
|
2010-08-03 08:13:38 -04:00
|
|
|
#ifdef ARM
|
|
|
|
#define ARM_ONLY(code) code
|
|
|
|
#define NOT_ARM(code)
|
|
|
|
#else
|
|
|
|
#define ARM_ONLY(code)
|
|
|
|
#define NOT_ARM(code) code
|
|
|
|
#endif
|
|
|
|
|
2015-02-24 17:23:53 -05:00
|
|
|
#ifdef ARM32
|
|
|
|
#define ARM32_ONLY(code) code
|
|
|
|
#define NOT_ARM32(code)
|
|
|
|
#else
|
|
|
|
#define ARM32_ONLY(code)
|
|
|
|
#define NOT_ARM32(code) code
|
|
|
|
#endif
|
|
|
|
|
2014-12-11 13:11:53 -08:00
|
|
|
#ifdef AARCH64
|
|
|
|
#define AARCH64_ONLY(code) code
|
|
|
|
#define NOT_AARCH64(code)
|
|
|
|
#else
|
|
|
|
#define AARCH64_ONLY(code)
|
|
|
|
#define NOT_AARCH64(code) code
|
|
|
|
#endif
|
|
|
|
|
2018-07-04 09:21:19 +02:00
|
|
|
#ifdef VM_LITTLE_ENDIAN
|
|
|
|
#define LITTLE_ENDIAN_ONLY(code) code
|
|
|
|
#define BIG_ENDIAN_ONLY(code)
|
|
|
|
#else
|
|
|
|
#define LITTLE_ENDIAN_ONLY(code)
|
|
|
|
#define BIG_ENDIAN_ONLY(code) code
|
|
|
|
#endif
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
#define define_pd_global(type, name, value) const type pd_##name = value;
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2016-07-13 12:23:05 +02:00
|
|
|
// Helper macros for constructing file names for includes.
|
|
|
|
#define CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_CPU)
|
|
|
|
#define OS_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_OS)
|
|
|
|
#define OS_CPU_HEADER_STEM(basename) PASTE_TOKENS(basename, PASTE_TOKENS(INCLUDE_SUFFIX_OS, INCLUDE_SUFFIX_CPU))
|
2017-06-22 20:47:22 -04:00
|
|
|
#define COMPILER_HEADER_STEM(basename) PASTE_TOKENS(basename, INCLUDE_SUFFIX_COMPILER)
|
2016-07-13 12:23:05 +02:00
|
|
|
|
|
|
|
// Include platform dependent files.
|
|
|
|
//
|
|
|
|
// This macro constructs from basename and INCLUDE_SUFFIX_OS /
|
2017-06-22 20:47:22 -04:00
|
|
|
// INCLUDE_SUFFIX_CPU / INCLUDE_SUFFIX_COMPILER, which are set on
|
|
|
|
// the command line, the name of platform dependent files to be included.
|
2016-07-13 12:23:05 +02:00
|
|
|
// Example: INCLUDE_SUFFIX_OS=_linux / INCLUDE_SUFFIX_CPU=_sparc
|
|
|
|
// CPU_HEADER_INLINE(macroAssembler) --> macroAssembler_sparc.inline.hpp
|
|
|
|
// OS_CPU_HEADER(vmStructs) --> vmStructs_linux_sparc.hpp
|
|
|
|
//
|
|
|
|
// basename<cpu>.hpp / basename<cpu>.inline.hpp
|
|
|
|
#define CPU_HEADER_H(basename) XSTR(CPU_HEADER_STEM(basename).h)
|
|
|
|
#define CPU_HEADER(basename) XSTR(CPU_HEADER_STEM(basename).hpp)
|
|
|
|
#define CPU_HEADER_INLINE(basename) XSTR(CPU_HEADER_STEM(basename).inline.hpp)
|
|
|
|
// basename<os>.hpp / basename<os>.inline.hpp
|
|
|
|
#define OS_HEADER_H(basename) XSTR(OS_HEADER_STEM(basename).h)
|
|
|
|
#define OS_HEADER(basename) XSTR(OS_HEADER_STEM(basename).hpp)
|
|
|
|
#define OS_HEADER_INLINE(basename) XSTR(OS_HEADER_STEM(basename).inline.hpp)
|
|
|
|
// basename<os><cpu>.hpp / basename<os><cpu>.inline.hpp
|
|
|
|
#define OS_CPU_HEADER(basename) XSTR(OS_CPU_HEADER_STEM(basename).hpp)
|
|
|
|
#define OS_CPU_HEADER_INLINE(basename) XSTR(OS_CPU_HEADER_STEM(basename).inline.hpp)
|
2017-06-22 20:47:22 -04:00
|
|
|
// basename<compiler>.hpp / basename<compiler>.inline.hpp
|
|
|
|
#define COMPILER_HEADER(basename) XSTR(COMPILER_HEADER_STEM(basename).hpp)
|
|
|
|
#define COMPILER_HEADER_INLINE(basename) XSTR(COMPILER_HEADER_STEM(basename).inline.hpp)
|
2016-07-13 12:23:05 +02:00
|
|
|
|
2018-05-04 11:41:35 +02:00
|
|
|
#if INCLUDE_CDS && INCLUDE_G1GC && defined(_LP64) && !defined(_WINDOWS)
|
2017-08-14 14:32:17 -04:00
|
|
|
#define INCLUDE_CDS_JAVA_HEAP 1
|
|
|
|
#define CDS_JAVA_HEAP_ONLY(x) x
|
|
|
|
#define NOT_CDS_JAVA_HEAP(x)
|
|
|
|
#define NOT_CDS_JAVA_HEAP_RETURN
|
|
|
|
#define NOT_CDS_JAVA_HEAP_RETURN_(code)
|
|
|
|
#else
|
|
|
|
#define INCLUDE_CDS_JAVA_HEAP 0
|
|
|
|
#define CDS_JAVA_HEAP_ONLY(x)
|
|
|
|
#define NOT_CDS_JAVA_HEAP(x) x
|
|
|
|
#define NOT_CDS_JAVA_HEAP_RETURN {}
|
|
|
|
#define NOT_CDS_JAVA_HEAP_RETURN_(code) { return code; }
|
|
|
|
#endif
|
|
|
|
|
2019-01-10 15:13:51 -05:00
|
|
|
#endif // SHARE_UTILITIES_MACROS_HPP
|