Skip to content

Commit b85a7fb

Browse files
author
Jason Tatton (AWS)
committed
Merge master
2 parents 5f1ff76 + 83b2411 commit b85a7fb

File tree

641 files changed

+13613
-10198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

641 files changed

+13613
-10198
lines changed

.jcheck/conf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ project=jdk
33
jbs=JDK
44

55
[checks]
6-
error=blacklist.author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
6+
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
77

88
[repository]
9-
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\\.(?:0|[1-9][0-9]*)){0,4})(?:\\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\\d{1,3})?-(?:(?:b\\d{2,3})|(?:ga)))|(?:hs\\d\\d(?:\\.\\d{1,2})?-b\\d\\d)
9+
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
1010
branches=
1111

1212
[census]
1313
version=0
1414
domain=openjdk.org
1515

1616
[checks "whitespace"]
17-
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java
17+
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm
1818

1919
[checks "merge"]
2020
message=Merge
@@ -28,3 +28,6 @@ role=committer
2828

2929
[checks "issues"]
3030
pattern=^([124-8][0-9]{6}): (\S.*)$
31+
32+
[checks "problemlists"]
33+
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp

bin/idea.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,18 @@ for root in $MODULE_ROOTS; do
184184
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
185185
root=`wslpath -am $root`
186186
fi
187-
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
187+
188+
VM_CI="jdk.internal.vm.ci/share/classes"
189+
VM_COMPILER="src/jdk.internal.vm.compiler/share/classes"
190+
if test "${root#*$VM_CI}" != "$root" || test "${root#*$VM_COMPILER}" != "$root"; then
191+
for subdir in "$root"/*; do
192+
if [ -d "$subdir" ]; then
193+
SOURCES=$SOURCES" $SOURCE_PREFIX""$subdir"/src"$SOURCE_POSTFIX"
194+
fi
195+
done
196+
else
197+
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
198+
fi
188199
done
189200

190201
add_replacement "###SOURCE_ROOTS###" "$SOURCES"

make/hotspot/lib/JvmFeatures.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ ifneq ($(call check-jvm-feature, cds), true)
119119
archiveBuilder.cpp \
120120
archiveUtils.cpp \
121121
classListParser.cpp \
122+
classLoaderDataShared.cpp \
122123
classLoaderExt.cpp \
124+
cppVtables.cpp \
123125
dumpAllocStats.cpp \
124126
dynamicArchive.cpp \
125127
filemap.cpp \

make/hotspot/symbols/symbols-unix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,6 @@ JVM_AddModuleExports
198198
JVM_AddModuleExportsToAll
199199
JVM_AddModuleExportsToAllUnnamed
200200
JVM_AddReadsModule
201+
JVM_DefineArchivedModules
201202
JVM_DefineModule
202203
JVM_SetBootLoaderUnnamedModule

make/scripts/generate-symbol-data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if [ ! -f symbols ] ; then
6363
exit 1
6464
fi;
6565

66-
if [ "`hg status .`x" != "x" ] ; then
66+
if [ "`git status --porcelain=v1 .`x" != "x" ] ; then
6767
echo "The make/data/symbols directory contains local changes!" >&2
6868
exit 1
6969
fi;

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ alloc_class chunk3(RFLAGS);
614614
// Several register classes are automatically defined based upon information in
615615
// this architecture description.
616616
// 1) reg_class inline_cache_reg ( /* as def'd in frame section */ )
617-
// 2) reg_class compiler_method_oop_reg ( /* as def'd in frame section */ )
618-
// 2) reg_class interpreter_method_oop_reg ( /* as def'd in frame section */ )
617+
// 2) reg_class compiler_method_reg ( /* as def'd in frame section */ )
618+
// 2) reg_class interpreter_method_reg ( /* as def'd in frame section */ )
619619
// 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ )
620620
//
621621

@@ -2410,12 +2410,6 @@ const int Matcher::float_pressure(int default_pressure_threshold) {
24102410
return default_pressure_threshold;
24112411
}
24122412

