Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[GR-38378] Merge in jdk-17.0.4+5.
Browse files Browse the repository at this point in the history
PullRequest: labsjdk-ce-17/45
  • Loading branch information
marwan-hallaoui committed Jun 3, 2022
2 parents 059a4a3 + 03e9945 commit da628f0
Show file tree
Hide file tree
Showing 361 changed files with 9,828 additions and 4,461 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/submit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ jobs:
FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }}
INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }}
UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }}
if [ "x${UPDATE}" != "x0" ]; then
PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }}
if [ "x${PATCH}" != "x0" ]; then
V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH}
elif [ "x${UPDATE}" != "x0" ]; then
V=${FEATURE}.${INTERIM}.${UPDATE}
elif [ "x${INTERIM}" != "x0" ]; then
V={FEATURE}.${INTERIM}
Expand Down
22 changes: 22 additions & 0 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,24 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
# info flags for toolchains unless we know they work.
# See JDK-8207057.
ASFLAGS_DEBUG_SYMBOLS=""
# Debug prefix mapping if supported by compiler
DEBUG_PREFIX_CFLAGS=
# Debug symbols
if test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
# the debug symbol paths resolve to paths relative to the workspace root.
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
DEBUG_PREFIX_CFLAGS="-fdebug-prefix-map=${workspace_root_trailing_slash}="
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}],
IF_FALSE: [
DEBUG_PREFIX_CFLAGS=
]
)
fi
CFLAGS_DEBUG_SYMBOLS="-g"
ASFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
Expand All @@ -108,6 +124,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
CFLAGS_DEBUG_SYMBOLS="-Z7"
fi
if test "x$DEBUG_PREFIX_CFLAGS" != x; then
CFLAGS_DEBUG_SYMBOLS="$CFLAGS_DEBUG_SYMBOLS $DEBUG_PREFIX_CFLAGS"
ASFLAGS_DEBUG_SYMBOLS="$ASFLAGS_DEBUG_SYMBOLS $DEBUG_PREFIX_CFLAGS"
fi
AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
AC_SUBST(ASFLAGS_DEBUG_SYMBOLS)
])
Expand Down Expand Up @@ -159,6 +180,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
clang)
DISABLE_WARNING_PREFIX="-Wno-"
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
# Additional warnings that are not activated by -Wall and -Wextra
Expand Down
9 changes: 6 additions & 3 deletions make/common/JarArchive.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, 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 @@ -193,7 +193,8 @@ define SetupJarArchiveBody
$1_UPDATE_CONTENTS=\
if [ "`$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \
$(ECHO) " updating" `$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents; \
$(SORT) $$($1_BIN)/_the.$$($1_JARNAME)_contents > $$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted && \
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted; \
fi $$(NEWLINE)
# The s-variants of the above macros are used when the jar is created from scratch.
# NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
Expand All @@ -212,7 +213,9 @@ define SetupJarArchiveBody
| $(SED) 's|$$(src)/|-C $$(src) |g' >> \
$$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
endif
$1_SUPDATE_CONTENTS=$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
$1_SUPDATE_CONTENTS=\
$(SORT) $$($1_BIN)/_the.$$($1_JARNAME)_contents > $$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted && \
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted $$(NEWLINE)

# Use a slightly shorter name for logging, but with enough path to identify this jar.
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR))
Expand Down
22 changes: 21 additions & 1 deletion make/common/NativeCompilation.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, 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 @@ -358,6 +358,20 @@ define SetupCompileNativeFileBody
# Compile as preprocessed assembler file
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
$1_COMPILER := $(AS)

# gcc assembly files must contain an appropriate relative .file
# path for reproducible builds.
ifeq ($(TOOLCHAIN_TYPE), gcc)
# If no absolute paths allowed, work out relative source file path
# for assembly .file substitution, otherwise use full file path
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false)
$1_REL_ASM_SRC := $$(call RelativePath, $$($1_FILE), $(WORKSPACE_ROOT))
else
$1_REL_ASM_SRC := $$($1_FILE)
endif
$1_FLAGS := $$($1_FLAGS) -DASSEMBLY_SRC_FILE='"$$($1_REL_ASM_SRC)"' \
-include $(TOPDIR)/make/data/autoheaders/assemblyprefix.h
endif
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
# Compile as a C++ or Objective-C++ file
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
Expand Down Expand Up @@ -389,6 +403,12 @@ define SetupCompileNativeFileBody
$1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
$$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
$1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
# For reproducible builds with gcc ensure random symbol generation is seeded deterministically
ifeq ($(TOOLCHAIN_TYPE), gcc)
ifeq ($$(ENABLE_REPRODUCIBLE_BUILD), true)
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
endif
endif

