src/share/vm/utilities/macros.hpp

Tue, 03 Aug 2010 08:13:38 -0400

author
bobv
date
Tue, 03 Aug 2010 08:13:38 -0400
changeset 2036
126ea7725993
parent 1907
c18cbe5936b8
child 2047
d2ede61b7a12
permissions
-rw-r--r--

6953477: Increase portability and flexibility of building Hotspot
Summary: A collection of portability improvements including shared code support for PPC, ARM platforms, software floating point, cross compilation support and improvements in error crash detail.
Reviewed-by: phh, never, coleenp, dholmes

     1 /*
     2  * Copyright (c) 1997, 2009, 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  */
    25 // Use this to mark code that needs to be cleaned up (for development only)
    26 #define NEEDS_CLEANUP
    28 // Makes a string of the argument (which is not macro-expanded)
    29 #define STR(a)  #a
    31 // Makes a string of the macro expansion of a
    32 #define XSTR(a) STR(a)
    34 // KERNEL variant
    35 #ifdef KERNEL
    36 #define COMPILER1
    37 #define SERIALGC
    39 #define JVMTI_KERNEL
    40 #define FPROF_KERNEL
    41 #define VM_STRUCTS_KERNEL
    42 #define JNICHECK_KERNEL
    43 #define SERVICES_KERNEL
    45 #define KERNEL_RETURN        {}
    46 #define KERNEL_RETURN_(code) { code }
    48 #else  // KERNEL
    50 #define KERNEL_RETURN        /* next token must be ; */
    51 #define KERNEL_RETURN_(code) /* next token must be ; */
    53 #endif // KERNEL
    55 // COMPILER1 variant
    56 #ifdef COMPILER1
    57 #ifdef COMPILER2
    58   #define TIERED
    59 #endif
    60 #define COMPILER1_PRESENT(code) code
    61 #else // COMPILER1
    62 #define COMPILER1_PRESENT(code)
    63 #endif // COMPILER1
    65 // COMPILER2 variant
    66 #ifdef COMPILER2
    67 #define COMPILER2_PRESENT(code) code
    68 #define NOT_COMPILER2(code)
    69 #else // COMPILER2
    70 #define COMPILER2_PRESENT(code)
    71 #define NOT_COMPILER2(code) code
    72 #endif // COMPILER2
    75 // PRODUCT variant
    76 #ifdef PRODUCT
    77 #define PRODUCT_ONLY(code) code
    78 #define NOT_PRODUCT(code)
    79 #define PRODUCT_RETURN  {}
    80 #define PRODUCT_RETURN0 { return 0; }
    81 #define PRODUCT_RETURN_(code) { code }
    82 #else // PRODUCT
    83 #define PRODUCT_ONLY(code)
    84 #define NOT_PRODUCT(code) code
    85 #define PRODUCT_RETURN  /*next token must be ;*/
    86 #define PRODUCT_RETURN0 /*next token must be ;*/
    87 #define PRODUCT_RETURN_(code)  /*next token must be ;*/
    88 #endif // PRODUCT
    90 #ifdef CHECK_UNHANDLED_OOPS
    91 #define CHECK_UNHANDLED_OOPS_ONLY(code) code
    92 #define NOT_CHECK_UNHANDLED_OOPS(code)
    93 #else
    94 #define CHECK_UNHANDLED_OOPS_ONLY(code)
    95 #define NOT_CHECK_UNHANDLED_OOPS(code)  code
    96 #endif // CHECK_UNHANDLED_OOPS
    98 #ifdef CC_INTERP
    99 #define CC_INTERP_ONLY(code) code
   100 #define NOT_CC_INTERP(code)
   101 #else
   102 #define CC_INTERP_ONLY(code)
   103 #define NOT_CC_INTERP(code) code
   104 #endif // CC_INTERP
   106 #ifdef ASSERT
   107 #define DEBUG_ONLY(code) code
   108 #define NOT_DEBUG(code)
   109 #define NOT_DEBUG_RETURN  /*next token must be ;*/
   110 // Historical.
   111 #define debug_only(code) code
   112 #else // ASSERT
   113 #define DEBUG_ONLY(code)
   114 #define NOT_DEBUG(code) code
   115 #define NOT_DEBUG_RETURN {}
   116 #define debug_only(code)
   117 #endif // ASSERT
   119 #ifdef  _LP64
   120 #define LP64_ONLY(code) code
   121 #define NOT_LP64(code)
   122 #else  // !_LP64
   123 #define LP64_ONLY(code)
   124 #define NOT_LP64(code) code
   125 #endif // _LP64
   127 #ifdef LINUX
   128 #define LINUX_ONLY(code) code
   129 #define NOT_LINUX(code)
   130 #else
   131 #define LINUX_ONLY(code)
   132 #define NOT_LINUX(code) code
   133 #endif
   135 #ifdef SOLARIS
   136 #define SOLARIS_ONLY(code) code
   137 #define NOT_SOLARIS(code)
   138 #else
   139 #define SOLARIS_ONLY(code)
   140 #define NOT_SOLARIS(code) code
   141 #endif
   143 #ifdef _WINDOWS
   144 #define WINDOWS_ONLY(code) code
   145 #define NOT_WINDOWS(code)
   146 #else
   147 #define WINDOWS_ONLY(code)
   148 #define NOT_WINDOWS(code) code
   149 #endif
   151 #if defined(IA32) || defined(AMD64)
   152 #define X86
   153 #define X86_ONLY(code) code
   154 #else
   155 #undef X86
   156 #define X86_ONLY(code)
   157 #endif
   159 #ifdef IA32
   160 #define IA32_ONLY(code) code
   161 #define NOT_IA32(code)
   162 #else
   163 #define IA32_ONLY(code)
   164 #define NOT_IA32(code) code
   165 #endif
   167 #ifdef IA64
   168 #define IA64_ONLY(code) code
   169 #define NOT_IA64(code)
   170 #else
   171 #define IA64_ONLY(code)
   172 #define NOT_IA64(code) code
   173 #endif
   175 #ifdef AMD64
   176 #define AMD64_ONLY(code) code
   177 #define NOT_AMD64(code)
   178 #else
   179 #define AMD64_ONLY(code)
   180 #define NOT_AMD64(code) code
   181 #endif
   183 #ifdef SPARC
   184 #define SPARC_ONLY(code) code
   185 #define NOT_SPARC(code)
   186 #else
   187 #define SPARC_ONLY(code)
   188 #define NOT_SPARC(code) code
   189 #endif
   191 #ifdef PPC
   192 #define PPC_ONLY(code) code
   193 #define NOT_PPC(code)
   194 #else
   195 #define PPC_ONLY(code)
   196 #define NOT_PPC(code) code
   197 #endif
   199 #ifdef E500V2
   200 #define E500V2_ONLY(code) code
   201 #define NOT_E500V2(code)
   202 #else
   203 #define E500V2_ONLY(code)
   204 #define NOT_E500V2(code) code
   205 #endif
   208 #ifdef ARM
   209 #define ARM_ONLY(code) code
   210 #define NOT_ARM(code)
   211 #else
   212 #define ARM_ONLY(code)
   213 #define NOT_ARM(code) code
   214 #endif
   216 #ifdef JAVASE_EMBEDDED
   217 #define EMBEDDED_ONLY(code) code
   218 #define NOT_EMBEDDED(code)
   219 #else
   220 #define EMBEDDED_ONLY(code)
   221 #define NOT_EMBEDDED(code) code
   222 #endif
   224 #define define_pd_global(type, name, value) const type pd_##name = value;

mercurial