hotspot/src/share/vm/utilities/macros.hpp
author never
Wed, 27 Aug 2008 00:21:55 -0700
changeset 1066 717c3345024f
parent 1 489c9b5090e2
child 1217 5eb97f366a6a
permissions -rw-r--r--
5108146: Merge i486 and amd64 cpu directories 6459804: Want client (c1) compiler for x86_64 (amd64) for faster start-up Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
// Use this to mark code that needs to be cleaned up (for development only)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
#define NEEDS_CLEANUP
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// Makes a string of the argument (which is not macro-expanded)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
#define STR(a)  #a
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// Makes a string of the macro expansion of a
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
#define XSTR(a) STR(a)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// KERNEL variant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
#ifdef KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
#define COMPILER1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
#define SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
#define JVMTI_KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
#define FPROF_KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
#define VM_STRUCTS_KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
#define JNICHECK_KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
#define SERVICES_KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
#define KERNEL_RETURN        {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
#define KERNEL_RETURN_(code) { code }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
#else  // KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
#define KERNEL_RETURN        /* next token must be ; */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
#define KERNEL_RETURN_(code) /* next token must be ; */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
#endif // KERNEL
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
// COMPILER1 variant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
#ifdef COMPILER1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
#ifdef COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  #define TIERED
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
#define COMPILER1_PRESENT(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
#else // COMPILER1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
#define COMPILER1_PRESENT(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
#endif // COMPILER1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
// COMPILER2 variant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
#ifdef COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
#define COMPILER2_PRESENT(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
#else // COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
#define COMPILER2_PRESENT(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
#endif // COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
// PRODUCT variant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
#define PRODUCT_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
#define NOT_PRODUCT(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
#define PRODUCT_RETURN  {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
#define PRODUCT_RETURN0 { return 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
#define PRODUCT_RETURN_(code) { code }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
#else // PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
#define PRODUCT_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
#define NOT_PRODUCT(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
#define PRODUCT_RETURN  /*next token must be ;*/
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
#define PRODUCT_RETURN0 /*next token must be ;*/
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
#define PRODUCT_RETURN_(code)  /*next token must be ;*/
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
#endif // PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
#ifdef CHECK_UNHANDLED_OOPS
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
#define CHECK_UNHANDLED_OOPS_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
#define NOT_CHECK_UNHANDLED_OOPS(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
#define CHECK_UNHANDLED_OOPS_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
#define NOT_CHECK_UNHANDLED_OOPS(code)  code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
#endif // CHECK_UNHANDLED_OOPS
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
#ifdef CC_INTERP
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
#define CC_INTERP_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
#define NOT_CC_INTERP(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
#define CC_INTERP_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
#define NOT_CC_INTERP(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
#endif // CC_INTERP
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
#define DEBUG_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
#define NOT_DEBUG(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
// Historical.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
#define debug_only(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
#else // ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
#define DEBUG_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
#define NOT_DEBUG(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
#define debug_only(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
#endif // ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
#ifdef  _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
#define LP64_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
#define NOT_LP64(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
#else  // !_LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
#define LP64_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
#define NOT_LP64(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
#endif // _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
#ifdef LINUX
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
#define LINUX_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
#define NOT_LINUX(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
#define LINUX_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
#define NOT_LINUX(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
#ifdef SOLARIS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
#define SOLARIS_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
#define NOT_SOLARIS(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
#define SOLARIS_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
#define NOT_SOLARIS(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
#ifdef _WINDOWS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
#define WINDOWS_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
#define NOT_WINDOWS(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
#define WINDOWS_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
#define NOT_WINDOWS(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
1066
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   147
#if defined(IA32) || defined(AMD64)
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   148
#define X86
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   149
#define X86_ONLY(code) code
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   150
#else
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   151
#undef X86
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   152
#define X86_ONLY(code)
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   153
#endif
717c3345024f 5108146: Merge i486 and amd64 cpu directories
never
parents: 1
diff changeset
   154
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
#ifdef IA32
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
#define IA32_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
#define NOT_IA32(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
#define IA32_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
#define NOT_IA32(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
#ifdef IA64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
#define IA64_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
#define NOT_IA64(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
#define IA64_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
#define NOT_IA64(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
#ifdef AMD64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
#define AMD64_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
#define NOT_AMD64(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
#define AMD64_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
#define NOT_AMD64(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
#ifdef SPARC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
#define SPARC_ONLY(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
#define NOT_SPARC(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
#define SPARC_ONLY(code)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
#define NOT_SPARC(code) code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
#define FIX_THIS(code) report_assertion_failure("FIX_THIS",__FILE__, __LINE__, "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
#define define_pd_global(type, name, value) const type pd_##name = value;