/[packages]/updates/5/java-1.8.0-openjdk/current/SOURCES/java-1.8.0-openjdk-size_t.patch
ViewVC logotype

Contents of /updates/5/java-1.8.0-openjdk/current/SOURCES/java-1.8.0-openjdk-size_t.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1083675 - (show annotations) (download)
Fri Jan 27 22:31:49 2017 UTC (7 years, 2 months ago) by luigiwalser
File size: 17392 byte(s)
sync with fedora as of 2017-01-25, update to u121b14
1 diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
2 --- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
3 +++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
4 @@ -2659,7 +2659,7 @@
5 if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
6 size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks);
7 n_blks += CMSOldPLABReactivityFactor*multiple*n_blks;
8 - n_blks = MIN2(n_blks, CMSOldPLABMax);
9 + n_blks = MIN2(n_blks, (size_t)CMSOldPLABMax);
10 }
11 assert(n_blks > 0, "Error");
12 _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl);
13 diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
14 --- openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
15 +++ openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
16 @@ -957,7 +957,7 @@
17 if (free_percentage < desired_free_percentage) {
18 size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
19 assert(desired_capacity >= capacity(), "invalid expansion size");
20 - size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
21 + size_t expand_bytes = MAX2(desired_capacity - capacity(), (size_t)MinHeapDeltaBytes);
22 if (PrintGCDetails && Verbose) {
23 size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
24 gclog_or_tty->print_cr("\nFrom compute_new_size: ");
25 @@ -6577,7 +6577,7 @@
26 HeapWord* curAddr = _markBitMap.startWord();
27 while (curAddr < _markBitMap.endWord()) {
28 size_t remaining = pointer_delta(_markBitMap.endWord(), curAddr);
29 - MemRegion chunk(curAddr, MIN2(CMSBitMapYieldQuantum, remaining));
30 + MemRegion chunk(curAddr, MIN2((size_t)CMSBitMapYieldQuantum, remaining));
31 _markBitMap.clear_large_range(chunk);
32 if (ConcurrentMarkSweepThread::should_yield() &&
33 !foregroundGCIsActive() &&
34 @@ -6875,7 +6875,7 @@
35 return;
36 }
37 // Double capacity if possible
38 - size_t new_capacity = MIN2(_capacity*2, MarkStackSizeMax);
39 + size_t new_capacity = MIN2(_capacity*2, (size_t)MarkStackSizeMax);
40 // Do not give up existing stack until we have managed to
41 // get the double capacity that we desired.
42 ReservedSpace rs(ReservedSpace::allocation_align_size_up(
43 diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp
44 --- openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
45 +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
46 @@ -3903,7 +3903,7 @@
47 // of things to do) or totally (at the very end).
48 size_t target_size;
49 if (partially) {
50 - target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
51 + target_size = MIN2((size_t)(_task_queue->max_elems()/3), (size_t) GCDrainStackTargetSize);
52 } else {
53 target_size = 0;
54 }
55 @@ -4707,7 +4707,7 @@
56 // The > 0 check is to deal with the prev and next live bytes which
57 // could be 0.
58 if (*hum_bytes > 0) {
59 - bytes = MIN2(HeapRegion::GrainBytes, *hum_bytes);
60 + bytes = MIN2(HeapRegion::GrainBytes, (size_t)*hum_bytes);
61 *hum_bytes -= bytes;
62 }
63 return bytes;
64 diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
65 --- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
66 +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
67 @@ -1726,7 +1726,7 @@
68
69 verify_region_sets_optional();
70
71 - size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes);
72 + size_t expand_bytes = MAX2(word_size * HeapWordSize, (size_t)MinHeapDeltaBytes);
73 ergo_verbose1(ErgoHeapSizing,
74 "attempt heap expansion",
75 ergo_format_reason("allocation request failed")
76 diff --git a/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp b/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
77 --- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
78 +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
79 @@ -117,7 +117,7 @@
80 return reserved_size() - committed_size();
81 }
82
83 -size_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const {
84 +uintptr_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const {
85 return (addr - _low_boundary) / _page_size;
86 }
87
88 diff --git a/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp b/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
89 --- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
90 +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp
91 @@ -38,7 +38,7 @@
92 _cancel(false),
93 _empty(true),
94 _dropped(0) {
95 - _nqueues = MAX2(ParallelGCThreads, (size_t)1);
96 + _nqueues = MAX2(ParallelGCThreads, (uintx)1);
97 _queues = NEW_C_HEAP_ARRAY(G1StringDedupWorkerQueue, _nqueues, mtGC);
98 for (size_t i = 0; i < _nqueues; i++) {
99 new (_queues + i) G1StringDedupWorkerQueue(G1StringDedupWorkerQueue::default_segment_size(), _max_cache_size, _max_size);
100 diff --git a/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp b/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp
101 --- openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp
102 +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp
103 @@ -120,7 +120,7 @@
104 };
105
106 G1StringDedupEntryCache::G1StringDedupEntryCache(size_t max_size) :
107 - _nlists(MAX2(ParallelGCThreads, (size_t)1)),
108 + _nlists(MAX2(ParallelGCThreads, (uintx)1)),
109 _max_list_length(0),
110 _cached(PaddedArray<G1StringDedupEntryList, mtGC>::create_unfreeable((uint)_nlists)),
111 _overflowed(PaddedArray<G1StringDedupEntryList, mtGC>::create_unfreeable((uint)_nlists)) {
112 diff --git a/src/share/vm/gc_implementation/g1/heapRegion.cpp b/src/share/vm/gc_implementation/g1/heapRegion.cpp
113 --- openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
114 +++ openjdk/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
115 @@ -109,7 +109,7 @@
116 if (FLAG_IS_DEFAULT(G1HeapRegionSize)) {
117 size_t average_heap_size = (initial_heap_size + max_heap_size) / 2;
118 region_size = MAX2(average_heap_size / HeapRegionBounds::target_number(),
119 - (uintx) HeapRegionBounds::min_size());
120 + HeapRegionBounds::min_size());
121 }
122
123 int region_size_log = log2_long((jlong) region_size);
124 diff --git a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
125 --- openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
126 +++ openjdk/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
127 @@ -194,7 +194,7 @@
128 const size_t num_overflow_elems = of_stack->size();
129 const size_t space_available = queue->max_elems() - queue->size();
130 const size_t num_take_elems = MIN3(space_available / 4,
131 - ParGCDesiredObjsFromOverflowList,
132 + (size_t)ParGCDesiredObjsFromOverflowList,
133 num_overflow_elems);
134 // Transfer the most recent num_take_elems from the overflow
135 // stack to our work queue.
136 diff --git a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
137 --- openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
138 +++ openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
139 @@ -910,8 +910,8 @@
140 void PSParallelCompact::initialize_dead_wood_limiter()
141 {
142 const size_t max = 100;
143 - _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
144 - _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
145 + _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
146 + _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
147 _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
148 DEBUG_ONLY(_dwl_initialized = true;)
149 _dwl_adjustment = normal_distribution(1.0);
150 diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp
151 --- openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
152 +++ openjdk/hotspot/src/share/vm/memory/collectorPolicy.cpp
153 @@ -385,7 +385,7 @@
154 uintx calculated_size = NewSize + OldSize;
155 double shrink_factor = (double) MaxHeapSize / calculated_size;
156 uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment);
157 - FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size));
158 + FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), (size_t)smaller_new_size));
159 _initial_gen0_size = NewSize;
160
161 // OldSize is already aligned because above we aligned MaxHeapSize to
162 @@ -433,7 +433,7 @@
163 // yield a size that is too small) and bound it by MaxNewSize above.
164 // Ergonomics plays here by previously calculating the desired
165 // NewSize and MaxNewSize.
166 - max_new_size = MIN2(MAX2(max_new_size, NewSize), MaxNewSize);
167 + max_new_size = MIN2(MAX2(max_new_size, (size_t)NewSize), (size_t)MaxNewSize);
168 }
169 assert(max_new_size > 0, "All paths should set max_new_size");
170
171 @@ -455,24 +455,23 @@
172 // lower limit.
173 _min_gen0_size = NewSize;
174 desired_new_size = NewSize;
175 - max_new_size = MAX2(max_new_size, NewSize);
176 + max_new_size = MAX2(max_new_size, (size_t)NewSize);
177 } else if (FLAG_IS_ERGO(NewSize)) {
178 // If NewSize is set ergonomically, we should use it as a lower
179 // limit, but use NewRatio to calculate the initial size.
180 _min_gen0_size = NewSize;
181 desired_new_size =
182 - MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize);
183 - max_new_size = MAX2(max_new_size, NewSize);
184 + MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize);
185 + max_new_size = MAX2(max_new_size, (size_t)NewSize);
186 } else {
187 // For the case where NewSize is the default, use NewRatio
188 // to size the minimum and initial generation sizes.
189 // Use the default NewSize as the floor for these values. If
190 // NewRatio is overly large, the resulting sizes can be too
191 // small.
192 - _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), NewSize);
193 + _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), (size_t)NewSize);
194 desired_new_size =
195 - MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize);
196 - }
197 + MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize); }
198
199 assert(_min_gen0_size > 0, "Sanity check");
200 _initial_gen0_size = desired_new_size;
201 @@ -573,7 +572,7 @@
202 } else {
203 // It's been explicitly set on the command line. Use the
204 // OldSize and then determine the consequences.
205 - _min_gen1_size = MIN2(OldSize, _min_heap_byte_size - _min_gen0_size);
206 + _min_gen1_size = MIN2((size_t)OldSize, _min_heap_byte_size - _min_gen0_size);
207 _initial_gen1_size = OldSize;
208
209 // If the user has explicitly set an OldSize that is inconsistent
210 diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.cpp
211 --- openjdk/hotspot/src/share/vm/memory/metaspace.cpp
212 +++ openjdk/hotspot/src/share/vm/memory/metaspace.cpp
213 @@ -1455,7 +1455,7 @@
214
215 void MetaspaceGC::post_initialize() {
216 // Reset the high-water mark once the VM initialization is done.
217 - _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize);
218 + _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), (size_t)MetaspaceSize);
219 }
220
221 bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
222 @@ -1515,7 +1515,7 @@
223 (size_t)MIN2(min_tmp, double(max_uintx));
224 // Don't shrink less than the initial generation size
225 minimum_desired_capacity = MAX2(minimum_desired_capacity,
226 - MetaspaceSize);
227 + (size_t)MetaspaceSize);
228
229 if (PrintGCDetails && Verbose) {
230 gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: ");
231 @@ -1573,7 +1573,7 @@
232 const double max_tmp = used_after_gc / minimum_used_percentage;
233 size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx));
234 maximum_desired_capacity = MAX2(maximum_desired_capacity,
235 - MetaspaceSize);
236 + (size_t)MetaspaceSize);
237 if (PrintGCDetails && Verbose) {
238 gclog_or_tty->print_cr(" "
239 " maximum_free_percentage: %6.2f"
240 @@ -3285,7 +3285,7 @@
241 // on the medium chunk list. The next chunk will be small and progress
242 // from there. This size calculated by -version.
243 _first_class_chunk_word_size = MIN2((size_t)MediumChunk*6,
244 - (CompressedClassSpaceSize/BytesPerWord)*2);
245 + (size_t)(CompressedClassSpaceSize/BytesPerWord)*2);
246 _first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size);
247 // Arbitrarily set the initial virtual space to a multiple
248 // of the boot class loader size.
249 diff --git a/src/share/vm/memory/threadLocalAllocBuffer.cpp b/src/share/vm/memory/threadLocalAllocBuffer.cpp
250 --- openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
251 +++ openjdk/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp
252 @@ -238,13 +238,13 @@
253 size_t init_sz = 0;
254
255 if (TLABSize > 0) {
256 - init_sz = TLABSize / HeapWordSize;
257 + init_sz = (size_t)(TLABSize / HeapWordSize);
258 } else if (global_stats() != NULL) {
259 // Initial size is a function of the average number of allocating threads.
260 unsigned nof_threads = global_stats()->allocating_threads_avg();
261
262 - init_sz = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) /
263 - (nof_threads * target_refills());
264 + init_sz = (size_t)((Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) /
265 + (nof_threads * target_refills()));
266 init_sz = align_object_size(init_sz);
267 }
268 init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
269 diff --git a/src/share/vm/oops/objArrayKlass.inline.hpp b/src/share/vm/oops/objArrayKlass.inline.hpp
270 --- openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
271 +++ openjdk/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
272 @@ -48,7 +48,7 @@
273 const size_t beg_index = size_t(index);
274 assert(beg_index < len || len == 0, "index too large");
275
276 - const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
277 + const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
278 const size_t end_index = beg_index + stride;
279 T* const base = (T*)a->base();
280 T* const beg = base + beg_index;
281 @@ -82,7 +82,7 @@
282 const size_t beg_index = size_t(index);
283 assert(beg_index < len || len == 0, "index too large");
284
285 - const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
286 + const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
287 const size_t end_index = beg_index + stride;
288 T* const base = (T*)a->base();
289 T* const beg = base + beg_index;
290 diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
291 --- openjdk/hotspot/src/share/vm/runtime/arguments.cpp
292 +++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp
293 @@ -1283,7 +1283,7 @@
294 // NewSize was set on the command line and it is larger than
295 // preferred_max_new_size.
296 if (!FLAG_IS_DEFAULT(NewSize)) { // NewSize explicitly set at command-line
297 - FLAG_SET_ERGO(uintx, MaxNewSize, MAX2(NewSize, preferred_max_new_size));
298 + FLAG_SET_ERGO(uintx, MaxNewSize, MAX2((size_t)NewSize, preferred_max_new_size));
299 } else {
300 FLAG_SET_ERGO(uintx, MaxNewSize, preferred_max_new_size);
301 }
302 @@ -1308,8 +1308,8 @@
303 // Unless explicitly requested otherwise, make young gen
304 // at least min_new, and at most preferred_max_new_size.
305 if (FLAG_IS_DEFAULT(NewSize)) {
306 - FLAG_SET_ERGO(uintx, NewSize, MAX2(NewSize, min_new));
307 - FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, NewSize));
308 + FLAG_SET_ERGO(uintx, NewSize, MAX2((size_t)NewSize, min_new));
309 + FLAG_SET_ERGO(uintx, NewSize, MIN2(preferred_max_new_size, (size_t)NewSize));
310 if (PrintGCDetails && Verbose) {
311 // Too early to use gclog_or_tty
312 tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize);
313 @@ -1319,7 +1319,7 @@
314 // so it's NewRatio x of NewSize.
315 if (FLAG_IS_DEFAULT(OldSize)) {
316 if (max_heap > NewSize) {
317 - FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
318 + FLAG_SET_ERGO(uintx, OldSize, MIN2((size_t)(NewRatio*NewSize), max_heap - NewSize));
319 if (PrintGCDetails && Verbose) {
320 // Too early to use gclog_or_tty
321 tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);

  ViewVC Help
Powered by ViewVC 1.1.30