Skip to content

Commit

Permalink
Merge jdk
Browse files Browse the repository at this point in the history
Merge jdk-22+13
  • Loading branch information
David Simms committed Nov 15, 2023
2 parents 6be441a + cb3f968 commit 481893b
Show file tree
Hide file tree
Showing 278 changed files with 6,927 additions and 2,239 deletions.
6 changes: 3 additions & 3 deletions .github/actions/get-bootjdk/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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 @@ -104,6 +104,6 @@ runs:
- name: 'Export path to where BootJDK is installed'
id: path-name
run: |
# Export the path
echo 'path=bootjdk/jdk' >> $GITHUB_OUTPUT
# Export the absolute path
echo "path=`pwd`/bootjdk/jdk" >> $GITHUB_OUTPUT
shell: bash
4 changes: 1 addition & 3 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ jobs:
g++-${{ inputs.gcc-major-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev \
debian-ports-archive-keyring
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
- name: 'Check cache for sysroot'
Expand All @@ -134,7 +133,6 @@ jobs:
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
--resolve-deps
--variant=minbase
$(test -n "${{ matrix.debian-keyring }}" && echo "--keyring=${{ matrix.debian-keyring }}")
${{ matrix.debian-version }}
sysroot
${{ matrix.debian-repository }}
Expand Down
24 changes: 23 additions & 1 deletion make/Bundles.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,27 @@ endif

################################################################################

ifneq ($(filter static-libs-graal-bundles, $(MAKECMDGOALS)), )
STATIC_LIBS_GRAAL_BUNDLE_FILES := $(call FindFiles, $(STATIC_LIBS_GRAAL_IMAGE_DIR))

ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
STATIC_LIBS_GRAAL_BUNDLE_SUBDIR := $(JDK_MACOSX_CONTENTS_SUBDIR)/Home
else
STATIC_LIBS_GRAAL_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)
endif

$(eval $(call SetupBundleFile, BUILD_STATIC_LIBS_GRAAL_BUNDLE, \
BUNDLE_NAME := $(STATIC_LIBS_GRAAL_BUNDLE_NAME), \
FILES := $(STATIC_LIBS_GRAAL_BUNDLE_FILES), \
BASE_DIRS := $(STATIC_LIBS_GRAAL_IMAGE_DIR), \
SUBDIR := $(STATIC_LIBS_GRAAL_BUNDLE_SUBDIR), \
))

STATIC_LIBS_GRAAL_TARGETS += $(BUILD_STATIC_LIBS_GRAAL_BUNDLE)
endif

################################################################################

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Bundles.gmk))

Expand All @@ -490,8 +511,9 @@ docs-jdk-bundles: $(DOCS_JDK_TARGETS)
docs-javase-bundles: $(DOCS_JAVASE_TARGETS)
docs-reference-bundles: $(DOCS_REFERENCE_TARGETS)
static-libs-bundles: $(STATIC_LIBS_TARGETS)
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
jcov-bundles: $(JCOV_TARGETS)

.PHONY: all default product-bundles test-bundles \
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
static-libs-bundles jcov-bundles
static-libs-bundles static-libs-graal-bundles jcov-bundles
4 changes: 0 additions & 4 deletions make/Docs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) )
# In order to get a specific ordering it's necessary to specify the total
# ordering of tags as the tags are otherwise ordered in order of definition.
JAVADOC_TAGS := \
-tag beaninfo:X \
-tag since.unbundled:X \
-tag Note:X \
-tag ToDo:X \
-tag 'apiNote:a:API Note:' \
-tag 'implSpec:a:Implementation Requirements:' \
-tag 'implNote:a:Implementation Note:' \
Expand Down
6 changes: 6 additions & 0 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,12 @@ $(eval $(call SetupTarget, static-libs-bundles, \
DEPS := static-libs-image, \
))

$(eval $(call SetupTarget, static-libs-graal-bundles, \
MAKEFILE := Bundles, \
TARGET := static-libs-graal-bundles, \
DEPS := static-libs-graal-image, \
))

