< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page

  28 #include "utilities/compilerWarnings.hpp"
  29 #include "utilities/debug.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 // Get constants like JVM_T_CHAR and JVM_SIGNATURE_INT, before pulling in <jvm.h>.
  33 #include "classfile_constants.h"
  34 
  35 #include COMPILER_HEADER(utilities/globalDefinitions)
  36 
  37 #include <cstddef>
  38 
  39 class oopDesc;
  40 
  41 // Defaults for macros that might be defined per compiler.
  42 #ifndef NOINLINE
  43 #define NOINLINE
  44 #endif
  45 #ifndef ALWAYSINLINE
  46 #define ALWAYSINLINE inline
  47 #endif






  48 
  49 #ifndef ATTRIBUTE_ALIGNED
  50 #define ATTRIBUTE_ALIGNED(x)
  51 #endif






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

1192 
1193 //----------------------------------------------------------------------------------------------------
1194 // String type aliases used by command line flag declarations and
1195 // processing utilities.
1196 
1197 typedef const char* ccstr;
1198 typedef const char* ccstrlist;   // represents string arguments which accumulate
1199 
1200 //----------------------------------------------------------------------------------------------------
1201 // Default hash/equals functions used by ResourceHashtable
1202 
1203 template<typename K> unsigned primitive_hash(const K& k) {
1204   unsigned hash = (unsigned)((uintptr_t)k);
1205   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1206 }
1207 
1208 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1209   return k0 == k1;
1210 }
1211 
1212 
1213 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP

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

1204 
1205 //----------------------------------------------------------------------------------------------------
1206 // String type aliases used by command line flag declarations and
1207 // processing utilities.
1208 
1209 typedef const char* ccstr;
1210 typedef const char* ccstrlist;   // represents string arguments which accumulate
1211 
1212 //----------------------------------------------------------------------------------------------------
1213 // Default hash/equals functions used by ResourceHashtable
1214 
1215 template<typename K> unsigned primitive_hash(const K& k) {
1216   unsigned hash = (unsigned)((uintptr_t)k);
1217   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1218 }
1219 
1220 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1221   return k0 == k1;
1222 }
1223 

1224 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >