Skip to content

Commit

Permalink
Merge branch 'master' into feature/cpentry-typesym
Browse files Browse the repository at this point in the history
  • Loading branch information
liach committed Sep 20, 2023
2 parents 0044de0 + ec74194 commit dd28873
Show file tree
Hide file tree
Showing 2,562 changed files with 67,478 additions and 54,753 deletions.
2 changes: 1 addition & 1 deletion .github/actions/get-gtest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
var: GTEST_VERSION

- name: 'Checkout GTest source'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: google/googletest
ref: 'v${{ steps.version.outputs.value }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/get-jtreg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
key: jtreg-${{ steps.version.outputs.value }}

- name: 'Checkout the JTReg source'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: openjdk/jtreg
ref: jtreg-${{ steps.version.outputs.value }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get MSYS2'
uses: ./.github/actions/get-msys2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get MSYS2'
uses: ./.github/actions/get-msys2
Expand Down
6 changes: 3 additions & 3 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -1431,13 +1431,13 @@ ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)
# are internal only, to support Init.gmk.

print-targets:
@$(ECHO) $(sort $(ALL_TARGETS))
$(info $(subst $(SPACE),$(NEWLINE),$(sort $(ALL_TARGETS))))

print-modules:
@$(ECHO) $(sort $(ALL_MODULES))
$(info $(subst $(SPACE),$(NEWLINE),$(sort $(ALL_MODULES))))

print-tests:
@$(ECHO) $(sort $(ALL_NAMED_TESTS))
$(info $(subst $(SPACE),$(NEWLINE),$(sort $(ALL_NAMED_TESTS))))

create-main-targets-include:
$(call LogInfo, Generating main target list)
Expand Down
6 changes: 4 additions & 2 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -MP"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -Zc:wchar_t-"
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
# compilation of all source files regardless of the active code page on Windows.
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -utf-8 -MP"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -utf-8 -Zc:wchar_t-"
fi
# CFLAGS C language level for JDK sources (hotspot only uses C++)
Expand Down
8 changes: 5 additions & 3 deletions make/autoconf/lib-x11.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -35,6 +35,7 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
X_CFLAGS=
X_LIBS=
else
x_libraries_orig="$x_libraries"
if test "x${with_x}" = xno; then
AC_MSG_ERROR([It is not possible to disable the use of X11. Remove the --without-x option.])
Expand All @@ -48,6 +49,7 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
fi
if test "x$x_libraries" = xNONE; then
x_libraries="${with_x}/lib"
x_libraries_orig="$x_libraries"
fi
else
# Check if the user has specified sysroot, but not --with-x, --x-includes or --x-libraries.
Expand Down Expand Up @@ -82,8 +84,8 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
AC_PATH_XTRA
# AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
# this doesn't make sense so we remove it.
if test "x$COMPILE_TYPE" = xcross; then
# this doesn't make sense so we remove it; same for sysroot (devkit).
if test "x$COMPILE_TYPE" = xcross || (test "x$SYSROOT" != "x" && test "x$x_libraries_orig" = xNONE); then
X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
fi
Expand Down
4 changes: 2 additions & 2 deletions make/common/NativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -1165,9 +1165,9 @@ define SetupNativeCompilationBody
$1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)`
endif

# If we are building static library, 'AR' on macosx may not support @-file.
# If we are building static library, 'AR' on macosx/aix may not support @-file.
ifeq ($$($1_TYPE), STATIC_LIBRARY)
ifeq ($(call isTargetOs, macosx), true)
ifeq ($(call isTargetOs, macosx aix), true)
$1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)`
endif
endif
Expand Down
11 changes: 10 additions & 1 deletion make/common/TestFilesCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ define SetupTestFilesCompilationBody

$1_BUILD_INFO := $$($1_OUTPUT_DIR)/_$1-build-info.marker