$$($1_OBJ_JSON): $$($1_OBJ_DEPS)
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
Expand Down
29 changes: 29 additions & 0 deletions make/data/autoheaders/assemblyprefix.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright (c) 2022, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

// ASSEMBLY_SRC_FILE gets replaced by relative or absolute file path
// in NativeCompilation.gmk for gcc tooling on Linux. This ensures a
// reproducible object file through a predictable value of the STT_FILE
// symbol, and subsequently a reproducible .debuginfo.
.file ASSEMBLY_SRC_FILE

3 changes: 3 additions & 0 deletions make/hotspot/gensrc/GensrcAdlc.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ ifeq ($(call check-jvm-feature, compiler2), true)

ADLC_CFLAGS += -I$(TOPDIR)/src/hotspot/share

# Add file macro mappings
ADLC_CFLAGS += $(FILE_MACRO_CFLAGS)

$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
NAME := adlc, \
TYPE := EXECUTABLE, \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, 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 @@ -204,6 +204,10 @@ void addEntry(ZipOutputStream zos, ZipEntry entry, InputStream entryInputStream)
entry.setTimeLocal(timestamp);
}

// Ensure "extra" field is not set from original ZipEntry info that may be not deterministic
// eg.may contain specific UID/GID
entry.setExtra(null);

