Skip to content

Commit 0942f92

Browse files
committed
Merge branch 'master' of https://github.com/doom369/jdk into reaplce_equals_with_is_empty
2 parents 1b59f3f + 6a00534 commit 0942f92

File tree

168 files changed

+1002
-544
lines changed

Some content is hidden

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

168 files changed

+1002
-544
lines changed

.jcheck/conf

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1+
[general]
12
project=jdk
2-
bugids=dup
3+
jbs=JDK
4+
5+
[checks]
6+
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
7+
8+
[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)
10+
branches=
11+
12+
[census]
13+
version=0
14+
domain=openjdk.org
15+
16+
[checks "whitespace"]
17+
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java
18+
19+
[checks "merge"]
20+
message=Merge
21+
22+
[checks "reviewers"]
23+
reviewers=1
24+
ignore=duke
25+
26+
[checks "committer"]
27+
role=committer
28+
29+
[checks "issues"]
30+
pattern=^([124-8][0-9]{6}): (\S.*)$

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"

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/ppc/c1_LIRAssembler_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2019, SAP SE. All rights reserved.
3+
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2019, SAP SE. All rights reserved.
3+
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2018, 2019, SAP SE. All rights reserved.
3+
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2018, SAP SE. All rights reserved.
3+
* Copyright (c) 2018 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2018, SAP SE. All rights reserved.
3+
* Copyright (c) 2018 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2018, SAP SE. All rights reserved.
3+
* Copyright (c) 2018 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

0 commit comments

Comments
 (0)