hotspot/src/share/vm/utilities/globalDefinitions.hpp
changeset 37267 ad8c0e8de29f
parent 36829 dd6004c32d75
parent 37092 0e56e3c9d545
child 37442 942637261b21
equal deleted inserted replaced
36848:33688f44fb2a 37267:ad8c0e8de29f
    40 #endif
    40 #endif
    41 #ifdef TARGET_COMPILER_xlc
    41 #ifdef TARGET_COMPILER_xlc
    42 # include "utilities/globalDefinitions_xlc.hpp"
    42 # include "utilities/globalDefinitions_xlc.hpp"
    43 #endif
    43 #endif
    44 
    44 
       
    45 #ifndef NOINLINE
       
    46 #define NOINLINE
       
    47 #endif
       
    48 #ifndef ALWAYSINLINE
       
    49 #define ALWAYSINLINE inline
       
    50 #endif
    45 #ifndef PRAGMA_DIAG_PUSH
    51 #ifndef PRAGMA_DIAG_PUSH
    46 #define PRAGMA_DIAG_PUSH
    52 #define PRAGMA_DIAG_PUSH
    47 #endif
    53 #endif
    48 #ifndef PRAGMA_DIAG_POP
    54 #ifndef PRAGMA_DIAG_POP
    49 #define PRAGMA_DIAG_POP
    55 #define PRAGMA_DIAG_POP
  1082 const jlong    NoLongBits =  0; // no bits set in a long
  1088 const jlong    NoLongBits =  0; // no bits set in a long
  1083 const intptr_t OneBit     =  1; // only right_most bit set in a word
  1089 const intptr_t OneBit     =  1; // only right_most bit set in a word
  1084 
  1090 
  1085 // get a word with the n.th or the right-most or left-most n bits set
  1091 // get a word with the n.th or the right-most or left-most n bits set
  1086 // (note: #define used only so that they can be used in enum constant definitions)
  1092 // (note: #define used only so that they can be used in enum constant definitions)
  1087 #define nth_bit(n)        (n >= BitsPerWord ? 0 : OneBit << (n))
  1093 #define nth_bit(n)        (((n) >= BitsPerWord) ? 0 : (OneBit << (n)))
  1088 #define right_n_bits(n)   (nth_bit(n) - 1)
  1094 #define right_n_bits(n)   (nth_bit(n) - 1)
  1089 #define left_n_bits(n)    (right_n_bits(n) << (n >= BitsPerWord ? 0 : (BitsPerWord - n)))
  1095 #define left_n_bits(n)    (right_n_bits(n) << (((n) >= BitsPerWord) ? 0 : (BitsPerWord - (n))))
  1090 
  1096 
  1091 // bit-operations using a mask m
  1097 // bit-operations using a mask m
  1092 inline void   set_bits    (intptr_t& x, intptr_t m) { x |= m; }
  1098 inline void   set_bits    (intptr_t& x, intptr_t m) { x |= m; }
  1093 inline void clear_bits    (intptr_t& x, intptr_t m) { x &= ~m; }
  1099 inline void clear_bits    (intptr_t& x, intptr_t m) { x &= ~m; }
  1094 inline intptr_t mask_bits      (intptr_t  x, intptr_t m) { return x & m; }
  1100 inline intptr_t mask_bits      (intptr_t  x, intptr_t m) { return x & m; }