Skip to content

Commit 27c9bdc

Browse files
authored
Merge pull request #1859 from SAP/pr-jdk-21.0.6+2
Merge to tag jdk-21.0.6+2
2 parents 7b30001 + bb60a42 commit 27c9bdc

File tree

75 files changed

+11708
-1100
lines changed

Some content is hidden

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

75 files changed

+11708
-1100
lines changed

.github/workflows/build-cross-compile.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- target-cpu: riscv64
8585
gnu-arch: riscv64
8686
debian-arch: riscv64
87-
debian-repository: https://snapshot.debian.org/archive/debian/20240228T034848Z/
87+
debian-repository: https://httpredir.debian.org/debian/
8888
debian-version: sid
8989
tolerate-sysroot-errors: true
9090

@@ -131,6 +131,7 @@ jobs:
131131
id: create-sysroot
132132
run: >
133133
sudo debootstrap
134+
--no-merged-usr
134135
--arch=${{ matrix.debian-arch }}
135136
--verbose
136137
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
@@ -151,6 +152,9 @@ jobs:
151152
rm -rf sysroot/usr/{sbin,bin,share}
152153
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
153154
rm -rf sysroot/usr/libexec/gcc
155+
# /{bin,sbin,lib}/ are not symbolic links to /usr/{bin,sbin,lib}/ when debootstrap with --no-merged-usr
156+
rm -rf sysroot/{sbin,bin}
157+
rm -rf sysroot/lib/{udev,systemd}
154158
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
155159

156160
- name: 'Remove broken sysroot'

make/common/NativeCompilation.gmk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,21 @@ DEPENDENCY_TARGET_SED_PATTERN := \
215215
# The fix-deps-file macro is used to adjust the contents of the generated make
216216
# dependency files to contain paths compatible with make.
217217
#
218+
REWRITE_PATHS_RELATIVE = false
218219
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)-$(FILE_MACRO_CFLAGS), false-)
220+
REWRITE_PATHS_RELATIVE = true
221+
endif
222+
223+
# CCACHE_BASEDIR needs fix-deps-file as makefiles use absolute filenames for
224+
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
225+
# its compiler. The compiler then produces relative dependency files.
226+
# make does not know a relative and absolute filename is the same so it will
227+
# ignore such dependencies.
228+
ifneq ($(CCACHE), )
229+
REWRITE_PATHS_RELATIVE = true
230+
endif
231+
232+
ifeq ($(REWRITE_PATHS_RELATIVE), true)
219233
# Need to handle -I flags as both '-Ifoo' and '-I foo'.
220234
MakeCommandRelative = \
221235
$(CD) $(WORKSPACE_ROOT) && \

