< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
  26 #define SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
  27 
  28 #include "utilities/compilerWarnings.hpp"
  29 #include "utilities/debug.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 #include COMPILER_HEADER(utilities/globalDefinitions)
  33 
  34 // Defaults for macros that might be defined per compiler.
  35 #ifndef NOINLINE
  36 #define NOINLINE
  37 #endif
  38 #ifndef ALWAYSINLINE
  39 #define ALWAYSINLINE inline
  40 #endif






  41 
  42 #ifndef ATTRIBUTE_ALIGNED
  43 #define ATTRIBUTE_ALIGNED(x)
  44 #endif






  45 
  46 // These are #defines to selectively turn on/off the Print(Opto)Assembly
  47 // capabilities. Choices should be led by a tradeoff between
  48 // code size and improved supportability.
  49 // if PRINT_ASSEMBLY then PRINT_ABSTRACT_ASSEMBLY must be true as well
  50 // to have a fallback in case hsdis is not available.
  51 #if defined(PRODUCT)
  52   #define SUPPORT_ABSTRACT_ASSEMBLY
  53   #define SUPPORT_ASSEMBLY
  54   #undef  SUPPORT_OPTO_ASSEMBLY      // Can't activate. In PRODUCT, many dump methods are missing.
  55   #undef  SUPPORT_DATA_STRUCTS       // Of limited use. In PRODUCT, many print methods are empty.
  56 #else
  57   #define SUPPORT_ABSTRACT_ASSEMBLY
  58   #define SUPPORT_ASSEMBLY
  59   #define SUPPORT_OPTO_ASSEMBLY
  60   #define SUPPORT_DATA_STRUCTS
  61 #endif
  62 #if defined(SUPPORT_ASSEMBLY) && !defined(SUPPORT_ABSTRACT_ASSEMBLY)
  63   #define SUPPORT_ABSTRACT_ASSEMBLY
  64 #endif


1123 }
1124 
1125 //----------------------------------------------------------------------------------------------------
1126 // String type aliases used by command line flag declarations and
1127 // processing utilities.
1128 
1129 typedef const char* ccstr;
1130 typedef const char* ccstrlist;   // represents string arguments which accumulate
1131 
1132 //----------------------------------------------------------------------------------------------------
1133 // Default hash/equals functions used by ResourceHashtable and KVHashtable
1134 
1135 template<typename K> unsigned primitive_hash(const K& k) {
1136   unsigned hash = (unsigned)((uintptr_t)k);
1137   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1138 }
1139 
1140 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1141   return k0 == k1;
1142 }
1143 
1144 
1145 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP


  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
  26 #define SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
  27 
  28 #include "utilities/compilerWarnings.hpp"
  29 #include "utilities/debug.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 #include COMPILER_HEADER(utilities/globalDefinitions)
  33 
  34 // Defaults for macros that might be defined per compiler.
  35 #ifndef NOINLINE
  36 #define NOINLINE
  37 #endif
  38 #ifndef ALWAYSINLINE
  39 #define ALWAYSINLINE inline
  40 #endif
  41 #ifndef __HOT
  42 #define __HOT
  43 #endif
  44 #ifndef __COLD
  45 #define __COLD
  46 #endif
  47 
  48 #ifndef ATTRIBUTE_ALIGNED
  49 #define ATTRIBUTE_ALIGNED(x)
  50 #endif
  51 #ifndef LIKELY
  52 #define LIKELY(condition)   (condition)
  53 #endif
  54 #ifndef UNLIKELY
  55 #define UNLIKELY(condition) (condition)
  56 #endif
  57 
  58 // These are #defines to selectively turn on/off the Print(Opto)Assembly
  59 // capabilities. Choices should be led by a tradeoff between
  60 // code size and improved supportability.
  61 // if PRINT_ASSEMBLY then PRINT_ABSTRACT_ASSEMBLY must be true as well
  62 // to have a fallback in case hsdis is not available.
  63 #if defined(PRODUCT)
  64   #define SUPPORT_ABSTRACT_ASSEMBLY
  65   #define SUPPORT_ASSEMBLY
  66   #undef  SUPPORT_OPTO_ASSEMBLY      // Can't activate. In PRODUCT, many dump methods are missing.
  67   #undef  SUPPORT_DATA_STRUCTS       // Of limited use. In PRODUCT, many print methods are empty.
  68 #else
  69   #define SUPPORT_ABSTRACT_ASSEMBLY
  70   #define SUPPORT_ASSEMBLY
  71   #define SUPPORT_OPTO_ASSEMBLY
  72   #define SUPPORT_DATA_STRUCTS
  73 #endif
  74 #if defined(SUPPORT_ASSEMBLY) && !defined(SUPPORT_ABSTRACT_ASSEMBLY)
  75   #define SUPPORT_ABSTRACT_ASSEMBLY
  76 #endif


1135 }
1136 
1137 //----------------------------------------------------------------------------------------------------
1138 // String type aliases used by command line flag declarations and
1139 // processing utilities.
1140 
1141 typedef const char* ccstr;
1142 typedef const char* ccstrlist;   // represents string arguments which accumulate
1143 
1144 //----------------------------------------------------------------------------------------------------
1145 // Default hash/equals functions used by ResourceHashtable and KVHashtable
1146 
1147 template<typename K> unsigned primitive_hash(const K& k) {
1148   unsigned hash = (unsigned)((uintptr_t)k);
1149   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1150 }
1151 
1152 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1153   return k0 == k1;
1154 }

1155 
1156 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >