132 // metaspaces.
133 class MetaWord {
134 friend class VMStructs;
135 private:
136 char* i;
137 };
138
139 // HeapWordSize must be 2^LogHeapWordSize.
140 const int HeapWordSize = sizeof(HeapWord);
141 #ifdef _LP64
142 const int LogHeapWordSize = 3;
143 #else
144 const int LogHeapWordSize = 2;
145 #endif
146 const int HeapWordsPerLong = BytesPerLong / HeapWordSize;
147 const int LogHeapWordsPerLong = LogBytesPerLong - LogHeapWordSize;
148
149 // The larger HeapWordSize for 64bit requires larger heaps
150 // for the same application running in 64bit. See bug 4967770.
151 // The minimum alignment to a heap word size is done. Other
152 // parts of the memory system may required additional alignment
153 // and are responsible for those alignments.
154 #ifdef _LP64
155 #define ScaleForWordSize(x) align_size_down_((x) * 13 / 10, HeapWordSize)
156 #else
157 #define ScaleForWordSize(x) (x)
158 #endif
159
160 // The minimum number of native machine words necessary to contain "byte_size"
161 // bytes.
162 inline size_t heap_word_size(size_t byte_size) {
163 return (byte_size + (HeapWordSize-1)) >> LogHeapWordSize;
164 }
165
166
167 const size_t K = 1024;
168 const size_t M = K*K;
169 const size_t G = M*K;
170 const size_t HWperKB = K / sizeof(HeapWord);
171
172 const jint min_jint = (jint)1 << (sizeof(jint)*BitsPerByte-1); // 0x80000000 == smallest jint
|
132 // metaspaces.
133 class MetaWord {
134 friend class VMStructs;
135 private:
136 char* i;
137 };
138
139 // HeapWordSize must be 2^LogHeapWordSize.
140 const int HeapWordSize = sizeof(HeapWord);
141 #ifdef _LP64
142 const int LogHeapWordSize = 3;
143 #else
144 const int LogHeapWordSize = 2;
145 #endif
146 const int HeapWordsPerLong = BytesPerLong / HeapWordSize;
147 const int LogHeapWordsPerLong = LogBytesPerLong - LogHeapWordSize;
148
149 // The larger HeapWordSize for 64bit requires larger heaps
150 // for the same application running in 64bit. See bug 4967770.
151 // The minimum alignment to a heap word size is done. Other
152 // parts of the memory system may require additional alignment
153 // and are responsible for those alignments.
154 #ifdef _LP64
155 #define ScaleForWordSize(x) align_size_down_((x) * 13 / 10, HeapWordSize)
156 #else
157 #define ScaleForWordSize(x) (x)
158 #endif
159
160 // The minimum number of native machine words necessary to contain "byte_size"
161 // bytes.
162 inline size_t heap_word_size(size_t byte_size) {
163 return (byte_size + (HeapWordSize-1)) >> LogHeapWordSize;
164 }
165
166
167 const size_t K = 1024;
168 const size_t M = K*K;
169 const size_t G = M*K;
170 const size_t HWperKB = K / sizeof(HeapWord);
171
172 const jint min_jint = (jint)1 << (sizeof(jint)*BitsPerByte-1); // 0x80000000 == smallest jint
|