make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ private void load(List<Path> files) throws IOException {
164164
}
165165
continue;
166166
}
167-
if (line.startsWith("Zone")) { // parse Zone line
167+
int token0len = tokens.length > 0 ? tokens[0].length() : line.length();
168+
if (line.regionMatches(true, 0, "Zone", 0, token0len)) { // parse Zone line
168169
String name = tokens[1];
169170
if (excludedZones.contains(name)){
170171
continue;
@@ -182,13 +183,13 @@ private void load(List<Path> files) throws IOException {
182183
if (zLine.parse(tokens, 2)) {
183184
openZone = null;
184185
}
185-
} else if (line.startsWith("Rule")) { // parse Rule line
186+
} else if (line.regionMatches(true, 0, "Rule", 0, token0len)) { // parse Rule line
186187
String name = tokens[1];
187188
if (!rules.containsKey(name)) {
188189
rules.put(name, new ArrayList<RuleLine>(10));
189190
}
190191
rules.get(name).add(new RuleLine().parse(tokens));
191-
} else if (line.startsWith("Link")) { // parse link line
192+
} else if (line.regionMatches(true, 0, "Link", 0, token0len)) { // parse link line
192193
if (tokens.length >= 3) {
193194
String realId = tokens[1];
194195
String aliasId = tokens[2];
@@ -304,7 +305,7 @@ private void parse(String[] tokens, int off) {
304305
month = parseMonth(tokens[off++]);
305306
if (off < tokens.length) {
306307
String dayRule = tokens[off++];
307-
if (dayRule.startsWith("last")) {
308+
if (dayRule.regionMatches(true, 0, "last", 0, 4)) {
308309
dayOfMonth = -1;
309310
dayOfWeek = parseDayOfWeek(dayRule.substring(4));
310311
adjustForwards = false;
@@ -355,11 +356,12 @@ private void parse(String[] tokens, int off) {
355356
}
356357

357358
int parseYear(String year, int defaultYear) {
358-
switch (year.toLowerCase()) {
359-
case "min": return 1900;
360-
case "max": return Year.MAX_VALUE;
361-
case "only": return defaultYear;
362-
}
359+
int len = year.length();
360+
361+
if (year.regionMatches(true, 0, "minimum", 0, len)) return 1900;
362+
if (year.regionMatches(true, 0, "maximum", 0, len)) return Year.MAX_VALUE;
363+
if (year.regionMatches(true, 0, "only", 0, len)) return defaultYear;
364+
363365
return Integer.parseInt(year);
364366
}
365367

src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,19 @@ void LIR_Assembler::osr_entry() {
134134
// copied into place by code emitted in the IR.
135135

136136
Register OSR_buf = osrBufferPointer()->as_register();
137-
{ assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below");
138-
int monitor_offset = BytesPerWord * method()->max_locals() +
139-
(2 * BytesPerWord) * (number_of_locks - 1);
137+
{
138+
assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below");
139+
140+
const int locals_space = BytesPerWord * method() -> max_locals();
141+
int monitor_offset = locals_space + (2 * BytesPerWord) * (number_of_locks - 1);
142+
bool large_offset = !Immediate::is_simm20(monitor_offset + BytesPerWord) && number_of_locks > 0;
143+
144+
if (large_offset) {
145+
// z_lg can only handle displacement upto 20bit signed binary integer
146+
__ z_algfi(OSR_buf, locals_space);
147+
monitor_offset -= locals_space;
148+
}
149+
140150
// SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
141151
// the OSR buffer using 2 word entries: first the lock and then
142152
// the oop.
@@ -150,6 +160,10 @@ void LIR_Assembler::osr_entry() {
150160
__ z_lg(Z_R1_scratch, slot_offset + 1*BytesPerWord, OSR_buf);
151161
__ z_stg(Z_R1_scratch, frame_map()->address_for_monitor_object(i));
152162
}
163+
164+
if (large_offset) {
165+
__ z_slgfi(OSR_buf, locals_space);
166+
}
153167
}
154168
}
155169

src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ void ShenandoahBarrierC2Support::fix_ctrl(Node* barrier, Node* region, const Mem
10481048
Node* u = ctrl->fast_out(i);
10491049
if (u->_idx < last &&
10501050
u != barrier &&
1051+
!u->depends_only_on_test() && // preserve dependency on test
10511052
!uses_to_ignore.member(u) &&
10521053
(u->in(0) != ctrl || (!u->is_Region() && !u->is_Phi())) &&
10531054
(ctrl->Opcode() != Op_CatchProj || u->Opcode() != Op_CreateEx)) {

src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,19 +614,17 @@ void ShenandoahFreeSet::print_on(outputStream* out) const {
614614
double ShenandoahFreeSet::internal_fragmentation() {
615615
double squared = 0;
616616
double linear = 0;
617-
int count = 0;
618617

619618
for (size_t index = _mutator_leftmost; index <= _mutator_rightmost; index++) {
620619
if (is_mutator_free(index)) {
621620
ShenandoahHeapRegion* r = _heap->get_region(index);
622621
size_t used = r->used();
623622
squared += used * used;
624623
linear += used;
625-
count++;
626624
}
627625
}
628626

629-
if (count > 0) {
627+
if (linear > 0) {
630628
double s = squared / (ShenandoahHeapRegion::region_size_bytes() * linear);
631629
return 1 - s;
632630
} else {

src/hotspot/share/opto/compile.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,12 +1461,18 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
14611461
} else {
14621462
ciInstanceKlass *canonical_holder = ik->get_canonical_holder(offset);
14631463
assert(offset < canonical_holder->layout_helper_size_in_bytes(), "");
1464-
if (!ik->equals(canonical_holder) || tj->offset() != offset) {
1465-
if( is_known_inst ) {
1466-
tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, true, nullptr, offset, to->instance_id());
1467-
} else {
1468-
tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, false, nullptr, offset);
1469-
}
1464+
assert(tj->offset() == offset, "no change to offset expected");
1465+
bool xk = to->klass_is_exact();
1466+
int instance_id = to->instance_id();
1467+
1468+
// If the input type's class is the holder: if exact, the type only includes interfaces implemented by the holder
1469+
// but if not exact, it may include extra interfaces: build new type from the holder class to make sure only
1470+
// its interfaces are included.
1471+
if (xk && ik->equals(canonical_holder)) {
1472+
assert(tj == TypeInstPtr::make(to->ptr(), canonical_holder, is_known_inst, nullptr, offset, instance_id), "exact type should be canonical type");
1473+
} else {
1474+
assert(xk || !is_known_inst, "Known instance should be exact type");
1475+
tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, is_known_inst, nullptr, offset, instance_id);
14701476
}
14711477
}
14721478
}

src/hotspot/share/opto/gcm.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,20 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
648648
// The anti-dependence constraints apply only to the fringe of this tree.
649649

650650
Node* initial_mem = load->in(MemNode::Memory);
651+
// We don't optimize the memory graph for pinned loads, so we may need to raise the
652+
// root of our search tree through the corresponding slices of MergeMem nodes to
653+
// get to the node that really creates the memory state for this slice.
654+
if (load_alias_idx >= Compile::AliasIdxRaw) {
655+
while (initial_mem->is_MergeMem()) {
656+
MergeMemNode* mm = initial_mem->as_MergeMem();
657+
Node* p = mm->memory_at(load_alias_idx);
658+
if (p != mm->base_memory()) {
659+
initial_mem = p;
660+
} else {
661+
break;
662+
}
663+
}
664+
}
651665
worklist_store.push(initial_mem);
652666
worklist_visited.push(initial_mem);
653667
worklist_mem.push(nullptr);

src/hotspot/share/opto/graphKit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,7 @@ Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
15541554
bool mismatched,
15551555
bool unsafe,
15561556
uint8_t barrier_data) {
1557+
assert(adr_idx == C->get_alias_index(_gvn.type(adr)->isa_ptr()), "slice of address and input slice don't match");
15571558
assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
15581559
const TypePtr* adr_type = nullptr; // debug-mode-only argument
15591560
debug_only(adr_type = C->get_adr_type(adr_idx));
@@ -1576,6 +1577,7 @@ Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
15761577
bool unsafe,
15771578
int barrier_data) {
15781579
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
1580+
assert(adr_idx == C->get_alias_index(_gvn.type(adr)->isa_ptr()), "slice of address and input slice don't match");
15791581
const TypePtr* adr_type = nullptr;
15801582
debug_only(adr_type = C->get_adr_type(adr_idx));
15811583
Node *mem = memory(adr_idx);

src/hotspot/share/opto/library_call.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,11 +2885,10 @@ bool LibraryCallKit::inline_native_notify_jvmti_funcs(address funcAddr, const ch
28852885
Node* thread = ideal.thread();
28862886
Node* jt_addr = basic_plus_adr(thread, in_bytes(JavaThread::is_in_VTMS_transition_offset()));
28872887
Node* vt_addr = basic_plus_adr(vt_oop, java_lang_Thread::is_in_VTMS_transition_offset());
2888-
const TypePtr *addr_type = _gvn.type(addr)->isa_ptr();
28892888

28902889
sync_kit(ideal);
2891-
access_store_at(nullptr, jt_addr, addr_type, hide, _gvn.type(hide), T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
2892-
access_store_at(nullptr, vt_addr, addr_type, hide, _gvn.type(hide), T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
2890+
access_store_at(nullptr, jt_addr, _gvn.type(jt_addr)->is_ptr(), hide, _gvn.type(hide), T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
2891+
access_store_at(nullptr, vt_addr, _gvn.type(vt_addr)->is_ptr(), hide, _gvn.type(hide), T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
28932892

28942893
ideal.sync_kit(this);
28952894
} ideal.end_if();
@@ -3224,7 +3223,9 @@ bool LibraryCallKit::inline_native_getEventWriter() {
32243223

32253224
// Load the raw epoch value from the threadObj.
32263225
Node* threadObj_epoch_offset = basic_plus_adr(threadObj, java_lang_Thread::jfr_epoch_offset());
3227-
Node* threadObj_epoch_raw = access_load_at(threadObj, threadObj_epoch_offset, TypeRawPtr::BOTTOM, TypeInt::CHAR, T_CHAR,
3226+
Node* threadObj_epoch_raw = access_load_at(threadObj, threadObj_epoch_offset,
3227+
_gvn.type(threadObj_epoch_offset)->isa_ptr(),
3228+
TypeInt::CHAR, T_CHAR,
32283229
IN_HEAP | MO_UNORDERED | C2_MISMATCHED | C2_CONTROL_DEPENDENT_LOAD);
32293230

32303231
// Mask off the excluded information from the epoch.
@@ -3239,7 +3240,8 @@ bool LibraryCallKit::inline_native_getEventWriter() {
32393240

32403241
// Load the raw epoch value from the vthread.
32413242
Node* vthread_epoch_offset = basic_plus_adr(vthread, java_lang_Thread::jfr_epoch_offset());
3242-
Node* vthread_epoch_raw = access_load_at(vthread, vthread_epoch_offset, TypeRawPtr::BOTTOM, TypeInt::CHAR, T_CHAR,
3243+
Node* vthread_epoch_raw = access_load_at(vthread, vthread_epoch_offset, _gvn.type(vthread_epoch_offset)->is_ptr(),
3244+
TypeInt::CHAR, T_CHAR,
32433245
IN_HEAP | MO_UNORDERED | C2_MISMATCHED | C2_CONTROL_DEPENDENT_LOAD);
32443246

32453247
// Mask off the excluded information from the epoch.
@@ -3475,7 +3477,7 @@ void LibraryCallKit::extend_setCurrentThread(Node* jt, Node* thread) {
34753477

34763478
// Load the raw epoch value from the vthread.
34773479
Node* epoch_offset = basic_plus_adr(thread, java_lang_Thread::jfr_epoch_offset());
3478-
Node* epoch_raw = access_load_at(thread, epoch_offset, TypeRawPtr::BOTTOM, TypeInt::CHAR, T_CHAR,
3480+
Node* epoch_raw = access_load_at(thread, epoch_offset, _gvn.type(epoch_offset)->is_ptr(), TypeInt::CHAR, T_CHAR,
34793481
IN_HEAP | MO_UNORDERED | C2_MISMATCHED | C2_CONTROL_DEPENDENT_LOAD);
34803482

34813483
// Mask off the excluded information from the epoch.

0 commit comments

Comments
 (0)