Skip to content

Commit a335b49

Browse files
[GR-59040] Merge in jdk-23.0.2+3 (24.1)
PullRequest: labsjdk-ce/123
2 parents 1d63399 + dbe8621 commit a335b49

File tree

144 files changed

+5680
-1810
lines changed

Some content is hidden

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

144 files changed

+5680
-1810
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ local contains(str, needle) = std.findSubstr(needle, str) != [];
5858
},
5959
},
6060
Linux:: self.OSBase + {
61-
capabilities+: ["linux"],
61+
capabilities+: ["linux", "!e3"],
6262
name+: "-linux",
6363
os:: "linux",
6464
},

make/autoconf/toolchain.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
358358
# Copyright (C) 2013 Free Software Foundation, Inc.
359359
# This is free software; see the source for copying conditions. There is NO
360360
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
361+
# or look like
362+
# gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)
363+
# Copyright (C) 2020 Free Software Foundation, Inc.
364+
# This is free software; see the source for copying conditions. There is NO
365+
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
361366
COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
362367
# Check that this is likely to be GCC.
363368
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null
@@ -371,7 +376,8 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
371376
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
372377
$SED -e 's/ *Copyright .*//'`
373378
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
374-
$SED -e 's/^.* \(@<:@1-9@:>@<:@0-9@:>@*\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'`
379+
$AWK -F ')' '{print [$]2}' | \
380+
$AWK '{print [$]1}'`
375381
elif test "x$TOOLCHAIN_TYPE" = xclang; then
376382
# clang --version output typically looks like
377383
# Apple clang version 15.0.0 (clang-1500.3.9.4)

make/conf/version-numbers.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
4040
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23"
4141
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
42-
DEFAULT_PROMOTED_VERSION_PRE=ea
42+
DEFAULT_PROMOTED_VERSION_PRE=

make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,10 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
786786
String tzKey = Optional.ofNullable((String)handlerSupplMeta.get(tzid))
787787
.orElse(tzid);
788788
// Follow link, if needed
789-
var tzLink = tzdbLinks.get(tzKey);
789+
String tzLink = null;
790+
for (var k = tzKey; tzdbLinks.containsKey(k);) {
791+
k = tzLink = tzdbLinks.get(k);
792+
}
790793
if (tzLink == null && tzdbLinks.containsValue(tzKey)) {
791794
// reverse link search
792795
// this is needed as in tzdb, "America/Buenos_Aires" links to
@@ -1214,7 +1217,7 @@ private static void generateZoneName() throws Exception {
12141217
private static Set<String> getAvailableZoneIds() {
12151218
assert handlerMetaZones != null;
12161219
if (AVAILABLE_TZIDS == null) {
1217-
AVAILABLE_TZIDS = new HashSet<>(ZoneId.getAvailableZoneIds());
1220+
AVAILABLE_TZIDS = new HashSet<>(Arrays.asList(TimeZone.getAvailableIDs()));
12181221
AVAILABLE_TZIDS.addAll(handlerMetaZones.keySet());
12191222
AVAILABLE_TZIDS.remove(MetaZonesParseHandler.NO_METAZONE_KEY);
12201223
}
@@ -1372,6 +1375,7 @@ private static Map<Locale, String> coverageLevelsMap() throws Exception {
13721375
private static void generateTZDBShortNamesMap() throws IOException {
13731376
Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS)
13741377
.filter(p -> p.toFile().isFile())
1378+
.filter(p -> p.getFileName().toString().matches("africa|antarctica|asia|australasia|backward|etcetera|europe|northamerica|southamerica"))
13751379
.forEach(p -> {
13761380
try {
13771381
String zone = null;
@@ -1394,43 +1398,41 @@ private static void generateTZDBShortNamesMap() throws IOException {
13941398
}
13951399
// remove comments in-line
13961400
line = line.replaceAll("[ \t]*#.*", "");
1397-
1401+
var tokens = line.split("[ \t]+", -1);
1402+
var token0len = tokens.length > 0 ? tokens[0].length() : 0;
13981403
// Zone line
1399-
if (line.startsWith("Zone")) {
1404+
if (token0len > 0 && tokens[0].regionMatches(true, 0, "Zone", 0, token0len)) {
14001405
if (zone != null) {
14011406
tzdbShortNamesMap.put(zone, format + NBSP + rule);
14021407
}
1403-
var zl = line.split("[ \t]+", -1);
1404-
zone = zl[1];
1405-
rule = zl[3];
1406-
format = flipIfNeeded(inVanguard, zl[4]);
1408+
zone = tokens[1];
1409+
rule = tokens[3];
1410+
format = flipIfNeeded(inVanguard, tokens[4]);
14071411
} else {
14081412
if (zone != null) {
1409-
if (line.startsWith("Rule") ||
1410-
line.startsWith("Link")) {
1413+
if (token0len > 0 &&
1414+
(tokens[0].regionMatches(true, 0, "Rule", 0, token0len) ||
1415+
tokens[0].regionMatches(true, 0, "Link", 0, token0len))) {
14111416
tzdbShortNamesMap.put(zone, format + NBSP + rule);
14121417
zone = null;
14131418
rule = null;
14141419
format = null;
14151420
} else {
1416-
var s = line.split("[ \t]+", -1);
1417-
rule = s[2];
1418-
format = flipIfNeeded(inVanguard, s[3]);
1421+
rule = tokens[2];
1422+
format = flipIfNeeded(inVanguard, tokens[3]);
14191423
}
14201424
}
14211425
}
14221426

14231427
// Rule line
1424-
if (line.startsWith("Rule")) {
1425-
var rl = line.split("[ \t]+", -1);
1426-
tzdbSubstLetters.put(rl[1] + NBSP + (rl[8].equals("0") ? STD : DST),
1427-
rl[9].replace(NO_SUBST, ""));
1428+
if (token0len > 0 && tokens[0].regionMatches(true, 0, "Rule", 0, token0len)) {
1429+
tzdbSubstLetters.put(tokens[1] + NBSP + (tokens[8].equals("0") ? STD : DST),
1430+
tokens[9].replace(NO_SUBST, ""));
14281431
}
14291432

14301433
// Link line
1431-
if (line.startsWith("Link")) {
1432-
var ll = line.split("[ \t]+", -1);
1433-
tzdbLinks.put(ll[2], ll[1]);
1434+
if (token0len > 0 && tokens[0].regionMatches(true, 0, "Link", 0, token0len)) {
1435+
tzdbLinks.put(tokens[2], tokens[1]);
14341436
}
14351437
}
14361438

@@ -1491,13 +1493,14 @@ private static void fillTZDBShortNames(String tzid, String[] names) {
14911493
/*
14921494
* Convert TZDB offsets to JDK's offsets, eg, "-08" to "GMT-08:00".
14931495
* If it cannot recognize the pattern, return the argument as is.
1496+
* Returning null results in generating the GMT format at runtime.
14941497
*/
14951498
private static String convertGMTName(String f) {
14961499
try {
1497-
// Should pre-fill GMT format once COMPAT is gone.
1498-
// Till then, fall back to GMT format at runtime, after COMPAT short
1499-
// names are populated
1500-
ZoneOffset.of(f);
1500+
if (!f.equals("%z")) {
1501+
// Validate if the format is an offset
1502+
ZoneOffset.of(f);
1503+
}
15011504
return null;
15021505
} catch (DateTimeException dte) {
15031506
// textual representation. return as is

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

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2024, 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
@@ -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,42 +356,45 @@ 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

366368
Month parseMonth(String mon) {
367-
switch (mon) {
368-
case "Jan": return Month.JANUARY;
369-
case "Feb": return Month.FEBRUARY;
370-
case "Mar": return Month.MARCH;
371-
case "Apr": return Month.APRIL;
372-
case "May": return Month.MAY;
373-
case "Jun": return Month.JUNE;
374-
case "Jul": return Month.JULY;
375-
case "Aug": return Month.AUGUST;
376-
case "Sep": return Month.SEPTEMBER;
377-
case "Oct": return Month.OCTOBER;
378-
case "Nov": return Month.NOVEMBER;
379-
case "Dec": return Month.DECEMBER;
380-
}
369+
int len = mon.length();
370+
371+
if (mon.regionMatches(true, 0, "January", 0, len)) return Month.JANUARY;
372+
if (mon.regionMatches(true, 0, "February", 0, len)) return Month.FEBRUARY;
373+
if (mon.regionMatches(true, 0, "March", 0, len)) return Month.MARCH;
374+
if (mon.regionMatches(true, 0, "April", 0, len)) return Month.APRIL;
375+
if (mon.regionMatches(true, 0, "May", 0, len)) return Month.MAY;
376+
if (mon.regionMatches(true, 0, "June", 0, len)) return Month.JUNE;
377+
if (mon.regionMatches(true, 0, "July", 0, len)) return Month.JULY;
378+
if (mon.regionMatches(true, 0, "August", 0, len)) return Month.AUGUST;
379+
if (mon.regionMatches(true, 0, "September", 0, len)) return Month.SEPTEMBER;
380+
if (mon.regionMatches(true, 0, "October", 0, len)) return Month.OCTOBER;
381+
if (mon.regionMatches(true, 0, "November", 0, len)) return Month.NOVEMBER;
382+
if (mon.regionMatches(true, 0, "December", 0, len)) return Month.DECEMBER;
383+
381384
throw new IllegalArgumentException("Unknown month: " + mon);
382385
}
383386

384387
DayOfWeek parseDayOfWeek(String dow) {
385-
switch (dow) {
386-
case "Mon": return DayOfWeek.MONDAY;
387-
case "Tue": return DayOfWeek.TUESDAY;
388-
case "Wed": return DayOfWeek.WEDNESDAY;
389-
case "Thu": return DayOfWeek.THURSDAY;
390-
case "Fri": return DayOfWeek.FRIDAY;
391-
case "Sat": return DayOfWeek.SATURDAY;
392-
case "Sun": return DayOfWeek.SUNDAY;
393-
}
388+
int len = dow.length();
389+
390+
if (dow.regionMatches(true, 0, "Monday", 0, len)) return DayOfWeek.MONDAY;
391+
if (dow.regionMatches(true, 0, "Tuesday", 0, len)) return DayOfWeek.TUESDAY;
392+
if (dow.regionMatches(true, 0, "Wednesday", 0, len)) return DayOfWeek.WEDNESDAY;
393+
if (dow.regionMatches(true, 0, "Thursday", 0, len)) return DayOfWeek.THURSDAY;
394+
if (dow.regionMatches(true, 0, "Friday", 0, len)) return DayOfWeek.FRIDAY;
395+
if (dow.regionMatches(true, 0, "Saturday", 0, len)) return DayOfWeek.SATURDAY;
396+
if (dow.regionMatches(true, 0, "Sunday", 0, len)) return DayOfWeek.SUNDAY;
397+
394398
throw new IllegalArgumentException("Unknown day-of-week: " + dow);
395399
}
396400

make/test/JtregNativeJdk.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ ifeq ($(call isTargetOs, linux), true)
114114
# stripping during the test libraries' build.
115115
BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libFib := -g
116116
BUILD_JDK_JTREG_LIBRARIES_STRIP_SYMBOLS_libFib := false
117+
# nio tests' libCreationTimeHelper native needs -ldl linker flag
118+
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libCreationTimeHelper := -ldl
117119
endif
118120

119121
ifeq ($(ASAN_ENABLED), true)

src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -27,6 +27,7 @@
2727
#include "asm/macroAssembler.hpp"
2828
#include "classfile/javaClasses.inline.hpp"
2929
#include "classfile/vmClasses.hpp"
30+
#include "compiler/disassembler.hpp"
3031
#include "interpreter/interpreter.hpp"
3132
#include "interpreter/interpreterRuntime.hpp"
3233
#include "memory/allocation.inline.hpp"
@@ -36,7 +37,7 @@
3637
#include "runtime/frame.inline.hpp"
3738
#include "runtime/stubRoutines.hpp"
3839

39-
#define __ _masm->
40+
#define __ Disassembler::hook<MacroAssembler>(__FILE__, __LINE__, _masm)->
4041

4142
#ifdef PRODUCT
4243
#define BLOCK_COMMENT(str) /* nothing */

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "precompiled.hpp"
2727
#include "asm/macroAssembler.inline.hpp"
2828
#include "classfile/javaClasses.hpp"
29+
#include "compiler/disassembler.hpp"
2930
#include "compiler/compiler_globals.hpp"
3031
#include "gc/shared/barrierSetAssembler.hpp"
3132
#include "interpreter/bytecodeHistogram.hpp"
@@ -67,7 +68,7 @@
6768
// Max size with JVMTI
6869
int TemplateInterpreter::InterpreterCodeSize = 200 * 1024;
6970

70-
#define __ _masm->
71+
#define __ Disassembler::hook<InterpreterMacroAssembler>(__FILE__, __LINE__, _masm)->
7172

7273
//-----------------------------------------------------------------------------
7374

@@ -2011,13 +2012,21 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t,
20112012
address& vep) {
20122013
assert(t->is_valid() && t->tos_in() == vtos, "illegal template");
20132014
Label L;
2014-
aep = __ pc(); __ push_ptr(); __ b(L);
2015-
fep = __ pc(); __ push_f(); __ b(L);
2016-
dep = __ pc(); __ push_d(); __ b(L);
2017-
lep = __ pc(); __ push_l(); __ b(L);
2018-
bep = cep = sep =
2019-
iep = __ pc(); __ push_i();
2020-
vep = __ pc();
2015+
aep = __ pc(); // atos entry point
2016+
__ push_ptr();
2017+
__ b(L);
2018+
fep = __ pc(); // ftos entry point
2019+
__ push_f();
2020+
__ b(L);
2021+
dep = __ pc(); // dtos entry point
2022+
__ push_d();
2023+
__ b(L);
2024+
lep = __ pc(); // ltos entry point
2025+
__ push_l();
2026+
__ b(L);
2027+
bep = cep = sep = iep = __ pc(); // [bcsi]tos entry point
2028+
__ push_i();
2029+
vep = __ pc(); // vtos entry point
20212030
__ bind(L);
20222031
generate_and_dispatch(t);
20232032
}

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "precompiled.hpp"
2727
#include "asm/macroAssembler.inline.hpp"
28+
#include "compiler/disassembler.hpp"
2829
#include "compiler/compilerDefinitions.inline.hpp"
2930
#include "gc/shared/barrierSetAssembler.hpp"
3031
#include "gc/shared/collectedHeap.hpp"
@@ -49,7 +50,7 @@
4950
#include "runtime/synchronizer.hpp"
5051
#include "utilities/powerOfTwo.hpp"
5152

52-
#define __ _masm->
53+
#define __ Disassembler::hook<InterpreterMacroAssembler>(__FILE__, __LINE__, _masm)->
5354

5455
// Address computation: local variables
5556

src/hotspot/cpu/ppc/frame_ppc.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ bool frame::safe_for_sender(JavaThread *thread) {
117117
return false;
118118
}
119119

120-
common_abi* sender_abi = (common_abi*) fp;
120+
volatile common_abi* sender_abi = (common_abi*) fp; // May get updated concurrently by deoptimization!
121121
intptr_t* sender_sp = (intptr_t*) fp;
122-
address sender_pc = (address) sender_abi->lr;;
122+
address sender_pc = (address) sender_abi->lr;
123123

124124
if (Continuation::is_return_barrier_entry(sender_pc)) {
125125
// If our sender_pc is the return barrier, then our "real" sender is the continuation entry
@@ -134,9 +134,18 @@ bool frame::safe_for_sender(JavaThread *thread) {
134134
return false;
135135
}
136136

137+
intptr_t* unextended_sender_sp = is_interpreted_frame() ? interpreter_frame_sender_sp() : sender_sp;
138+
139+
// If the sender is a deoptimized nmethod we need to check if the original pc is valid.
140+
nmethod* sender_nm = sender_blob->as_nmethod_or_null();
141+
if (sender_nm != nullptr && sender_nm->is_deopt_pc(sender_pc)) {
142+
address orig_pc = *(address*)((address)unextended_sender_sp + sender_nm->orig_pc_offset());
143+
if (!sender_nm->insts_contains_inclusive(orig_pc)) return false;
144+
}
145+
137146
// It should be safe to construct the sender though it might not be valid.
138147

139-
frame sender(sender_sp, sender_pc, nullptr /* unextended_sp */, nullptr /* fp */, sender_blob);
148+
frame sender(sender_sp, sender_pc, unextended_sender_sp, nullptr /* fp */, sender_blob);
140149

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

0 commit comments

Comments
 (0)