# Tests are built with internal debug symbols where supported.
# With Visual Studio or on macosx, we revert to external.
$1_COPY_DEBUG_SYMBOLS := false
ifeq ($(TOOLCHAIN_TYPE), microsoft)
$1_COPY_DEBUG_SYMBOLS := true
else ifeq ($(call isTargetOs, macosx), true)
$1_COPY_DEBUG_SYMBOLS := true
endif

# Setup a compilation for each and every one of them
$$(foreach file, $$($1_FILTERED_FILE_LIST),\
$$(eval name := $$(strip $$(basename $$(notdir $$(file))))) \
Expand All @@ -106,7 +115,7 @@ define SetupTestFilesCompilationBody
LIBS := $$($1_LIBS_$$(name)), \
TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
COPY_DEBUG_SYMBOLS := $$(if $$($1_COPY_DEBUG_SYMBOLS_$$(name)),$$($1_COPY_DEBUG_SYMBOLS_$$(name)),false), \
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \
BUILD_INFO_LOG_MACRO := LogInfo, \
)) \
Expand Down
1 change: 1 addition & 0 deletions make/data/hotspot-symbols/symbols-unix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ JVM_DumpAllStacks
JVM_DumpClassListToFile
JVM_DumpDynamicArchive
JVM_DumpThreads
JVM_ExpandStackFrameInfo
JVM_FillInStackTrace
JVM_FindClassFromCaller
JVM_FindClassFromClass
Expand Down
8 changes: 7 additions & 1 deletion make/jdk/src/classes/build/tools/cldrconverter/Bundle.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -108,6 +108,12 @@ static enum Type {
"narrow.Eras"
};

static final String[] LIST_PATTERN_KEYS = {
"ListPatterns_standard",
"ListPatterns_or",
"ListPatterns_unit",
};

