@@ -68,10 +68,10 @@ class arrayOopDesc : public oopDesc {
68
68
// The header is considered the oop part of this type plus the length.
69
69
// This is not equivalent to sizeof(arrayOopDesc) which should not appear in the code.
70
70
static int header_size_in_bytes () {
71
- size_t hs = length_offset_in_bytes () + sizeof (int );
71
+ int hs = length_offset_in_bytes () + ( int ) sizeof (int );
72
72
#ifdef ASSERT
73
73
// make sure it isn't called before UseCompressedOops is initialized.
74
- static size_t arrayoopdesc_hs = 0 ;
74
+ static int arrayoopdesc_hs = 0 ;
75
75
if (arrayoopdesc_hs == 0 ) arrayoopdesc_hs = hs;
76
76
assert (arrayoopdesc_hs == hs, " header size can't change" );
77
77
#endif // ASSERT
@@ -83,13 +83,13 @@ class arrayOopDesc : public oopDesc {
83
83
// it occupies the second half of the _klass field in oopDesc.
84
84
static int length_offset_in_bytes () {
85
85
return UseCompressedClassPointers ? klass_gap_offset_in_bytes () :
86
- sizeof (arrayOopDesc);
86
+ ( int ) sizeof (arrayOopDesc);
87
87
}
88
88
89
89
// Returns the offset of the first element.
90
90
static int base_offset_in_bytes (BasicType type) {
91
- size_t hs = header_size_in_bytes ();
92
- return ( int )( element_type_should_be_aligned (type) ? align_up (hs, BytesPerLong) : hs) ;
91
+ int hs = header_size_in_bytes ();
92
+ return element_type_should_be_aligned (type) ? align_up (hs, BytesPerLong) : hs;
93
93
}
94
94
95
95
// Returns the address of the first element. The elements in the array will not
@@ -134,14 +134,14 @@ class arrayOopDesc : public oopDesc {
134
134
assert (type < T_CONFLICT, " wrong type" );
135
135
assert (type2aelembytes (type) != 0 , " wrong type" );
136
136
137
- size_t hdr_size_in_bytes = base_offset_in_bytes (type);
137
+ int hdr_size_in_bytes = base_offset_in_bytes (type);
138
138
// This is rounded-up and may overlap with the first array elements.
139
- size_t hdr_size_in_words = align_up (hdr_size_in_bytes, HeapWordSize) / HeapWordSize;
139
+ int hdr_size_in_words = align_up (hdr_size_in_bytes, HeapWordSize) / HeapWordSize;
140
140
141
141
const size_t max_element_words_per_size_t =
142
- align_down ((SIZE_MAX/HeapWordSize - hdr_size_in_words), MinObjAlignment);
142
+ align_down ((SIZE_MAX/HeapWordSize - ( size_t ) hdr_size_in_words), MinObjAlignment);
143
143
const size_t max_elements_per_size_t =
144
- HeapWordSize * max_element_words_per_size_t / type2aelembytes (type);
144
+ HeapWordSize * max_element_words_per_size_t / ( size_t ) type2aelembytes (type);
145
145
if ((size_t )max_jint < max_elements_per_size_t ) {
146
146
// It should be ok to return max_jint here, but parts of the code
147
147
// (CollectedHeap, Klass::oop_oop_iterate(), and more) uses an int for
0 commit comments