Skip to content

Commit 7dcc50a

Browse files
authored
Merge pull request #2225 from SAP/pr-jdk-27+20
Merge to tag jdk-27+20
2 parents d6ba8ff + 0c07aaa commit 7dcc50a

501 files changed

Lines changed: 7205 additions & 54271 deletions

File tree

Some content is hidden

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

make/autoconf/buildjdk-spec.gmk.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,4 @@ override EXTRA_LDFLAGS :=
108108
# hsdis is not needed
109109
HSDIS_BACKEND := none
110110
ENABLE_HSDIS_BUNDLING := false
111+
DEFAULT_PRINT_ASSEMBLY_OPTIONS :=

make/autoconf/lib-hsdis.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,9 @@ AC_DEFUN_ONCE([LIB_SETUP_HSDIS],
417417
AC_MSG_RESULT([no])
418418
fi
419419
AC_SUBST(ENABLE_HSDIS_BUNDLING)
420+
421+
UTIL_ARG_WITH(NAME: print-assembly-options, TYPE: string,
422+
DEFAULT: [], RESULT: DEFAULT_PRINT_ASSEMBLY_OPTIONS,
423+
DESC: [default value for the PrintAssemblyOptions diagnostic flag, passed verbatim to the disassembler])
424+
AC_SUBST(DEFAULT_PRINT_ASSEMBLY_OPTIONS)
420425
])

make/autoconf/spec.gmk.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ HSDIS_CFLAGS := @HSDIS_CFLAGS@
381381
HSDIS_LDFLAGS := @HSDIS_LDFLAGS@
382382
HSDIS_LIBS := @HSDIS_LIBS@
383383
CAPSTONE_ARCH_AARCH64_NAME := @CAPSTONE_ARCH_AARCH64_NAME@
384+
DEFAULT_PRINT_ASSEMBLY_OPTIONS := @DEFAULT_PRINT_ASSEMBLY_OPTIONS@
384385

385386
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
386387
# it in sync.

make/hotspot/lib/JvmFlags.gmk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ ifneq ($(HOTSPOT_OVERRIDE_LIBPATH), )
102102
JVM_CFLAGS += -DOVERRIDE_LIBPATH='"$(HOTSPOT_OVERRIDE_LIBPATH)"'
103103
endif
104104

105+
ifneq ($(DEFAULT_PRINT_ASSEMBLY_OPTIONS), )
106+
JVM_CFLAGS += -DDEFAULT_PRINT_ASSEMBLY_OPTIONS='"$(DEFAULT_PRINT_ASSEMBLY_OPTIONS)"'
107+
endif
108+
105109
ifeq ($(ENABLE_COMPATIBLE_CDS_ALIGNMENT), true)
106110
JVM_CFLAGS += -DCOMPATIBLE_CDS_ALIGNMENT
107111
endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2026, 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
@@ -50,7 +50,7 @@ String getClassName() {
5050
};
5151

5252
public void generateBundle(String packageName, String baseName, String localeID,
53-
boolean useJava, Map<String, ?> map, BundleType type) throws IOException;
53+
Map<String, ?> map, BundleType type) throws IOException;
5454

5555
public void generateMetaInfo(Map<String, SortedSet<String>> metaInfo) throws IOException;
5656
}

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

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ String getKeyword() {
183183
}
184184
}
185185

186-
static boolean USE_UTF8 = false;
187186
private static boolean verbose;
188187

