Skip to content

Commit 675e716

Browse files
authored
Merge branch 'openjdk:master' into backport-sendaoYan-fe29cad5-master
2 parents 4af8ce3 + a64ed9d commit 675e716

File tree

346 files changed

+14624
-4927
lines changed

Some content is hidden

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

346 files changed

+14624
-4927
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,33 @@ jobs:
6060
gnu-arch: aarch64
6161
debian-arch: arm64
6262
debian-repository: https://httpredir.debian.org/debian/
63-
debian-version: bookworm
63+
debian-version: trixie
6464
tolerate-sysroot-errors: false
6565
- target-cpu: arm
6666
gnu-arch: arm
6767
debian-arch: armhf
6868
debian-repository: https://httpredir.debian.org/debian/
69-
debian-version: bookworm
69+
debian-version: trixie
7070
tolerate-sysroot-errors: false
7171
gnu-abi: eabihf
7272
- target-cpu: s390x
7373
gnu-arch: s390x
7474
debian-arch: s390x
7575
debian-repository: https://httpredir.debian.org/debian/
76-
debian-version: bookworm
76+
debian-version: trixie
7777
tolerate-sysroot-errors: false
7878
- target-cpu: ppc64le
7979
gnu-arch: powerpc64le
8080
debian-arch: ppc64el
8181
debian-repository: https://httpredir.debian.org/debian/
82-
debian-version: bookworm
82+
debian-version: trixie
8383
tolerate-sysroot-errors: false
8484
- target-cpu: riscv64
8585
gnu-arch: riscv64
8686
debian-arch: riscv64
8787
debian-repository: https://httpredir.debian.org/debian/
88-
debian-version: sid
89-
tolerate-sysroot-errors: true
88+
debian-version: trixie
89+
tolerate-sysroot-errors: false
9090

9191
steps:
9292
- name: 'Checkout the JDK source'

