Skip to content

Commit c06b7f2

Browse files
Merge tag 'jdk-24+15' into labsjdk/adopt-jdk-24+15-master
Added tag jdk-24+15 for changeset 3c40afa
2 parents de95fb7 + 3c40afa commit c06b7f2

File tree

429 files changed

+9267
-6646
lines changed

Some content is hidden

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

429 files changed

+9267
-6646
lines changed

Diff for: .github/workflows/build-cross-compile.yml

+1-1
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://httpredir.debian.org/debian/
87+
debian-repository: https://snapshot.debian.org/archive/debian/20240228T034848Z/
8888
debian-version: sid
8989
tolerate-sysroot-errors: true
9090

Diff for: make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java

+17-18
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,7 @@ private static Map<Locale, String> coverageLevelsMap() throws Exception {
13721372
private static void generateTZDBShortNamesMap() throws IOException {
13731373
Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS)
13741374
.filter(p -> p.toFile().isFile())
1375+
.filter(p -> p.getFileName().toString().matches("africa|antarctica|asia|australasia|backward|etcetera|europe|northamerica|southamerica"))
13751376
.forEach(p -> {
13761377
try {
13771378
String zone = null;
@@ -1394,43 +1395,41 @@ private static void generateTZDBShortNamesMap() throws IOException {
13941395
}
13951396
// remove comments in-line
13961397
line = line.replaceAll("[ \t]*#.*", "");
1397-
1398+
var tokens = line.split("[ \t]+", -1);
1399+
var token0len = tokens.length > 0 ? tokens[0].length() : 0;
13981400
// Zone line
1399-
if (line.startsWith("Zone")) {
1401+
if (token0len > 0 && tokens[0].regionMatches(true, 0, "Zone", 0, token0len)) {
14001402
if (zone != null) {
14011403
tzdbShortNamesMap.put(zone, format + NBSP + rule);
14021404
}
1403-
var zl = line.split("[ \t]+", -1);
1404-
zone = zl[1];
1405-
rule = zl[3];
1406-
format = flipIfNeeded(inVanguard, zl[4]);
1405+
zone = tokens[1];
1406+
rule = tokens[3];
1407+
format = flipIfNeeded(inVanguard, tokens[4]);
14071408
} else {
14081409
if (zone != null) {
1409-
if (line.startsWith("Rule") ||
1410-
line.startsWith("Link")) {
1410+
if (token0len > 0 &&
1411+
(tokens[0].regionMatches(true, 0, "Rule", 0, token0len) ||
1412+
tokens[0].regionMatches(true, 0, "Link", 0, token0len))) {
14111413
tzdbShortNamesMap.put(zone, format + NBSP + rule);
14121414
zone = null;
14131415
rule = null;
14141416
format = null;
14151417
} else {
1416-
var s = line.split("[ \t]+", -1);
1417-
rule = s[2];
1418-
format = flipIfNeeded(inVanguard, s[3]);
1418+
rule = tokens[2];
1419+
format = flipIfNeeded(inVanguard, tokens[3]);
14191420
}
14201421
}
14211422
}
14221423

14231424
// 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, ""));
1425+
if (token0len > 0 && tokens[0].regionMatches(true, 0, "Rule", 0, token0len)) {
1426+
tzdbSubstLetters.put(tokens[1] + NBSP + (tokens[8].equals("0") ? STD : DST),
1427+
tokens[9].replace(NO_SUBST, ""));
14281428
}
14291429

14301430
// Link line
1431-
if (line.startsWith("Link")) {
1432-
var ll = line.split("[ \t]+", -1);
1433-
tzdbLinks.put(ll[2], ll[1]);
1431+
if (token0len > 0 && tokens[0].regionMatches(true, 0, "Link", 0, token0len)) {
1432+
tzdbLinks.put(tokens[2], tokens[1]);
14341433
}
14351434
}
14361435

Diff for: make/jdk/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java

+37-33
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

Diff for: src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

+23-11
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,8 @@ void SharedRuntime::generate_deopt_blob() {
21812181
pad += 512; // Increase the buffer size when compiling for JVMCI
21822182
}
21832183
#endif
2184-
CodeBuffer buffer("deopt_blob", 2048+pad, 1024);
2184+
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
2185+
CodeBuffer buffer(name, 2048+pad, 1024);
21852186
MacroAssembler* masm = new MacroAssembler(&buffer);
21862187
int frame_size_in_words;
21872188
OopMap* map = nullptr;
@@ -2565,20 +2566,23 @@ uint SharedRuntime::out_preserve_stack_slots() {
25652566
// Generate a special Compile2Runtime blob that saves all registers,
25662567
// and setup oopmap.
25672568
//
2568-
SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
2569+
SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address call_ptr) {
2570+
assert(is_polling_page_id(id), "expected a polling page stub id");
2571+
25692572
ResourceMark rm;
25702573
OopMapSet *oop_maps = new OopMapSet();
25712574
OopMap* map;
25722575

25732576
// Allocate space for the code. Setup code generation tools.
2574-
CodeBuffer buffer("handler_blob", 2048, 1024);
2577+
const char* name = SharedRuntime::stub_name(id);
2578+
CodeBuffer buffer(name, 2048, 1024);
25752579
MacroAssembler* masm = new MacroAssembler(&buffer);
25762580

25772581
address start = __ pc();
25782582
address call_pc = nullptr;
25792583
int frame_size_in_words;
2580-
bool cause_return = (poll_type == POLL_AT_RETURN);
2581-
RegisterSaver reg_save(poll_type == POLL_AT_VECTOR_LOOP /* save_vectors */);
2584+
bool cause_return = (id == SharedStubId::polling_page_return_handler_id);
2585+
RegisterSaver reg_save(id == SharedStubId::polling_page_vectors_safepoint_handler_id /* save_vectors */);
25822586

25832587
// When the signal occurred, the LR was either signed and stored on the stack (in which
25842588
// case it will be restored from the stack before being used) or unsigned and not stored
@@ -2690,12 +2694,14 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
26902694
// but since this is generic code we don't know what they are and the caller
26912695
// must do any gc of the args.
26922696
//
2693-
RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
2697+
RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address destination) {
26942698
assert (StubRoutines::forward_exception_entry() != nullptr, "must be generated before");
2699+
assert(is_resolve_id(id), "expected a resolve stub id");
26952700

26962701
// allocate space for the code
26972702
ResourceMark rm;
26982703

2704+
const char* name = SharedRuntime::stub_name(id);
26992705
CodeBuffer buffer(name, 1000, 512);
27002706
MacroAssembler* masm = new MacroAssembler(&buffer);
27012707

@@ -2787,7 +2793,11 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
27872793
// otherwise assume that stack unwinding will be initiated, so
27882794
// caller saved registers were assumed volatile in the compiler.
27892795

2790-
RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address runtime_entry) {
2796+
RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address runtime_entry) {
2797+
assert(is_throw_id(id), "expected a throw stub id");
2798+
2799+
const char* name = SharedRuntime::stub_name(id);
2800+
27912801
// Information about frame layout at time of blocking runtime call.
27922802
// Note that we only have to preserve callee-saved registers since
27932803
// the compilers are responsible for supplying a continuation point
@@ -2896,7 +2906,8 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
28962906

28972907
int insts_size = 1024;
28982908
int locs_size = 64;
2899-
CodeBuffer code("jfr_write_checkpoint", insts_size, locs_size);
2909+
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_write_checkpoint_id);
2910+
CodeBuffer code(name, insts_size, locs_size);
29002911
OopMapSet* oop_maps = new OopMapSet();
29012912
MacroAssembler* masm = new MacroAssembler(&code);
29022913

@@ -2915,7 +2926,7 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
29152926
oop_maps->add_gc_map(the_pc - start, map);
29162927

29172928
RuntimeStub* stub = // codeBlob framesize is in words (not VMRegImpl::slot_size)
2918-
RuntimeStub::new_runtime_stub("jfr_write_checkpoint", &code, frame_complete,
2929+
RuntimeStub::new_runtime_stub(name, &code, frame_complete,
29192930
(framesize >> (LogBytesPerWord - LogBytesPerInt)),
29202931
oop_maps, false);
29212932
return stub;
@@ -2934,7 +2945,8 @@ RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
29342945
int insts_size = 1024;
29352946
int locs_size = 64;
29362947

2937-
CodeBuffer code("jfr_return_lease", insts_size, locs_size);
2948+
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_return_lease_id);
2949+
CodeBuffer code(name, insts_size, locs_size);
29382950
OopMapSet* oop_maps = new OopMapSet();
29392951
MacroAssembler* masm = new MacroAssembler(&code);
29402952

@@ -2953,7 +2965,7 @@ RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
29532965
oop_maps->add_gc_map(the_pc - start, map);
29542966

29552967
RuntimeStub* stub = // codeBlob framesize is in words (not VMRegImpl::slot_size)
2956-
RuntimeStub::new_runtime_stub("jfr_return_lease", &code, frame_complete,
2968+
RuntimeStub::new_runtime_stub(name, &code, frame_complete,
29572969
(framesize >> (LogBytesPerWord - LogBytesPerInt)),
29582970
oop_maps, false);
29592971
return stub;

Diff for: src/hotspot/cpu/arm/sharedRuntime_arm.cpp

+21-10
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,8 @@ uint SharedRuntime::out_preserve_stack_slots() {
13601360
//------------------------------generate_deopt_blob----------------------------
13611361
void SharedRuntime::generate_deopt_blob() {
13621362
ResourceMark rm;
1363-
CodeBuffer buffer("deopt_blob", 1024, 1024);
1363+
const char* name = SharedRuntime::stub_name(SharedStubId::deopt_id);
1364+
CodeBuffer buffer(name, 1024, 1024);
13641365
int frame_size_in_words;
13651366
OopMapSet* oop_maps;
13661367
int reexecute_offset;
@@ -1601,15 +1602,17 @@ void SharedRuntime::generate_deopt_blob() {
16011602
// setup oopmap, and calls safepoint code to stop the compiled code for
16021603
// a safepoint.
16031604
//
1604-
SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
1605+
SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address call_ptr) {
16051606
assert(StubRoutines::forward_exception_entry() != nullptr, "must be generated before");
1607+
assert(is_polling_page_id(id), "expected a polling page stub id");
16061608

16071609
ResourceMark rm;
1608-
CodeBuffer buffer("handler_blob", 256, 256);
1610+
const char* name = SharedRuntime::stub_name(id);
1611+
CodeBuffer buffer(name, 256, 256);
16091612
int frame_size_words;
16101613
OopMapSet* oop_maps;
16111614

1612-
bool cause_return = (poll_type == POLL_AT_RETURN);
1615+
bool cause_return = (id == SharedStubId::polling_page_return_handler_id);
16131616

16141617
MacroAssembler* masm = new MacroAssembler(&buffer);
16151618
address start = __ pc();
@@ -1671,10 +1674,12 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
16711674
return SafepointBlob::create(&buffer, oop_maps, frame_size_words);
16721675
}
16731676

1674-
RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
1677+
RuntimeStub* SharedRuntime::generate_resolve_blob(SharedStubId id, address destination) {
16751678
assert(StubRoutines::forward_exception_entry() != nullptr, "must be generated before");
1679+
assert(is_resolve_id(id), "expected a resolve stub id");
16761680

16771681
ResourceMark rm;
1682+
const char* name = SharedRuntime::stub_name(id);
16781683
CodeBuffer buffer(name, 1000, 512);
16791684
int frame_size_words;
16801685
OopMapSet *oop_maps;
@@ -1733,7 +1738,11 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha
17331738
// Continuation point for throwing of implicit exceptions that are not handled in
17341739
// the current activation. Fabricates an exception oop and initiates normal
17351740
// exception dispatching in this frame.
1736-
RuntimeStub* SharedRuntime::generate_throw_exception(const char* name, address runtime_entry) {
1741+
RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address runtime_entry) {
1742+
assert(is_throw_id(id), "expected a throw stub id");
1743+
1744+
const char* name = SharedRuntime::stub_name(id);
1745+
17371746
int insts_size = 128;
17381747
int locs_size = 32;
17391748

@@ -1793,7 +1802,8 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
17931802
framesize // inclusive of return address
17941803
};
17951804

1796-
CodeBuffer code("jfr_write_checkpoint", 512, 64);
1805+
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_write_checkpoint_id);
1806+
CodeBuffer code(name, 512, 64);
17971807
MacroAssembler* masm = new MacroAssembler(&code);
17981808

17991809
address start = __ pc();
@@ -1818,7 +1828,7 @@ RuntimeStub* SharedRuntime::generate_jfr_write_checkpoint() {
18181828
oop_maps->add_gc_map(frame_complete, map);
18191829

18201830
RuntimeStub* stub =
1821-
RuntimeStub::new_runtime_stub(code.name(),
1831+
RuntimeStub::new_runtime_stub(name,
18221832
&code,
18231833
frame_complete,
18241834
(framesize >> (LogBytesPerWord - LogBytesPerInt)),
@@ -1836,7 +1846,8 @@ RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
18361846
framesize // inclusive of return address
18371847
};
18381848

1839-
CodeBuffer code("jfr_return_lease", 512, 64);
1849+
const char* name = SharedRuntime::stub_name(SharedStubId::jfr_return_lease_id);
1850+
CodeBuffer code(name, 512, 64);
18401851
MacroAssembler* masm = new MacroAssembler(&code);
18411852

18421853
address start = __ pc();
@@ -1858,7 +1869,7 @@ RuntimeStub* SharedRuntime::generate_jfr_return_lease() {
18581869
oop_maps->add_gc_map(frame_complete, map);
18591870

18601871
RuntimeStub* stub =
1861-
RuntimeStub::new_runtime_stub(code.name(),
1872+
RuntimeStub::new_runtime_stub(name,
18621873
&code,
18631874
frame_complete,
18641875
(framesize >> (LogBytesPerWord - LogBytesPerInt)),

0 commit comments

Comments
 (0)