ff9254e
diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
ff9254e
@@ -2677,7 +2677,7 @@
ff9254e
   if (ResizeOldPLAB && CMSOldPLABResizeQuicker) {
ff9254e
     size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks);
ff9254e
     n_blks +=  CMSOldPLABReactivityFactor*multiple*n_blks;
ff9254e
-    n_blks = MIN2(n_blks, CMSOldPLABMax);
ff9254e
+    n_blks = MIN2(n_blks, (size_t)CMSOldPLABMax);
ff9254e
   }
ff9254e
   assert(n_blks > 0, "Error");
ff9254e
   _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl);
ff9254e
diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
ff9254e
@@ -3538,7 +3538,7 @@
ff9254e
   // of things to do) or totally (at the very end).
ff9254e
   size_t target_size;
ff9254e
   if (partially) {
ff9254e
-    target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
ff9254e
+    target_size = MIN2((size_t)(_task_queue->max_elems()/3), (size_t) GCDrainStackTargetSize);
ff9254e
   } else {
ff9254e
     target_size = 0;
ff9254e
   }
ff9254e
@@ -4318,7 +4318,7 @@
ff9254e
   // The > 0 check is to deal with the prev and next live bytes which
ff9254e
   // could be 0.
ff9254e
   if (*hum_bytes > 0) {
ff9254e
-    bytes = MIN2(HeapRegion::GrainBytes, *hum_bytes);
ff9254e
+    bytes = MIN2(HeapRegion::GrainBytes, (size_t)*hum_bytes);
ff9254e
     *hum_bytes -= bytes;
ff9254e
   }
ff9254e
   return bytes;
ff9254e
diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
ff9254e
@@ -1700,7 +1700,7 @@
ff9254e
 
ff9254e
   verify_region_sets_optional();
ff9254e
 
ff9254e
-  size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes);
ff9254e
+  size_t expand_bytes = MAX2(word_size * HeapWordSize, (size_t)MinHeapDeltaBytes);
ff9254e
   ergo_verbose1(ErgoHeapSizing,
ff9254e
                 "attempt heap expansion",
ff9254e
                 ergo_format_reason("allocation request failed")
ff9254e
diff --git a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
ff9254e
@@ -840,7 +840,7 @@
ff9254e
 // This can be done by either mutator threads together with the
ff9254e
 // concurrent refinement threads or GC threads.
ff9254e
 int HeapRegionRemSet::num_par_rem_sets() {
ff9254e
-  return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads);
ff9254e
+  return (int)MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), (size_t)ParallelGCThreads);
ff9254e
 }
ff9254e
 
ff9254e
 HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa,
ff9254e
diff --git a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
ff9254e
@@ -188,7 +188,7 @@
ff9254e
   const size_t num_overflow_elems = of_stack->size();
ff9254e
   const size_t space_available = queue->max_elems() - queue->size();
ff9254e
   const size_t num_take_elems = MIN3(space_available / 4,
ff9254e
-                                     ParGCDesiredObjsFromOverflowList,
ff9254e
+                                     (size_t)ParGCDesiredObjsFromOverflowList,
ff9254e
                                      num_overflow_elems);
ff9254e
   // Transfer the most recent num_take_elems from the overflow
ff9254e
   // stack to our work queue.
ff9254e
diff --git a/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp
ff9254e
@@ -69,7 +69,7 @@
ff9254e
   if (_virtual_space != NULL && _virtual_space->expand_by(bytes)) {
ff9254e
     _region_start = covered_region.start();
ff9254e
     _region_size = covered_region.word_size();
ff9254e
-    idx_t* map = (idx_t*)_virtual_space->reserved_low_addr();
ff9254e
+    BitMap::bm_word_t* map = (BitMap::bm_word_t*)_virtual_space->reserved_low_addr();
ff9254e
     _beg_bits.set_map(map);
ff9254e
     _beg_bits.set_size(bits / 2);
ff9254e
     _end_bits.set_map(map + words / 2);
ff9254e
diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/memory/collectorPolicy.cpp
ff9254e
@@ -357,7 +357,7 @@
ff9254e
       // generally small compared to the NewRatio calculation.
ff9254e
       _min_gen0_size = NewSize;
ff9254e
       desired_new_size = NewSize;
ff9254e
-      max_new_size = MAX2(max_new_size, NewSize);
ff9254e
+      max_new_size = MAX2(max_new_size, (size_t)NewSize);
ff9254e
     } else {
ff9254e
       // For the case where NewSize is the default, use NewRatio
ff9254e
       // to size the minimum and initial generation sizes.
ff9254e
@@ -365,10 +365,10 @@
ff9254e
       // NewRatio is overly large, the resulting sizes can be too
ff9254e
       // small.
ff9254e
       _min_gen0_size = MAX2(scale_by_NewRatio_aligned(min_heap_byte_size()),
ff9254e
-                          NewSize);
ff9254e
+                          (size_t)NewSize);
ff9254e
       desired_new_size =