ifeq ($(JCOV_ENABLED), true)
$(eval $(call SetupTarget, jcov-bundles, \
MAKEFILE := Bundles, \
Expand Down
3 changes: 3 additions & 0 deletions make/ToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,7 @@ PANDOC_HTML_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpa

##########################################################################################

# Hook to include the corresponding custom post file, if present.
$(eval $(call IncludeCustomExtension, ToolsJdk-post.gmk))

endif # _TOOLS_GMK
5 changes: 4 additions & 1 deletion make/autoconf/build-performance.m4
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
fi
# The CCACHE_BASEDIR needs to end with '/' as ccache will otherwise think
# directories next to it, that have the base dir name as a prefix, are sub
# directories of CCACHE_BASEDIR.
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$WORKSPACE_ROOT/ $CCACHE"
if test "x$SET_CCACHE_DIR" != x; then
mkdir -p $CCACHE_DIR > /dev/null 2>&1
Expand Down
3 changes: 2 additions & 1 deletion make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# Add -z,defs, to forbid undefined symbols in object files.
# add -z,relro (mark relocations read only) for all libs
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
# add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed"
# Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
Expand Down
6 changes: 4 additions & 2 deletions make/autoconf/platform.m4
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
HOTSPOT_$1_CPU_DEFINE=RISCV32
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
HOTSPOT_$1_CPU_DEFINE=RISCV64
Expand All @@ -577,10 +575,14 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=SPARC
elif test "x$OPENJDK_$1_CPU" = xppc; then
HOTSPOT_$1_CPU_DEFINE=PPC32
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
HOTSPOT_$1_CPU_DEFINE=RISCV32
elif test "x$OPENJDK_$1_CPU" = xs390; then
HOTSPOT_$1_CPU_DEFINE=S390
elif test "x$OPENJDK_$1_CPU" = xs390x; then
HOTSPOT_$1_CPU_DEFINE=S390
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
HOTSPOT_$1_CPU_DEFINE=LOONGARCH64
elif test "x$OPENJDK_$1_CPU" != x; then
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
fi
Expand Down
1 change: 1 addition & 0 deletions make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ DOCS_JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
DOCS_JAVASE_BUNDLE_NAME := javase-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
DOCS_REFERENCE_BUNDLE_NAME := jdk-reference-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
STATIC_LIBS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs$(DEBUG_PART).tar.gz
STATIC_LIBS_GRAAL_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs-graal$(DEBUG_PART).tar.gz
JCOV_BUNDLE_NAME := jdk-jcov-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)

JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
Expand Down
7 changes: 5 additions & 2 deletions make/common/NativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ endif
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
# its compiler. The compiler then produces relative dependency files.
# make does not know a relative and absolute filename is the same so it will
# ignore such dependencies.
# ignore such dependencies. This only applies when the OUTPUTDIR is inside
# the WORKSPACE_ROOT.
ifneq ($(CCACHE), )
REWRITE_PATHS_RELATIVE = true
ifneq ($(filter $(WORKSPACE_ROOT)/%, $(OUTPUTDIR)), )
REWRITE_PATHS_RELATIVE = true
endif
endif

ifeq ($(REWRITE_PATHS_RELATIVE), true)
Expand Down
4 changes: 2 additions & 2 deletions make/hotspot/lib/JvmMapfile.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 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 @@ -118,7 +118,7 @@ else ifeq ($(call isTargetOs, windows), true)

FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
}'

else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public class CLDRConverter {

private static Set<String> AVAILABLE_TZIDS;
static int copyrightYear;
static String jdkHeaderTemplate;
private static String zoneNameTempFile;
private static String tzDataDir;
private static final Map<String, String> canonicalTZMap = new HashMap<>();
Expand Down Expand Up @@ -229,6 +230,10 @@ public static void main(String[] args) throws Exception {
tzDataDir = args[++i];
break;

case "-jdk-header-template":
jdkHeaderTemplate = Files.readString(Paths.get(args[++i]));
break;

case "-help":
usage();
System.exit(0);
Expand Down Expand Up @@ -304,7 +309,9 @@ private static void usage() {
+ "\t-year year copyright year in output%n"
+ "\t-zntempfile template file for java.time.format.ZoneName.java%n"
+ "\t-tzdatadir tzdata directory for java.time.format.ZoneName.java%n"
+ "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n");
+ "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n"
+ "\t-jdk-header-template <file>%n"
+ "\t\t override default GPL header with contents of file%n");
}