2413-
int Matcher::regnum_to_fpu_offset(int regnum)
2414-
{
2415-
Unimplemented();
2416-
return 0;
2417-
}
2418-
24192413
// Is this branch offset short enough that a short branch can be used?
24202414
//
24212415
// NOTE: If the platform does not provide any short branch variants, then
@@ -4043,17 +4037,14 @@ encode %{
40434037
// SP meets the minimum alignment.
40444038

40454039
frame %{
4046-
// What direction does stack grow in (assumed to be same for C & Java)
4047-
stack_direction(TOWARDS_LOW);
4048-
40494040
// These three registers define part of the calling convention
40504041
// between compiled code and the interpreter.
40514042

40524043
// Inline Cache Register or Method for I2C.
40534044
inline_cache_reg(R12);
40544045

4055-
// Method Oop Register when calling interpreter.
4056-
interpreter_method_oop_reg(R12);
4046+
// Method Register when calling interpreter.
4047+
interpreter_method_reg(R12);
40574048

40584049
// Number of stack slots consumed by locking an object
40594050
sync_stack_slots(2);
@@ -5622,9 +5613,9 @@ operand inline_cache_RegP(iRegP reg)
56225613
interface(REG_INTER);
56235614
%}
56245615

5625-
operand interpreter_method_oop_RegP(iRegP reg)
5616+
operand interpreter_method_RegP(iRegP reg)
56265617
%{
5627-
constraint(ALLOC_IN_RC(method_reg)); // interpreter_method_oop_reg
5618+
constraint(ALLOC_IN_RC(method_reg)); // interpreter_method_reg
56285619
match(reg);
56295620
match(iRegPNoSp);
56305621
op_cost(0);

src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
101101

102102
frame_pointers_t *new_frame = (frame_pointers_t *)(return_address_ptr - 5);
103103

104-
JavaThread *thread = (JavaThread*)Thread::current();
104+
JavaThread *thread = JavaThread::current();
105105
RegisterMap reg_map(thread, false);
106106
frame frame = thread->last_frame();
107107

@@ -111,14 +111,11 @@ void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
111111

112112
LogTarget(Trace, nmethod, barrier) out;
113113
if (out.is_enabled()) {
114-
Thread* thread = Thread::current();
115-
assert(thread->is_Java_thread(), "must be JavaThread");
116-
JavaThread* jth = (JavaThread*) thread;
117114
ResourceMark mark;
118115
log_trace(nmethod, barrier)("deoptimize(nmethod: %s(%p), return_addr: %p, osr: %d, thread: %p(%s), making rsp: %p) -> %p",
119116
nm->method()->name_and_sig_as_C_string(),
120-
nm, *(address *) return_address_ptr, nm->is_osr_method(), jth,
121-
jth->get_thread_name(), frame.sp(), nm->verified_entry_point());
117+
nm, *(address *) return_address_ptr, nm->is_osr_method(), thread,
118+
thread->get_thread_name(), frame.sp(), nm->verified_entry_point());
122119
}
123120

124121
new_frame->sp = frame.sp();

src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,9 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_native(MacroAssembler
302302

303303
void ShenandoahBarrierSetAssembler::storeval_barrier(MacroAssembler* masm, Register dst, Register tmp) {
304304
if (ShenandoahStoreValEnqueueBarrier) {
305-
// Save possibly live regs.
306-
RegSet live_regs = RegSet::range(r0, r4) - dst;
307-
__ push(live_regs, sp);
308-
__ strd(v0, __ pre(sp, 2 * -wordSize));
309-
305+
__ push_call_clobbered_registers();
310306
satb_write_barrier_pre(masm, noreg, dst, rthread, tmp, true, false);
311-
312-
// Restore possibly live regs.
313-
__ ldrd(v0, __ post(sp, 2 * wordSize));
314-
__ pop(live_regs, sp);
307+
__ pop_call_clobbered_registers();
315308
}
316309
}
317310

src/hotspot/cpu/aarch64/gc/z/zGlobals_aarch64.cpp

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@
2222
*/
2323

2424
#include "precompiled.hpp"
25+
#include "gc/shared/gcLogPrecious.hpp"
2526
#include "gc/z/zGlobals.hpp"
2627
#include "runtime/globals.hpp"
28+
#include "runtime/os.hpp"
2729
#include "utilities/globalDefinitions.hpp"
2830
#include "utilities/powerOfTwo.hpp"
2931

32+
#ifdef LINUX
33+
#include <sys/mman.h>
34+
#endif // LINUX
35+
3036
//
3137
// The heap can have three different layouts, depending on the max heap size.
3238
//
@@ -135,9 +141,64 @@
135141
// * 63-48 Fixed (16-bits, always zero)
136142
//
137143

144+
// Default value if probing is not implemented for a certain platform: 128TB
145+
static const size_t DEFAULT_MAX_ADDRESS_BIT = 47;
146+
// Minimum value returned, if probing fails: 64GB
147+
static const size_t MINIMUM_MAX_ADDRESS_BIT = 36;
148+
149+
static size_t probe_valid_max_address_bit() {
150+
#ifdef LINUX
151+
size_t max_address_bit = 0;
152+
const size_t page_size = os::vm_page_size();
153+
for (size_t i = DEFAULT_MAX_ADDRESS_BIT; i > MINIMUM_MAX_ADDRESS_BIT; --i) {
154+
const uintptr_t base_addr = ((uintptr_t) 1U) << i;
155+
if (msync((void*)base_addr, page_size, MS_ASYNC) == 0) {
156+
// msync suceeded, the address is valid, and maybe even already mapped.
157+
max_address_bit = i;
158+
break;
159+
}
160+
if (errno != ENOMEM) {
161+
// Some error occured. This should never happen, but msync
162+
// has some undefined behavior, hence ignore this bit.
163+
#ifdef ASSERT
164+
fatal("Received '%s' while probing the address space for the highest valid bit", os::errno_name(errno));
165+
#else // ASSERT
166+
log_warning_p(gc)("Received '%s' while probing the address space for the highest valid bit", os::errno_name(errno));
167+
#endif // ASSERT
168+
continue;
169+
}
170+
// Since msync failed with ENOMEM, the page might not be mapped.
171+
// Try to map it, to see if the address is valid.
172+
void* const result_addr = mmap((void*) base_addr, page_size, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0);
173+
if (result_addr != MAP_FAILED) {
174+
munmap(result_addr, page_size);
175+
}
176+
if ((uintptr_t) result_addr == base_addr) {
177+
// address is valid
178+
max_address_bit = i;
179+
break;
180+
}
181+
}
182+
if (max_address_bit == 0) {
183+
// probing failed, allocate a very high page and take that bit as the maximum
184+
const uintptr_t high_addr = ((uintptr_t) 1U) << DEFAULT_MAX_ADDRESS_BIT;
185+
void* const result_addr = mmap((void*) high_addr, page_size, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0);
186+
if (result_addr != MAP_FAILED) {
187+
max_address_bit = BitsPerSize_t - count_leading_zeros((size_t) result_addr) - 1;
188+
munmap(result_addr, page_size);
189+
}
190+
}
191+
log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
192+
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
193+
#else // LINUX
194+
return DEFAULT_MAX_ADDRESS_BIT;
195+
#endif // LINUX
196+
}
197+
138198
size_t ZPlatformAddressOffsetBits() {
139-
const size_t min_address_offset_bits = 42; // 4TB
140-
const size_t max_address_offset_bits = 44; // 16TB
199+
const static size_t valid_max_address_offset_bits = probe_valid_max_address_bit() + 1;
200+
const size_t max_address_offset_bits = valid_max_address_offset_bits - 3;
201+
const size_t min_address_offset_bits = max_address_offset_bits - 2;
141202
const size_t address_offset = round_up_power_of_2(MaxHeapSize * ZVirtualToPhysicalRatio);
142203
const size_t address_offset_bits = log2_intptr(address_offset);
143204
return clamp(address_offset_bits, min_address_offset_bits, max_address_offset_bits);

src/hotspot/cpu/aarch64/globals_aarch64.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ define_pd_global(intx, InitArrayShortSize, BytesPerLong);
7575
define_pd_global(intx, InlineSmallCode, 1000);
7676
#endif
7777

78-
#define ARCH_FLAGS(develop, \
79-
product, \
80-
diagnostic, \
81-
experimental, \
82-
notproduct, \
83-
range, \
84-
constraint) \
78+
#define ARCH_FLAGS(develop, \
79+
product, \
80+
notproduct, \
81+
range, \
82+
constraint) \
8583
\
8684
product(bool, NearCpool, true, \
8785
"constant pool is close to instructions") \
@@ -113,4 +111,6 @@ define_pd_global(intx, InlineSmallCode, 1000);
113111
"Value -1 means off.") \
114112
range(-1, 4096)
115113

114+
// end of ARCH_FLAGS
115+
116116
#endif // CPU_AARCH64_GLOBALS_AARCH64_HPP

0 commit comments

Comments
 (0)