java-openjdk/JDK-8203030-s390-size_t.patch

187 lines
9.6 KiB
Diff

# HG changeset patch
# User chrisphi
# Date 1528295658 14400
# Wed Jun 06 10:34:18 2018 -0400
# Branch JDK-8203030
# Node ID 191d4ac3ee244c4f21f2e87e44d34172ae8b37b4
# Parent b06f330492cd627a332c4933a0f3ad5df0351d50
8203030: Zero s390 31 bit size_t type conflicts in shared code
Summary: Cast to size_t or change to size_t foe compatibility with other archs.
Reviewed-by: Duke
Contributed-by: chrisphi
diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp
--- a/src/hotspot/share/code/codeCache.cpp
+++ b/src/hotspot/share/code/codeCache.cpp
@@ -409,7 +409,7 @@
add_heap(heap);
// Reserve Space
- size_t size_initial = MIN2(InitialCodeCacheSize, rs.size());
+ size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
size_initial = align_up(size_initial, os::vm_page_size());
if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
diff --git a/src/hotspot/share/gc/cms/cms_globals.hpp b/src/hotspot/share/gc/cms/cms_globals.hpp
--- a/src/hotspot/share/gc/cms/cms_globals.hpp
+++ b/src/hotspot/share/gc/cms/cms_globals.hpp
@@ -410,7 +410,7 @@
"An `interval' counter that determines how frequently " \
"we simulate overflow; a smaller number increases frequency") \
\
- product(uintx, ParGCDesiredObjsFromOverflowList, 20, \
+ product(size_t, ParGCDesiredObjsFromOverflowList, 20, \
"The desired number of objects to claim from the overflow list") \
range(0, max_uintx) \
\
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
@@ -2344,7 +2344,7 @@
// of things to do) or totally (at the very end).
size_t target_size;
if (partially) {
- target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
+ target_size = MIN2((size_t)_task_queue->max_elems()/3, (size_t)GCDrainStackTargetSize);
} else {
target_size = 0;
}
diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp
@@ -91,7 +91,7 @@
void pretouch_internal(size_t start_page, size_t end_page);
// Returns the index of the page which contains the given address.
- uintptr_t addr_to_page_index(char* addr) const;
+ size_t addr_to_page_index(char* addr) const;
// Returns the address of the given page index.
char* page_start(size_t index) const;
diff --git a/src/hotspot/share/gc/g1/g1StringDedupTable.hpp b/src/hotspot/share/gc/g1/g1StringDedupTable.hpp
--- a/src/hotspot/share/gc/g1/g1StringDedupTable.hpp
+++ b/src/hotspot/share/gc/g1/g1StringDedupTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
G1StringDedupEntry** _buckets;
size_t _size;
- uintx _entries;
+ size_t _entries;
uintx _shrink_threshold;
uintx _grow_threshold;
bool _rehash_needed;
diff --git a/src/hotspot/share/gc/parallel/parallel_globals.hpp b/src/hotspot/share/gc/parallel/parallel_globals.hpp
--- a/src/hotspot/share/gc/parallel/parallel_globals.hpp
+++ b/src/hotspot/share/gc/parallel/parallel_globals.hpp
@@ -57,7 +57,7 @@
"limiter (a number between 0-100)") \
range(0, 100) \
\
- product(uintx, ParallelOldDeadWoodLimiterStdDev, 80, \
+ product(size_t, ParallelOldDeadWoodLimiterStdDev, 80, \
"The standard deviation used by the parallel compact dead wood " \
"limiter (a number between 0-100)") \
range(0, 100) \
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
@@ -907,8 +907,8 @@
void PSParallelCompact::initialize_dead_wood_limiter()
{
const size_t max = 100;
- _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
- _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
+ _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
+ _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
_dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
DEBUG_ONLY(_dwl_initialized = true;)
_dwl_adjustment = normal_distribution(1.0);
diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp
--- a/src/hotspot/share/gc/shared/gc_globals.hpp
+++ b/src/hotspot/share/gc/shared/gc_globals.hpp
@@ -311,7 +311,7 @@
experimental(uintx, WorkStealingSpinToYieldRatio, 10, \
"Ratio of hard spins to calls to yield") \
\
- develop(uintx, ObjArrayMarkingStride, 2048, \
+ develop(size_t, ObjArrayMarkingStride, 2048, \
"Number of object array elements to push onto the marking stack " \
"before pushing a continuation entry") \
\
diff --git a/src/hotspot/share/gc/shared/plab.cpp b/src/hotspot/share/gc/shared/plab.cpp
--- a/src/hotspot/share/gc/shared/plab.cpp
+++ b/src/hotspot/share/gc/shared/plab.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
size_t PLAB::min_size() {
// Make sure that we return something that is larger than AlignmentReserve
- return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve;
+ return align_object_size(MAX2(MinTLABSize / HeapWordSize, (size_t)oopDesc::header_size())) + AlignmentReserve;
}
size_t PLAB::max_size() {
diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp
--- a/src/hotspot/share/prims/whitebox.cpp
+++ b/src/hotspot/share/prims/whitebox.cpp
@@ -1111,7 +1111,7 @@
WB_END
WB_ENTRY(jobject, WB_GetSizeTVMFlag(JNIEnv* env, jobject o, jstring name))
- uintx result;
+ size_t result;
if (GetVMFlag <size_t> (thread, env, name, &result, &JVMFlag::size_tAt)) {
ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
return longBox(thread, env, result);
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -1635,7 +1635,7 @@
// Increase the code cache size - tiered compiles a lot more.
if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
- MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
+ MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)ReservedCodeCacheSize * 5));
}
// Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp
--- a/src/hotspot/share/runtime/arguments.hpp
+++ b/src/hotspot/share/runtime/arguments.hpp
@@ -332,7 +332,7 @@
// Value of the conservative maximum heap alignment needed
static size_t _conservative_max_heap_alignment;
- static uintx _min_heap_size;
+ static size_t _min_heap_size;
// -Xrun arguments
static AgentLibraryList _libraryList;
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -85,8 +85,8 @@
define_pd_global(size_t, NewSizeThreadIncrease, 4*K);
define_pd_global(bool, InlineClassNatives, true);
define_pd_global(bool, InlineUnsafeOps, true);
-define_pd_global(uintx, InitialCodeCacheSize, 160*K);
-define_pd_global(uintx, ReservedCodeCacheSize, 32*M);
+define_pd_global(size_t, InitialCodeCacheSize, 160*K);
+define_pd_global(size_t, ReservedCodeCacheSize, 32*M);
define_pd_global(uintx, NonProfiledCodeHeapSize, 0);
define_pd_global(uintx, ProfiledCodeHeapSize, 0);
define_pd_global(uintx, NonNMethodCodeHeapSize, 32*M);