// DateFormatItem prefix
static final String DATEFORMATITEM_KEY_PREFIX = "DateFormatItem.";
static final String DATEFORMATITEM_INPUT_REGIONS_PREFIX = "DateFormatItemInputRegions.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,14 @@ private static void convertBundles(List<Bundle> bundles) throws Exception {
*/
static void handleAliases(Map<String, Object> bundleMap) {
for (String key : aliases.keySet()) {
var source = bundleMap.get(aliases.get(key));
var sourceKey = aliases.get(key);
if (key.startsWith("ListPatterns_")) {
String k;
while ((k = aliases.get(sourceKey)) != null) {
sourceKey = k;
}
}
var source = bundleMap.get(sourceKey);
if (source != null) {
if (bundleMap.get(key) instanceof String[] sa) {
// fill missing elements in case of String array
Expand Down Expand Up @@ -871,6 +878,7 @@ private static Map<String, Object> extractCalendarData(Map<String, Object> map,
"DayPeriodRules",
"DateFormatItemInputRegions.allowed",
"DateFormatItemInputRegions.preferred",
"ListPatterns",
};

static final Set<String> availableSkeletons = new HashSet<>();
Expand Down Expand Up @@ -935,6 +943,14 @@ private static Map<String, Object> extractFormatData(Map<String, Object> map, St
formatData.put(k + ".NumberElements", neNew);
});
}

// ListPatterns
for (var lpKey : Bundle.LIST_PATTERN_KEYS) {
copyIfPresent(map, lpKey, formatData);
copyIfPresent(map, lpKey + "-short", formatData);
copyIfPresent(map, lpKey + "-narrow", formatData);
}

return formatData;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -35,6 +35,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
Expand Down Expand Up @@ -812,6 +813,7 @@ public void startElement(String uri, String localName, String qName, Attributes
&& ((currentContainer.getqName().equals("decimalFormatLength"))
|| (currentContainer.getqName().equals("currencyFormat"))
|| (currentContainer.getqName().equals("percentFormat"))
|| (currentContainer.getqName().equals("listPattern"))
|| (currentCalendarType != null && !currentCalendarType.lname().startsWith("islamic-")))) { // ignore islamic variants
pushAliasEntry(qName, attributes, attributes.getValue("path"));
} else {
Expand All @@ -820,6 +822,28 @@ public void startElement(String uri, String localName, String qName, Attributes
}
break;

// ListPatterns
case "listPattern":
currentStyle = Optional.ofNullable(attributes.getValue("type")).orElse("standard");
pushStringArrayEntry(qName, attributes, "ListPatterns_" + currentStyle, 5);
break;
case "listPatternPart":
type = attributes.getValue("type");
pushStringArrayElement(qName, attributes,
switch (type) {
case "start" -> 0;
case "middle" -> 1;
case "end" -> 2;
case "2" -> 3;
case "3" -> 4;
default -> throw new IllegalArgumentException(
"""
The "type" attribute value for "listPatternPart" element is not recognized: %s
""".formatted(type)
);
});
break;

default:
// treat anything else as a container
pushContainer(qName, attributes);
Expand Down Expand Up @@ -973,6 +997,9 @@ private String toJDKKey(String containerqName, String context, String type) {
"NumberPatterns/" +
(type.equals("standard") ? containerqName.replaceFirst("Format", "") : type);
break;
case "listPattern":
keyName = type;
break;
default:
keyName = "";
break;
Expand Down Expand Up @@ -1035,6 +1062,19 @@ private String getTarget(String path, String calType, String context, String wid
return toJDKKey(qName, "", style);
}

// listPattern
if (path.indexOf("../listPattern") != -1) {
typeKey = "[@type='";
start = path.indexOf(typeKey);
String style;
if (start != -1) {
style = "ListPatterns_" + path.substring(start + typeKey.length(), path.indexOf("']", start));
} else {
style = "ListPatterns_standard";
}
return toJDKKey(qName, "", style);
}

return calType + "." + toJDKKey(qName, context, width);
}

Expand Down Expand Up @@ -1107,6 +1147,10 @@ public void endElement(String uri, String localName, String qName) throws SAXExc
case "timeFormatLength":
currentStyle = "";
break;
case "listPattern":
currentStyle = "";
putIfEntry();
break;
default:
putIfEntry();
}
Expand All @@ -1128,6 +1172,12 @@ private Object putIfEntry() {
toJDKKey(containerqName, "", kc.getKey()),
getTarget(entry.getKey(), "", "", "")
);
} else if (containerqName.equals("listPattern")) {
var sae = (StringArrayEntry)entry.getParent();
CLDRConverter.aliases.put(
toJDKKey(containerqName, "", sae.getKey()),
getTarget(entry.getKey(), "", "", "")
);
} else {
Set<String> keyNames = populateAliasKeys(containerqName, currentContext, currentWidth);
if (!keyNames.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,6 +25,7 @@

package build.tools.compileproperties;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
Expand All @@ -33,6 +34,9 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -220,8 +224,8 @@ private static boolean createFile(String propertiesPath, String outputPath,
System.out.println("parsing: " + propertiesPath);
}
Properties p = new Properties();
try {
p.load(new FileInputStream(propertiesPath));
try (BufferedReader input = Files.newBufferedReader(Path.of(propertiesPath))) {
p.load(input);
} catch ( FileNotFoundException e ) {
ok = false;
error("Cannot find file " + propertiesPath, e);
Expand Down Expand Up @@ -267,7 +271,7 @@ private static boolean createFile(String propertiesPath, String outputPath,
Writer writer = null;
try {
writer = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(outputPath), "8859_1"));
new OutputStreamWriter(new FileOutputStream(outputPath), StandardCharsets.US_ASCII));
MessageFormat format = new MessageFormat(FORMAT);
writer.write(format.format(new Object[] { packageString, className, superClass, data }));
} catch ( IOException e ) {
Expand Down
Loading

0 comments on commit dd28873

Please sign in to comment.