static void info(String fmt, Object... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void generateBundle(String packageName, String baseName, String localeID,

try (PrintWriter out = new PrintWriter(file, encoding)) {
// Output copyright headers
out.println(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear));
out.println(getOpenJDKCopyright());
out.println(CopyrightHeaders.getUnicodeCopyright());

if (useJava) {
Expand Down Expand Up @@ -294,7 +294,7 @@ public void generateMetaInfo(Map<String, SortedSet<String>> metaInfo) throws IOE
CLDRConverter.info("Generating file " + file);

try (PrintWriter out = new PrintWriter(file, "us-ascii")) {
out.printf(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear));
out.printf(getOpenJDKCopyright());

out.printf("""
package sun.util.%s;
Expand Down Expand Up @@ -448,4 +448,12 @@ private static SortedSet<String> applyLanguageAliases(SortedSet<String> tags) {
});
return tags;
}

private static String getOpenJDKCopyright() {
if (CLDRConverter.jdkHeaderTemplate != null) {
return String.format(CLDRConverter.jdkHeaderTemplate, CLDRConverter.copyrightYear);
} else {
return CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,38 @@
public class EquivMapsGenerator {

public static void main(String[] args) throws Exception {
if (args.length != 3) {
int i = 0;
boolean valid = true;
if (args.length != 5 && args.length !=3) {
valid = false;
} else if (args.length == 5) {
if ("-jdk-header-template".equals(args[i])) {
jdkHeaderTemplate = Files.readString(Paths.get(args[++i]));
i++;
} else {
valid = false;
}
}
if (!valid) {
System.err.println("Usage: java EquivMapsGenerator"
+ " [-jdk-header-template <file>]"
+ " language-subtag-registry.txt LocaleEquivalentMaps.java copyrightYear");
System.exit(1);
}
copyrightYear = Integer.parseInt(args[2]);
readLSRfile(args[0]);
String lsrFile = args[i++];
String outputFile = args[i++];
copyrightYear = Integer.parseInt(args[i++]);

readLSRfile(lsrFile);
// Builds the maps from the IANA data
generateEquivalentMap();
// Writes the maps out to LocaleEquivalentMaps.java
generateSourceCode(args[1]);
generateSourceCode(outputFile);
}

private static String LSRrevisionDate;
private static int copyrightYear;
private static String jdkHeaderTemplate;
private static Map<String, StringBuilder> initialLanguageMap =
new TreeMap<>();
private static Map<String, StringBuilder> initialRegionVariantMap =
Expand Down Expand Up @@ -225,6 +242,7 @@ private static void generateSourceCode(String fileName) {
try (BufferedWriter writer = Files.newBufferedWriter(
Paths.get(fileName))) {
writer.write(getOpenJDKCopyright());
writer.write("\n");
writer.write(HEADER_TEXT);
writer.write(getMapsText());
writer.write(getLSRText());
Expand All @@ -241,7 +259,8 @@ private static void generateSourceCode(String fileName) {
}

private static String getOpenJDKCopyright() {
return String.format(Locale.US, COPYRIGHT, copyrightYear);
return String.format(Locale.US,
(jdkHeaderTemplate != null ? jdkHeaderTemplate : COPYRIGHT), copyrightYear);
}

private static final String COPYRIGHT =
Expand Down Expand Up @@ -270,7 +289,6 @@ private static String getOpenJDKCopyright() {
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
""";

private static final String HEADER_TEXT =
Expand Down
4 changes: 2 additions & 2 deletions make/jdk/src/classes/build/tools/taglet/Incubating.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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 @@ -52,7 +52,7 @@ public boolean isInlineTag() {

@Override
public String getName() {
return "Incubating";
return "incubating";
}

private static final String MESSAGE =
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/aarch64/assembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "asm/register.hpp"
#include "metaprogramming/enableIf.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ void InterpreterMacroAssembler::remove_activation(
// Check that all monitors are unlocked
{
Label loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Address monitor_block_top(
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/aarch64/register_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define CPU_AARCH64_REGISTER_AARCH64_HPP

#include "asm/register.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"

class VMRegImpl;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/powerOfTwo.hpp"
#ifdef COMPILER2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "runtime/synchronizer.hpp"
#include "runtime/timer.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/powerOfTwo.hpp"
#include <sys/types.h>
Expand Down Expand Up @@ -698,7 +699,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {

// monitor entry size: see picture of stack set
// (generate_method_entry) and frame_amd64.hpp
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

// total overhead size: entry_size + (saved rbp through expr stack
// bottom). be sure to change this if you add/subtract anything
Expand Down Expand Up @@ -779,7 +780,7 @@ void TemplateInterpreterGenerator::lock_method() {
const Address monitor_block_top(
rfp,
frame::interpreter_frame_monitor_block_top_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();

#ifdef ASSERT
{
Expand Down
Loading

0 comments on commit 481893b

Please sign in to comment.