make/RunTests.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ UseSpecialTestHandler = \
10551055
# Now process each test to run and setup a proper make rule
10561056
$(foreach test, $(TESTS_TO_RUN), \
10571057
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
1058-
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \
1058+
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
10591059
$(eval ALL_TEST_IDS += $(TEST_ID)) \
10601060
$(if $(call UseCustomTestHandler, $(test)), \
10611061
$(eval $(call SetupRunCustomTest, $(TEST_ID), \
@@ -1135,9 +1135,9 @@ run-test-report: post-run-test
11351135
TEST TOTAL PASS FAIL ERROR " "
11361136
$(foreach test, $(TESTS_TO_RUN), \
11371137
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
1138-
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \
1138+
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
11391139
$(ECHO) >> $(TEST_LAST_IDS) $(TEST_ID) $(NEWLINE) \
1140-
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '[_*1000]')) \
1140+
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '_')) \
11411141
$(if $(filter __________________________________________________%, $(NAME_PATTERN)), \
11421142
$(eval TEST_NAME := ) \
11431143
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s\n" " " "$(test)" $(NEWLINE) \

make/data/currency/CurrencyData.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ formatVersion=3
3232
# Version of the currency code information in this class.
3333
# It is a serial number that accompanies with each amendment.
3434

35-
dataVersion=179
35+
dataVersion=180
3636

3737
# List of all valid ISO 4217 currency codes.
3838
# To ensure compatibility, do not remove codes.
@@ -147,7 +147,7 @@ IO=USD
147147
# BRUNEI DARUSSALAM
148148
BN=BND
149149
# BULGARIA
150-
BG=BGN
150+
BG=BGN;2025-12-31-22-00-00;EUR
151151
# BURKINA FASO
152152
BF=XOF
153153
# BURUNDI
@@ -193,7 +193,7 @@ HR=EUR
193193
# CUBA
194194
CU=CUP
195195
# Cura\u00e7ao
196-
CW=ANG;2025-04-01-04-00-00;XCG
196+
CW=XCG
197197
# CYPRUS
198198
CY=EUR
199199
# CZECHIA
@@ -510,7 +510,7 @@ SR=SRD
510510
# SVALBARD AND JAN MAYEN
511511
SJ=NOK
512512
# Sint Maarten (Dutch part)
513-
SX=ANG;2025-04-01-04-00-00;XCG
513+
SX=XCG
514514
# ESWATINI
515515
SZ=SZL
516516
# SWEDEN

src/hotspot/cpu/ppc/frame_ppc.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ bool frame::safe_for_sender(JavaThread *thread) {
114114
return false;
115115
}
116116

117-
abi_minframe* sender_abi = (abi_minframe*) fp;
117+
volatile abi_minframe* sender_abi = (abi_minframe*) fp; // May get updated concurrently by deoptimization!
118118
intptr_t* sender_sp = (intptr_t*) fp;
119-
address sender_pc = (address) sender_abi->lr;;
119+
address sender_pc = (address) sender_abi->lr;
120120

121121
// We must always be able to find a recognizable pc.
122122
CodeBlob* sender_blob = CodeCache::find_blob_unsafe(sender_pc);
@@ -129,9 +129,20 @@ bool frame::safe_for_sender(JavaThread *thread) {
129129
return false;
130130
}
131131

132+
intptr_t* unextended_sender_sp = is_interpreted_frame() ? (intptr_t*)get_ijava_state()->sender_sp : sender_sp;
133+
132134
// It should be safe to construct the sender though it might not be valid.
133135

134-
frame sender(sender_sp, sender_pc);
136+
// JDK-8339386 is different than the upstream version:
137+
// The frame constructor doesn't check sanity of a deopt pc, but determines it.
138+
// Other accessors for reading it are not available in 17u.
139+
frame sender(sender_sp, sender_pc, unextended_sender_sp);
140+
// If the sender is a deoptimized nmethod we need to check if the original pc is valid.
141+
nmethod* sender_nm = sender_blob->as_nmethod_or_null();
142+
if (sender_nm != nullptr && sender._deopt_state == is_deoptimized) {
143+
address orig_pc = sender.pc();
144+
if (!sender_nm->insts_contains_inclusive(orig_pc)) return false;
145+
}
135146

136147
// Do we have a valid fp?
137148
address sender_fp = (address) sender.fp();

src/hotspot/os/linux/cgroupSubsystem_linux.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "utilities/globalDefinitions.hpp"
3636

3737
// controller names have to match the *_IDX indices
38-
static const char* cg_controller_name[] = { "cpu", "cpuset", "cpuacct", "memory", "pids" };
38+
static const char* cg_controller_name[] = { "cpuset", "cpu", "cpuacct", "memory", "pids" };
3939

4040
CgroupSubsystem* CgroupSubsystemFactory::create() {
4141
CgroupV1MemoryController* memory = NULL;
@@ -159,9 +159,10 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
159159
char buf[MAXPATHLEN+1];
160160
char *p;
161161
bool is_cgroupsV2;
162-
// true iff all required controllers, memory, cpu, cpuset, cpuacct are enabled
162+
// true iff all required controllers, memory, cpu, cpuacct are enabled
163163
// at the kernel level.
164164
// pids might not be enabled on older Linux distros (SLES 12.1, RHEL 7.1)
165+
// cpuset might not be enabled on newer Linux distros (Fedora 41)
165166
bool all_required_controllers_enabled;
166167

167168
/*
@@ -193,6 +194,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
193194
cg_infos[MEMORY_IDX]._hierarchy_id = hierarchy_id;
194195
cg_infos[MEMORY_IDX]._enabled = (enabled == 1);
195196
} else if (strcmp(name, "cpuset") == 0) {
197+
log_debug(os, container)("Detected optional cpuset controller entry in %s", proc_cgroups);
196198
cg_infos[CPUSET_IDX]._name = os::strdup(name);
197199
cg_infos[CPUSET_IDX]._hierarchy_id = hierarchy_id;
198200
cg_infos[CPUSET_IDX]._enabled = (enabled == 1);
@@ -216,8 +218,8 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
216218
is_cgroupsV2 = true;
217219
all_required_controllers_enabled = true;
218220
for (int i = 0; i < CG_INFO_LENGTH; i++) {
219-
// pids controller is optional. All other controllers are required
220-
if (i != PIDS_IDX) {
221+
// pids and cpuset controllers are optional. All other controllers are required
222+
if (i != PIDS_IDX && i != CPUSET_IDX) {
221223
is_cgroupsV2 = is_cgroupsV2 && cg_infos[i]._hierarchy_id == 0;
222224
all_required_controllers_enabled = all_required_controllers_enabled && cg_infos[i]._enabled;
223225
}

src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2014 SAP SE. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
44
* Copyright (c) 2022, IBM Corp.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
*
@@ -27,6 +27,7 @@
2727
#include "precompiled.hpp"
2828
#include "memory/metaspace.hpp"
2929
#include "runtime/frame.inline.hpp"
30+
#include "runtime/os.inline.hpp"
3031
#include "runtime/thread.hpp"
3132

3233
frame JavaThread::pd_last_frame() {
@@ -54,9 +55,19 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
5455
if (has_last_Java_frame() && frame_anchor()->walkable()) {
5556
intptr_t* sp = last_Java_sp();
5657
address pc = _anchor.last_Java_pc();
57-
// pc can be seen as null because not all writers use store pc + release store sp.
58-
// Simply discard the sample in this very rare case.
59-
if (pc == nullptr) return false;
58+
if (pc == nullptr) {
59+
// This is not uncommon. Many c1/c2 runtime stubs do not set the pc in the anchor.
60+
intptr_t* top_sp = os::Aix::ucontext_get_sp((const ucontext_t*)ucontext);
61+
if ((uint64_t)sp <= ((frame::abi_minframe*)top_sp)->callers_sp) {
62+
// The interrupt occurred either in the last java frame or in its direct callee.
63+
// We cannot be sure that the link register LR was already saved to the
64+
// java frame. Therefore we discard this sample.
65+
return false;
66+
}
67+
// The last java pc will be found in the abi part of the last java frame.
68+
*fr_addr = frame(sp);
69+
return true;
70+
}
6071
*fr_addr = frame(sp, pc);
6172
return true;
6273
}

src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2022 SAP SE. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2012, 2025 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
@@ -26,6 +26,7 @@
2626
#include "precompiled.hpp"
2727
#include "memory/metaspace.hpp"
2828
#include "runtime/frame.inline.hpp"
29+
#include "runtime/os.hpp"
2930
#include "runtime/thread.hpp"
3031

3132
frame JavaThread::pd_last_frame() {
@@ -53,9 +54,19 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
5354
if (has_last_Java_frame() && frame_anchor()->walkable()) {
5455
intptr_t* sp = last_Java_sp();
5556
address pc = _anchor.last_Java_pc();
56-
// pc can be seen as null because not all writers use store pc + release store sp.
57-
// Simply discard the sample in this very rare case.
58-
if (pc == nullptr) return false;
57+
if (pc == nullptr) {
58+
// This is not uncommon. Many c1/c2 runtime stubs do not set the pc in the anchor.
59+
intptr_t* top_sp = os::Linux::ucontext_get_sp((const ucontext_t*)ucontext);
60+
if ((uint64_t)sp <= ((frame::abi_minframe*)top_sp)->callers_sp) {
61+
// The interrupt occurred either in the last java frame or in its direct callee.
62+
// We cannot be sure that the link register LR was already saved to the
63+
// java frame. Therefore we discard this sample.
64+
return false;
65+
}
66+
// The last java pc will be found in the abi part of the last java frame.
67+
*fr_addr = frame(sp);
68+
return true;
69+
}
5970
*fr_addr = frame(sp, pc);
6071
return true;
6172
}

src/hotspot/share/classfile/classLoaderData.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,14 +985,23 @@ void ClassLoaderData::print_on(outputStream* out) const {
985985
}
986986
out->print_cr(" - handles %d", _handles.count());
987987
out->print_cr(" - dependency count %d", _dependency_count);
988-
out->print (" - klasses {");
989-
PrintKlassClosure closure(out);
990-
((ClassLoaderData*)this)->classes_do(&closure);
988+
out->print (" - klasses { ");
989+
if (Verbose) {
990+
PrintKlassClosure closure(out);
991+
((ClassLoaderData*)this)->classes_do(&closure);
992+
} else {
993+
out->print("...");
994+
}
991995
out->print_cr(" }");
992996
out->print_cr(" - packages " INTPTR_FORMAT, p2i(_packages));
993997
out->print_cr(" - module " INTPTR_FORMAT, p2i(_modules));
994998
out->print_cr(" - unnamed module " INTPTR_FORMAT, p2i(_unnamed_module));
995-
out->print_cr(" - dictionary " INTPTR_FORMAT, p2i(_dictionary));
999+
if (_dictionary != nullptr) {
1000+
out->print (" - dictionary " INTPTR_FORMAT " ", p2i(_dictionary));
1001+
_dictionary->print_size(out);
1002+
} else {
1003+
out->print_cr(" - dictionary " INTPTR_FORMAT, p2i(_dictionary));
1004+
}
9961005
if (_jmethod_ids != NULL) {
9971006
out->print (" - jmethod count ");
9981007
Method::print_jmethod_ids_count(this, out);

src/hotspot/share/classfile/dictionary.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,17 @@ void DictionaryEntry::print_count(outputStream *st) {
586586

587587
// ----------------------------------------------------------------------------
588588

589+
void Dictionary::print_size(outputStream* st) const {
590+
st->print_cr("Java dictionary (table_size=%d, classes=%d, resizable=%s)",
591+
table_size(), number_of_entries(), BOOL_TO_STR(_resizable));
592+
}
593+
589594
void Dictionary::print_on(outputStream* st) const {
590595
ResourceMark rm;
591596

592597
assert(loader_data() != NULL, "loader data should not be null");
593598
assert(!loader_data()->has_class_mirror_holder(), "cld should have a ClassLoader holder not a Class holder");
594-
st->print_cr("Java dictionary (table_size=%d, classes=%d, resizable=%s)",
595-
table_size(), number_of_entries(), BOOL_TO_STR(_resizable));
599+
print_size(st);
596600
st->print_cr("^ indicates that initiating loader is different from defining loader");
597601

598602
for (int index = 0; index < table_size(); index++) {

src/hotspot/share/classfile/dictionary.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -79,6 +79,7 @@ class Dictionary : public Hashtable<InstanceKlass*, mtClass> {
7979
TRAPS);
8080

8181
void print_on(outputStream* st) const;
82+
void print_size(outputStream* st) const;
8283
void verify();
8384

8485
private:

0 commit comments

Comments
 (0)