zos.putNextEntry(entry);
if (entry.getSize() > 0 && entryInputStream != null) {
entryInputStream.transferTo(zos);
Expand Down
16 changes: 11 additions & 5 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ template <int N> static void get_header_version(char (&header_version) [N]) {
assert(header_version[JVM_IDENT_MAX-1] == 0, "must be");
}

FileMapInfo::FileMapInfo(bool is_static) {
memset((void*)this, 0, sizeof(FileMapInfo));
_is_static = is_static;
FileMapInfo::FileMapInfo(bool is_static) :
_is_static(is_static), _file_open(false), _is_mapped(false), _fd(-1), _file_offset(0),
_full_path(nullptr), _base_archive_name(nullptr), _header(nullptr) {
size_t header_size;
if (is_static) {
assert(_current_info == NULL, "must be singleton"); // not thread safe
Expand All @@ -183,8 +183,6 @@ FileMapInfo::FileMapInfo(bool is_static) {
_header->set_header_size(header_size);
_header->set_version(INVALID_CDS_ARCHIVE_VERSION);
_header->set_has_platform_or_app_classes(true);
_file_offset = 0;
_file_open = false;
}

FileMapInfo::~FileMapInfo() {
Expand All @@ -195,6 +193,14 @@ FileMapInfo::~FileMapInfo() {
assert(_dynamic_archive_info == this, "must be singleton"); // not thread safe
_dynamic_archive_info = NULL;
}

if (_header != nullptr) {
os::free(_header);
}

if (_file_open) {
::close(_fd);
}
}

void FileMapInfo::populate_header(size_t core_region_alignment) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2022, 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 @@ -378,9 +378,7 @@ public void drawWindowTitle(final Graphics g, final JInternalFrame frame, final
final int x = inX;
final int y = inY;
final int w = inW;
int h = inH;

h = metrics.titleBarHeight + inH;
final int h = inH;

// paint the background
titleBarPainter.state.set(frame.isSelected() ? State.ACTIVE : State.INACTIVE);
Expand Down
80 changes: 76 additions & 4 deletions src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2022, 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 @@ -81,17 +81,89 @@ public void drawString(final SunGraphics2D sg2d, final String s, final double x,
}
}

public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) {
final Font prevFont = sg2d.getFont();
sg2d.setFont(gV.getFont());
private boolean hasSlotData(GlyphVector gv) {
final int length = gv.getNumGlyphs();
for (int i = 0; i < length; i++) {
if ((gv.getGlyphCode(i) & CompositeGlyphMapper.SLOTMASK) != 0) {
return true;
}
}
return false;
}

private Font getSlotFont(Font font, int slot) {
Font2D f2d = FontUtilities.getFont2D(font);
if (f2d instanceof CFont) {
CompositeFont cf = ((CFont)f2d).getCompositeFont2D();
PhysicalFont pf = cf.getSlotFont(slot);
Font f = new Font(pf.getFontName(null),
font.getStyle(), font.getSize());
return f;
}
return null;
}

private GlyphVector getGlyphVectorWithRange(final Font font, final GlyphVector gV, int start, int count) {
int[] glyphs = new int[count];
for (int i = 0; i < count; i++) {
glyphs[i] = gV.getGlyphCode(start+i) & CompositeGlyphMapper.GLYPHMASK;
}
// Positions should be null to recalculate by native methods,
// if GV was segmented.
StandardGlyphVector sgv = new StandardGlyphVector(font,
gV.getFontRenderContext(),
glyphs,
null, // positions
null, // indices
gV.getLayoutFlags());
return sgv;
}

private int getLengthOfSameSlot(final GlyphVector gV, final int targetSlot, final int start, final int length) {
int count = 1;
for (; start + count < length; count++) {
int slot = (gV.getGlyphCode(start + count) &
CompositeGlyphMapper.SLOTMASK) >> 24;
if (targetSlot != slot) {
break;
}
}
return count;
}

private void drawGlyphVectorImpl(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) {
final long nativeStrikePtr = getNativeStrikePtr(sg2d);
if (OSXSurfaceData.IsSimpleColor(sg2d.paint) && nativeStrikePtr != 0) {
final OSXSurfaceData surfaceData = (OSXSurfaceData)sg2d.getSurfaceData();
surfaceData.drawGlyphs(this, sg2d, nativeStrikePtr, gV, x, y);
} else {
drawGlyphVectorAsShape(sg2d, gV, x, y);
}
}

public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) {
final Font prevFont = sg2d.getFont();
sg2d.setFont(gV.getFont());

if (hasSlotData(gV)) {
final int length = gV.getNumGlyphs();
float[] positions = gV.getGlyphPositions(0, length, null);
int start = 0;
while (start < length) {
int slot = (gV.getGlyphCode(start) &
CompositeGlyphMapper.SLOTMASK) >> 24;
sg2d.setFont(getSlotFont(gV.getFont(), slot));
int count = getLengthOfSameSlot(gV, slot, start, length);
GlyphVector rangeGV = getGlyphVectorWithRange(sg2d.getFont(),
gV, start, count);
drawGlyphVectorImpl(sg2d, rangeGV,
x + positions[start * 2],
y + positions[start * 2 + 1]);
start += count;
}
} else {
drawGlyphVectorImpl(sg2d, gV, x, y);
}
sg2d.setFont(prevFont);
}

Expand Down
6 changes: 4 additions & 2 deletions src/java.desktop/share/classes/sun/awt/FontConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2022, 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 @@ -963,7 +963,9 @@ private CharsetEncoder getFontCharsetEncoder(final String charsetName,
return fc.newEncoder();
}

if (!charsetName.startsWith("sun.awt.") && !charsetName.equals("default")) {
if (!charsetName.startsWith("sun.awt.") &&
!charsetName.equals("default") &&
!charsetName.startsWith("sun.font.")) {
fc = Charset.forName(charsetName);
} else {
@SuppressWarnings("removal")
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/share/legal/freetype.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## The FreeType Project: Freetype v2.10.4
## The FreeType Project: Freetype v2.12.0


### FreeType Notice
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/share/native/libfreetype/UPDATING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ src/java.desktop/share/legal/freetype.md

When updating specify --with-freetype=bundled to test builds to
expose build issues.
This is important because presently on Linux and Solaris the build
This is important because presently on Linux the build
defaults to linking against the system library and does not attempt
to compile the sources.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* ANSI-specific configuration file (specification only).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
Loading

0 comments on commit da628f0

Please sign in to comment.