ff9254e
         MAX2(scale_by_NewRatio_aligned(initial_heap_byte_size()),
ff9254e
-             NewSize);
ff9254e
+             (size_t)NewSize);
ff9254e
     }
ff9254e
 
ff9254e
     assert(_min_gen0_size > 0, "Sanity check");
ff9254e
@@ -423,14 +423,14 @@
ff9254e
       // Adjust gen0 down to accomodate OldSize
ff9254e
       *gen0_size_ptr = heap_size - min_gen0_size;
ff9254e
       *gen0_size_ptr =
ff9254e
-        MAX2((uintx)align_size_down(*gen0_size_ptr, min_alignment()),
ff9254e
+        MAX2((size_t)align_size_down(*gen0_size_ptr, min_alignment()),
ff9254e
              min_alignment());
ff9254e
       assert(*gen0_size_ptr > 0, "Min gen0 is too large");
ff9254e
       result = true;
ff9254e
     } else {
ff9254e
       *gen1_size_ptr = heap_size - *gen0_size_ptr;
ff9254e
       *gen1_size_ptr =
ff9254e
-        MAX2((uintx)align_size_down(*gen1_size_ptr, min_alignment()),
ff9254e
+        MAX2((size_t)align_size_down(*gen1_size_ptr, min_alignment()),
ff9254e
                        min_alignment());
ff9254e
     }
ff9254e
   }
ff9254e
@@ -454,7 +454,7 @@
ff9254e
   // for setting the gen1 maximum.
ff9254e
   _max_gen1_size = max_heap_byte_size() - _max_gen0_size;
ff9254e
   _max_gen1_size =
ff9254e
-    MAX2((uintx)align_size_down(_max_gen1_size, min_alignment()),
ff9254e
+    MAX2((size_t)align_size_down(_max_gen1_size, min_alignment()),
ff9254e
          min_alignment());
ff9254e
   // If no explicit command line flag has been set for the
ff9254e
   // gen1 size, use what is left for gen1.
ff9254e
@@ -468,11 +468,11 @@
ff9254e
       "gen0 has an unexpected minimum size");
ff9254e
     set_min_gen1_size(min_heap_byte_size() - min_gen0_size());
ff9254e
     set_min_gen1_size(
ff9254e
-      MAX2((uintx)align_size_down(_min_gen1_size, min_alignment()),
ff9254e
+      MAX2((size_t)align_size_down(_min_gen1_size, min_alignment()),
ff9254e
            min_alignment()));
ff9254e
     set_initial_gen1_size(initial_heap_byte_size() - initial_gen0_size());
ff9254e
     set_initial_gen1_size(
ff9254e
-      MAX2((uintx)align_size_down(_initial_gen1_size, min_alignment()),
ff9254e
+      MAX2((size_t)align_size_down(_initial_gen1_size, min_alignment()),
ff9254e
            min_alignment()));
ff9254e
 
ff9254e
   } else {
ff9254e
diff --git a/src/share/vm/oops/objArrayKlass.inline.hpp b/src/share/vm/oops/objArrayKlass.inline.hpp
ff9254e
--- jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
ff9254e
+++ jdk8/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
ff9254e
@@ -46,7 +46,7 @@
ff9254e
   const size_t beg_index = size_t(index);
ff9254e
   assert(beg_index < len || len == 0, "index too large");
ff9254e
 
ff9254e
-  const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
ff9254e
+  const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
ff9254e
   const size_t end_index = beg_index + stride;
ff9254e
   T* const base = (T*)a->base();
ff9254e
   T* const beg = base + beg_index;
ff9254e
@@ -80,7 +80,7 @@
ff9254e
   const size_t beg_index = size_t(index);
ff9254e
   assert(beg_index < len || len == 0, "index too large");
ff9254e
 
ff9254e
-  const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
ff9254e
+  const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
ff9254e
   const size_t end_index = beg_index + stride;
ff9254e
   T* const base = (T*)a->base();
ff9254e
   T* const beg = base + beg_index;
ff9254e
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
ff9254e
--- jdk8/hotspot/src/share/vm/runtime/arguments.cpp
ff9254e
+++ jdk8/hotspot/src/share/vm/runtime/arguments.cpp
ff9254e
@@ -1209,7 +1209,7 @@
ff9254e
       // so it's NewRatio x of NewSize.
ff9254e
       if (FLAG_IS_DEFAULT(OldSize)) {
ff9254e
         if (max_heap > NewSize) {
ff9254e
-          FLAG_SET_ERGO(uintx, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize));
ff9254e
+          FLAG_SET_ERGO(uintx, OldSize, MIN2((size_t)(NewRatio*NewSize), max_heap - NewSize));
ff9254e
           if (PrintGCDetails && Verbose) {
ff9254e
             // Too early to use gclog_or_tty
ff9254e
             tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize);