57 const int WordAlignmentMask = (1 << LogBytesPerWord) - 1; |
57 const int WordAlignmentMask = (1 << LogBytesPerWord) - 1; |
58 const int LongAlignmentMask = (1 << LogBytesPerLong) - 1; |
58 const int LongAlignmentMask = (1 << LogBytesPerLong) - 1; |
59 |
59 |
60 const int WordsPerLong = 2; // Number of stack entries for longs |
60 const int WordsPerLong = 2; // Number of stack entries for longs |
61 |
61 |
62 const int oopSize = sizeof(char*); |
62 const int oopSize = sizeof(char*); // Full-width oop |
|
63 extern int heapOopSize; // Oop within a java object |
63 const int wordSize = sizeof(char*); |
64 const int wordSize = sizeof(char*); |
64 const int longSize = sizeof(jlong); |
65 const int longSize = sizeof(jlong); |
65 const int jintSize = sizeof(jint); |
66 const int jintSize = sizeof(jint); |
66 const int size_tSize = sizeof(size_t); |
67 const int size_tSize = sizeof(size_t); |
67 |
68 |
|
69 const int BytesPerOop = BytesPerWord; // Full-width oop |
|
70 |
|
71 extern int LogBytesPerHeapOop; // Oop within a java object |
|
72 extern int LogBitsPerHeapOop; |
|
73 extern int BytesPerHeapOop; |
|
74 extern int BitsPerHeapOop; |
|
75 |
|
76 const int BitsPerJavaInteger = 32; |
|
77 const int BitsPerSize_t = size_tSize * BitsPerByte; |
|
78 |
68 // Size of a char[] needed to represent a jint as a string in decimal. |
79 // Size of a char[] needed to represent a jint as a string in decimal. |
69 const int jintAsStringSize = 12; |
80 const int jintAsStringSize = 12; |
70 |
|
71 const int LogBytesPerOop = LogBytesPerWord; |
|
72 const int LogBitsPerOop = LogBitsPerWord; |
|
73 const int BytesPerOop = 1 << LogBytesPerOop; |
|
74 const int BitsPerOop = 1 << LogBitsPerOop; |
|
75 |
|
76 const int BitsPerJavaInteger = 32; |
|
77 const int BitsPerSize_t = size_tSize * BitsPerByte; |
|
78 |
81 |
79 // In fact this should be |
82 // In fact this should be |
80 // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64); |
83 // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64); |
81 // see os::set_memory_serialize_page() |
84 // see os::set_memory_serialize_page() |
82 #ifdef _LP64 |
85 #ifdef _LP64 |
97 private: |
100 private: |
98 char* i; |
101 char* i; |
99 }; |
102 }; |
100 |
103 |
101 // HeapWordSize must be 2^LogHeapWordSize. |
104 // HeapWordSize must be 2^LogHeapWordSize. |
102 const int HeapWordSize = sizeof(HeapWord); |
105 const int HeapWordSize = sizeof(HeapWord); |
103 #ifdef _LP64 |
106 #ifdef _LP64 |
104 const int LogHeapWordSize = 3; |
107 const int LogHeapWordSize = 3; |
105 #else |
108 #else |
106 const int LogHeapWordSize = 2; |
109 const int LogHeapWordSize = 2; |
107 #endif |
110 #endif |
108 const int HeapWordsPerOop = oopSize / HeapWordSize; |
111 const int HeapWordsPerLong = BytesPerLong / HeapWordSize; |
109 const int HeapWordsPerLong = BytesPerLong / HeapWordSize; |
112 const int LogHeapWordsPerLong = LogBytesPerLong - LogHeapWordSize; |
110 |
113 |
111 // The larger HeapWordSize for 64bit requires larger heaps |
114 // The larger HeapWordSize for 64bit requires larger heaps |
112 // for the same application running in 64bit. See bug 4967770. |
115 // for the same application running in 64bit. See bug 4967770. |
113 // The minimum alignment to a heap word size is done. Other |
116 // The minimum alignment to a heap word size is done. Other |
114 // parts of the memory system may required additional alignment |
117 // parts of the memory system may required additional alignment |
282 |
285 |
283 const int MinObjAlignment = HeapWordsPerLong; |
286 const int MinObjAlignment = HeapWordsPerLong; |
284 const int MinObjAlignmentInBytes = MinObjAlignment * HeapWordSize; |
287 const int MinObjAlignmentInBytes = MinObjAlignment * HeapWordSize; |
285 const int MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1; |
288 const int MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1; |
286 |
289 |
|
290 const int LogMinObjAlignment = LogHeapWordsPerLong; |
|
291 const int LogMinObjAlignmentInBytes = LogMinObjAlignment + LogHeapWordSize; |
|
292 |
287 // Machine dependent stuff |
293 // Machine dependent stuff |
288 |
294 |
289 #include "incls/_globalDefinitions_pd.hpp.incl" |
295 #include "incls/_globalDefinitions_pd.hpp.incl" |
290 |
296 |
291 // The byte alignment to be used by Arena::Amalloc. See bugid 4169348. |
297 // The byte alignment to be used by Arena::Amalloc. See bugid 4169348. |
463 T_ARRAY_aelem_bytes = 8, |
471 T_ARRAY_aelem_bytes = 8, |
464 #else |
472 #else |
465 T_OBJECT_aelem_bytes = 4, |
473 T_OBJECT_aelem_bytes = 4, |
466 T_ARRAY_aelem_bytes = 4, |
474 T_ARRAY_aelem_bytes = 4, |
467 #endif |
475 #endif |
|
476 T_NARROWOOP_aelem_bytes = 4, |
468 T_VOID_aelem_bytes = 0 |
477 T_VOID_aelem_bytes = 0 |
469 }; |
478 }; |
470 |
479 |
471 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element |
480 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element |
472 #ifdef ASSERT |
481 #ifdef ASSERT |