src/hotspot/share/utilities/globalDefinitions.hpp
changeset 53792 6fb43030a1b4
parent 53386 d5f6540c6bb1
child 54960 e46fe26d7f77
equal deleted inserted replaced
53791:bec6c8739833 53792:6fb43030a1b4
   163 const int BitsPerSize_t      = size_tSize * BitsPerByte;
   163 const int BitsPerSize_t      = size_tSize * BitsPerByte;
   164 
   164 
   165 // Size of a char[] needed to represent a jint as a string in decimal.
   165 // Size of a char[] needed to represent a jint as a string in decimal.
   166 const int jintAsStringSize = 12;
   166 const int jintAsStringSize = 12;
   167 
   167 
   168 // An opaque struct of heap-word width, so that HeapWord* can be a generic
   168 // An opaque type, so that HeapWord* can be a generic pointer into the heap.
   169 // pointer into the heap.  We require that object sizes be measured in
   169 // We require that object sizes be measured in units of heap words (e.g.
   170 // units of heap words, so that that
   170 // pointer-sized values), so that given HeapWord* hw,
   171 //   HeapWord* hw;
       
   172 //   hw += oop(hw)->foo();
   171 //   hw += oop(hw)->foo();
   173 // works, where foo is a method (like size or scavenge) that returns the
   172 // works, where foo is a method (like size or scavenge) that returns the
   174 // object size.
   173 // object size.
   175 class HeapWord {
   174 class HeapWordImpl;             // Opaque, never defined.
   176   friend class VMStructs;
   175 typedef HeapWordImpl* HeapWord;
   177  private:
   176 
   178   char* i;
   177 // Analogous opaque struct for metadata allocated from metaspaces.
   179 #ifndef PRODUCT
   178 class MetaWordImpl;             // Opaque, never defined.
   180  public:
   179 typedef MetaWordImpl* MetaWord;
   181   char* value() { return i; }
       
   182 #endif
       
   183 };
       
   184 
       
   185 // Analogous opaque struct for metadata allocated from
       
   186 // metaspaces.
       
   187 class MetaWord {
       
   188  private:
       
   189   char* i;
       
   190 };
       
   191 
   180 
   192 // HeapWordSize must be 2^LogHeapWordSize.
   181 // HeapWordSize must be 2^LogHeapWordSize.
   193 const int HeapWordSize        = sizeof(HeapWord);
   182 const int HeapWordSize        = sizeof(HeapWord);
   194 #ifdef _LP64
   183 #ifdef _LP64
   195 const int LogHeapWordSize     = 3;
   184 const int LogHeapWordSize     = 3;