189188
private CLDRConverter() {
@@ -232,10 +231,6 @@ public static void main(String[] args) throws Exception {
232231
DESTINATION_DIR = args[++i];
233232
break;
234233

235-
case "-utf8":
236-
USE_UTF8 = true;
237-
break;
238-
239234
case "-verbose":
240235
verbose = true;
241236
break;
@@ -336,7 +331,6 @@ private static void usage() {
336331
+ "\t-year year copyright year in output%n"
337332
+ "\t-zntempfile template file for java.time.format.ZoneName.java%n"
338333
+ "\t-tzdatadir tzdata directory for java.time.format.ZoneName.java%n"
339-
+ "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n"
340334
+ "\t-jdk-header-template <file>%n"
341335
+ "\t\t override default GPL header with contents of file%n");
342336
}
@@ -612,31 +606,31 @@ private static void convertBundles(List<Bundle> bundles) throws Exception {
612606
if (bundleTypes.contains(Bundle.Type.LOCALENAMES)) {
613607
Map<String, Object> localeNamesMap = extractLocaleNames(targetMap, id);
614608
if (!localeNamesMap.isEmpty() || bundle.isRoot()) {
615-
bundleGenerator.generateBundle("util", "LocaleNames", id, true, localeNamesMap, BundleType.OPEN);
609+
bundleGenerator.generateBundle("util", "LocaleNames", id, localeNamesMap, BundleType.OPEN);
616610
}
617611
}
618612
if (bundleTypes.contains(Bundle.Type.CURRENCYNAMES)) {
619613
Map<String, Object> currencyNamesMap = extractCurrencyNames(targetMap, id, bundle.getCurrencies());
620614
if (!currencyNamesMap.isEmpty() || bundle.isRoot()) {
621-
bundleGenerator.generateBundle("util", "CurrencyNames", id, true, currencyNamesMap, BundleType.OPEN);
615+
bundleGenerator.generateBundle("util", "CurrencyNames", id, currencyNamesMap, BundleType.OPEN);
622616
}
623617
}
624618
if (bundleTypes.contains(Bundle.Type.TIMEZONENAMES)) {
625619
Map<String, Object> zoneNamesMap = extractZoneNames(targetMap, id);
626620
if (!zoneNamesMap.isEmpty() || bundle.isRoot()) {
627-
bundleGenerator.generateBundle("util", "TimeZoneNames", id, true, zoneNamesMap, BundleType.TIMEZONE);
621+
bundleGenerator.generateBundle("util", "TimeZoneNames", id, zoneNamesMap, BundleType.TIMEZONE);
628622
}
629623
}
630624
if (bundleTypes.contains(Bundle.Type.CALENDARDATA)) {
631625
Map<String, Object> calendarDataMap = extractCalendarData(targetMap, id);
632626
if (!calendarDataMap.isEmpty() || bundle.isRoot()) {
633-
bundleGenerator.generateBundle("util", "CalendarData", id, true, calendarDataMap, BundleType.PLAIN);
627+
bundleGenerator.generateBundle("util", "CalendarData", id, calendarDataMap, BundleType.PLAIN);
634628
}
635629
}
636630
if (bundleTypes.contains(Bundle.Type.FORMATDATA)) {
637631
Map<String, Object> formatDataMap = extractFormatData(targetMap, id);
638632
if (!formatDataMap.isEmpty() || bundle.isRoot()) {
639-
bundleGenerator.generateBundle("text", "FormatData", id, true, formatDataMap, BundleType.PLAIN);
633+
bundleGenerator.generateBundle("text", "FormatData", id, formatDataMap, BundleType.PLAIN);
640634
}
641635
}
642636

@@ -1053,28 +1047,15 @@ private static void copyIfPresent(Map<String, Object> src, String key, Map<Strin
10531047
}
10541048
}
10551049

1056-
// --- code below here is adapted from java.util.Properties ---
1057-
private static final String specialSaveCharsJava = "\"";
1058-
private static final String specialSaveCharsProperties = "=: \t\r\n\f#!";
1059-
10601050
/*
1061-
* Converts unicodes to encoded &#92;uxxxx
1062-
* and writes out any of the characters in specialSaveChars
1063-
* with a preceding slash
1051+
* Escapes control codes to ASCII escapes or encoded &#92;uxxxx
1052+
* and writes out ASCII quotation marks with a preceding slash
10641053
*/
1065-
static String saveConvert(String theString, boolean useJava) {
1054+
static String escape(String theString) {
10661055
if (theString == null) {
10671056
return "";
10681057
}
10691058

1070-
String specialSaveChars;
1071-
if (useJava) {
1072-
specialSaveChars = specialSaveCharsJava;
1073-
} else {
1074-
specialSaveChars = specialSaveCharsProperties;
1075-
}
1076-
boolean escapeSpace = false;
1077-
10781059
int len = theString.length();
10791060
StringBuilder outBuffer = new StringBuilder(len * 2);
10801061
Formatter formatter = new Formatter(outBuffer, Locale.ROOT);
@@ -1083,14 +1064,14 @@ static String saveConvert(String theString, boolean useJava) {
10831064
char aChar = theString.charAt(x);
10841065
switch (aChar) {
10851066
case ' ':
1086-
if (x == 0 || escapeSpace) {
1067+
if (x == 0) {
10871068
outBuffer.append('\\');
10881069
}
10891070
outBuffer.append(' ');
10901071
break;
1091-
case '\\':
1092-
outBuffer.append('\\');
1072+
case '\\', '"':
10931073
outBuffer.append('\\');
1074+
outBuffer.append(aChar);
10941075
break;
10951076
case '\t':
10961077
outBuffer.append('\\');
@@ -1109,12 +1090,9 @@ static String saveConvert(String theString, boolean useJava) {
11091090
outBuffer.append('f');
11101091
break;
11111092
default:
1112-
if (aChar < 0x0020 || (!USE_UTF8 && aChar > 0x007e)) {
1093+
if (aChar < 0x0020) {
11131094
formatter.format("\\u%04x", (int)aChar);
11141095
} else {
1115-
if (specialSaveChars.indexOf(aChar) != -1) {
1116-
outBuffer.append('\\');
1117-
}
11181096
outBuffer.append(aChar);
11191097
}
11201098
}

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

Lines changed: 34 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ class ResourceBundleGenerator implements BundleGenerator {
7070
private static final String META_VALUE_PREFIX = "metaValue_";
7171

7272
@Override
73-
public void generateBundle(String packageName, String baseName, String localeID, boolean useJava,
73+
public void generateBundle(String packageName, String baseName, String localeID,
7474
Map<String, ?> map, BundleType type) throws IOException {
75-
String suffix = useJava ? ".java" : ".properties";
7675
String dirName = CLDRConverter.DESTINATION_DIR + File.separator + "sun" + File.separator
7776
+ packageName + File.separator + "resources" + File.separator + "cldr";
7877
packageName = packageName + ".resources.cldr";
@@ -91,23 +90,12 @@ public void generateBundle(String packageName, String baseName, String localeID,
9190
if (!dir.exists()) {
9291
dir.mkdirs();
9392
}
94-
File file = new File(dir, baseName + ("root".equals(localeID) ? "" : "_" + localeID) + suffix);
93+
File file = new File(dir, baseName + ("root".equals(localeID) ? "" : "_" + localeID) + ".java");
9594
if (!file.exists()) {
9695
file.createNewFile();
9796
}
9897
CLDRConverter.info("\tWriting file " + file);
9998

100-
String encoding;
101-
if (useJava) {
102-
if (CLDRConverter.USE_UTF8) {
103-
encoding = "utf-8";
104-
} else {
105-
encoding = "us-ascii";
106-
}
107-
} else {
108-
encoding = "iso-8859-1";
109-
}
110-
11199
Formatter fmt = null;
112100
if (type == BundleType.TIMEZONE) {
113101
fmt = new Formatter();
@@ -119,7 +107,7 @@ public void generateBundle(String packageName, String baseName, String localeID,
119107
value = (String[]) map.get(key);
120108
fmt.format(" final String[] %s = new String[] {\n", meta);
121109
for (String s : value) {
122-
fmt.format(" \"%s\",\n", CLDRConverter.saveConvert(s, useJava));
110+
fmt.format(" \"%s\",\n", CLDRConverter.escape(s));
123111
}
124112
fmt.format(" };\n");
125113
metaKeys.add(key);
@@ -159,11 +147,11 @@ public void generateBundle(String packageName, String baseName, String localeID,
159147
if (val instanceof String[] values) {
160148
fmt.format(" final String[] %s = new String[] {\n", metaVal);
161149
for (String s : values) {
162-
fmt.format(" \"%s\",\n", CLDRConverter.saveConvert(s, useJava));
150+
fmt.format(" \"%s\",\n", CLDRConverter.escape(s));
163151
}
164152
fmt.format(" };\n");
165153
} else {
166-
fmt.format(" final String %s = \"%s\";\n", metaVal, CLDRConverter.saveConvert((String)val, useJava));
154+
fmt.format(" final String %s = \"%s\";\n", metaVal, CLDRConverter.escape((String)val));
167155
}
168156
newMap.put(oldEntry.key, oldEntry.metaKey());
169157
}
@@ -173,55 +161,47 @@ public void generateBundle(String packageName, String baseName, String localeID,
173161
map = newMap;
174162
}
175163

176-
try (PrintWriter out = new PrintWriter(file, encoding)) {
164+
try (PrintWriter out = new PrintWriter(file, "utf-8")) {
177165
// Output copyright headers
178166
out.println(getOpenJDKCopyright());
179167
out.println(CopyrightHeaders.getUnicodeCopyright());
180168

181-
if (useJava) {
182-
out.println("package sun." + packageName + ";\n");
183-
out.printf("import %s;\n\n", type.getPathName());
184-
out.printf("public class %s%s extends %s {\n", baseName, "root".equals(localeID) ? "" : "_" + localeID, type.getClassName());
169+
out.println("package sun." + packageName + ";\n");
170+
out.printf("import %s;\n\n", type.getPathName());
171+
out.printf("public class %s%s extends %s {\n", baseName, "root".equals(localeID) ? "" : "_" + localeID, type.getClassName());
185172

186-
out.println(" @Override\n" +
187-
" protected final Object[][] getContents() {");
188-
if (fmt != null) {
189-
out.print(fmt.toString());
190-
}
191-
out.println(" final Object[][] data = new Object[][] {");
173+
out.println(" @Override\n" +
174+
" protected final Object[][] getContents() {");
175+
if (fmt != null) {
176+
out.print(fmt.toString());
192177
}
178+
out.println(" final Object[][] data = new Object[][] {");
193179
for (String key : map.keySet()) {
194-
if (useJava) {
195-
Object value = map.get(key);
196-
if (value == null) {
197-
CLDRConverter.warning("null value for " + key);
198-
} else if (value instanceof String) {
199-
String valStr = (String)value;
200-
if (type == BundleType.TIMEZONE &&
201-
!(key.startsWith(CLDRConverter.EXEMPLAR_CITY_PREFIX) ||
202-
key.startsWith(CLDRConverter.METAZONE_DSTOFFSET_PREFIX)) ||
203-
valStr.startsWith(META_VALUE_PREFIX)) {
204-
out.printf(" { \"%s\", %s },\n", key, CLDRConverter.saveConvert(valStr, useJava));
205-
} else {
206-
out.printf(" { \"%s\", \"%s\" },\n", key, CLDRConverter.saveConvert(valStr, useJava));
207-
}
208-
} else if (value instanceof String[]) {
209-
String[] values = (String[]) value;
210-
out.println(" { \"" + key + "\",\n new String[] {");
211-
for (String s : values) {
212-
out.println(" \"" + CLDRConverter.saveConvert(s, useJava) + "\",");
213-
}
214-
out.println(" }\n },");
180+
Object value = map.get(key);
181+
if (value == null) {
182+
CLDRConverter.warning("null value for " + key);
183+
} else if (value instanceof String) {
184+
String valStr = (String)value;
185+
if (type == BundleType.TIMEZONE &&
186+
!(key.startsWith(CLDRConverter.EXEMPLAR_CITY_PREFIX) ||
187+
key.startsWith(CLDRConverter.METAZONE_DSTOFFSET_PREFIX)) ||
188+
valStr.startsWith(META_VALUE_PREFIX)) {
189+
out.printf(" { \"%s\", %s },\n", key, CLDRConverter.escape(valStr));
215190
} else {
216-
throw new RuntimeException("unknown value type: " + value.getClass().getName());
191+
out.printf(" { \"%s\", \"%s\" },\n", key, CLDRConverter.escape(valStr));
217192
}
193+
} else if (value instanceof String[]) {
194+
String[] values = (String[]) value;
195+
out.println(" { \"" + key + "\",\n new String[] {");
196+
for (String s : values) {
197+
out.println(" \"" + CLDRConverter.escape(s) + "\",");
198+
}
199+
out.println(" }\n },");
218200
} else {
219-
out.println(key + "=" + CLDRConverter.saveConvert((String) map.get(key), useJava));
201+
throw new RuntimeException("unknown value type: " + value.getClass().getName());
220202
}
221203
}
222-
if (useJava) {
223-
out.println(" };\n return data;\n }\n}");
224-
}
204+
out.println(" };\n return data;\n }\n}");
225205
}
226206
}
227207

make/modules/java.base/Gensrc.gmk

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2026, 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
@@ -47,8 +47,6 @@ CLDR_GEN_DONE := $(GENSRC_DIR)/_cldr-gensrc.marker
4747
TZ_DATA_DIR := $(MODULE_SRC)/share/data/tzdata
4848
ZONENAME_TEMPLATE := $(MODULE_SRC)/share/classes/java/time/format/ZoneName.java.template
4949

50-
# The `-utf8` option is used even for US English, as some names
51-
# may contain non-ASCII characters, such as “Türkiye”.
5250
$(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \
5351
$(wildcard $(CLDR_DATA_DIR)/main/en*.xml) \
5452
$(wildcard $(CLDR_DATA_DIR)/supplemental/*.xml) \
@@ -64,8 +62,7 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \
6462
-basemodule \
6563
-year $(COPYRIGHT_YEAR) \
6664
-zntempfile $(ZONENAME_TEMPLATE) \
67-
-tzdatadir $(TZ_DATA_DIR) \
68-
-utf8)
65+
-tzdatadir $(TZ_DATA_DIR))
6966
$(TOUCH) $@
7067

7168
TARGETS += $(CLDR_GEN_DONE)

make/modules/jdk.localedata/Gensrc.gmk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2026, 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
@@ -45,8 +45,7 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \
4545
-baselocales "en-US" \
4646
-year $(COPYRIGHT_YEAR) \
4747
-o $(GENSRC_DIR) \
48-
-tzdatadir $(TZ_DATA_DIR) \
49-
-utf8)
48+
-tzdatadir $(TZ_DATA_DIR))
5049
$(TOUCH) $@
5150

5251
TARGETS += $(CLDR_GEN_DONE)

0 commit comments

Comments
 (0)