Skip to content

Commit b5ebe50

Browse files
committed
Merge master jdk-17.0.4+5 into openj9-staging
2 parents e6d04dd + 0cd7516 commit b5ebe50

File tree

360 files changed

+9817
-4456
lines changed

Some content is hidden

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

360 files changed

+9817
-4456
lines changed

.github/workflows/submit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ jobs:
7878
FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }}
7979
INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }}
8080
UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }}
81-
if [ "x${UPDATE}" != "x0" ]; then
81+
PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }}
82+
if [ "x${PATCH}" != "x0" ]; then
83+
V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH}
84+
elif [ "x${UPDATE}" != "x0" ]; then
8285
V=${FEATURE}.${INTERIM}.${UPDATE}
8386
elif [ "x${INTERIM}" != "x0" ]; then
8487
V={FEATURE}.${INTERIM}

make/autoconf/flags-cflags.m4

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,24 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
9595
# info flags for toolchains unless we know they work.
9696
# See JDK-8207057.
9797
ASFLAGS_DEBUG_SYMBOLS=""
98+
99+
# Debug prefix mapping if supported by compiler
100+
DEBUG_PREFIX_CFLAGS=
101+
98102
# Debug symbols
99103
if test "x$TOOLCHAIN_TYPE" = xgcc; then
104+
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
105+
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
106+
# the debug symbol paths resolve to paths relative to the workspace root.
107+
workspace_root_trailing_slash="${WORKSPACE_ROOT%/}/"
108+
DEBUG_PREFIX_CFLAGS="-fdebug-prefix-map=${workspace_root_trailing_slash}="
109+
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}],
110+
IF_FALSE: [
111+
DEBUG_PREFIX_CFLAGS=
112+
]
113+
)
114+
fi
115+
100116
CFLAGS_DEBUG_SYMBOLS="-g"
101117
ASFLAGS_DEBUG_SYMBOLS="-g"
102118
elif test "x$TOOLCHAIN_TYPE" = xclang; then
@@ -108,6 +124,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
108124
CFLAGS_DEBUG_SYMBOLS="-Z7"
109125
fi
110126
127+
if test "x$DEBUG_PREFIX_CFLAGS" != x; then
128+
CFLAGS_DEBUG_SYMBOLS="$CFLAGS_DEBUG_SYMBOLS $DEBUG_PREFIX_CFLAGS"
129+
ASFLAGS_DEBUG_SYMBOLS="$ASFLAGS_DEBUG_SYMBOLS $DEBUG_PREFIX_CFLAGS"
130+
fi
131+
111132
AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
112133
AC_SUBST(ASFLAGS_DEBUG_SYMBOLS)
113134
])
@@ -159,6 +180,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
159180
160181
clang)
161182
DISABLE_WARNING_PREFIX="-Wno-"
183+
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
162184
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
163185
164186
# Additional warnings that are not activated by -Wall and -Wextra

make/common/JarArchive.gmk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -193,7 +193,8 @@ define SetupJarArchiveBody
193193
$1_UPDATE_CONTENTS=\
194194
if [ "`$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \
195195
$(ECHO) " updating" `$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
196-
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents; \
196+
$(SORT) $$($1_BIN)/_the.$$($1_JARNAME)_contents > $$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted && \
197+
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted; \
197198
fi $$(NEWLINE)
198199
# The s-variants of the above macros are used when the jar is created from scratch.
199200
# NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
@@ -212,7 +213,9 @@ define SetupJarArchiveBody
212213
| $(SED) 's|$$(src)/|-C $$(src) |g' >> \
213214
$$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
214215
endif
215-
$1_SUPDATE_CONTENTS=$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
216+
$1_SUPDATE_CONTENTS=\
217+
$(SORT) $$($1_BIN)/_the.$$($1_JARNAME)_contents > $$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted && \
218+
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted $$(NEWLINE)
216219

217220
# Use a slightly shorter name for logging, but with enough path to identify this jar.
218221
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR))

make/common/NativeCompilation.gmk

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, 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
@@ -358,6 +358,20 @@ define SetupCompileNativeFileBody
358358
# Compile as preprocessed assembler file
359359
$1_FLAGS := $(BASIC_ASFLAGS) $$($1_BASE_ASFLAGS)
360360
$1_COMPILER := $(AS)
361+
362+
# gcc assembly files must contain an appropriate relative .file
363+
# path for reproducible builds.
364+
ifeq ($(TOOLCHAIN_TYPE), gcc)
365+
# If no absolute paths allowed, work out relative source file path
366+
# for assembly .file substitution, otherwise use full file path
367+
ifeq ($(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT), false)
368+
$1_REL_ASM_SRC := $$(call RelativePath, $$($1_FILE), $(WORKSPACE_ROOT))
369+
else
370+
$1_REL_ASM_SRC := $$($1_FILE)
371+
endif
372+
$1_FLAGS := $$($1_FLAGS) -DASSEMBLY_SRC_FILE='"$$($1_REL_ASM_SRC)"' \
373+
-include $(TOPDIR)/make/data/autoheaders/assemblyprefix.h
374+
endif
361375
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
362376
# Compile as a C++ or Objective-C++ file
363377
$1_FLAGS := $(CFLAGS_CCACHE) $$($1_USE_PCH_FLAGS) $$($1_BASE_CXXFLAGS) \
@@ -389,6 +403,12 @@ define SetupCompileNativeFileBody
389403
$1_OBJ_DEPS := $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
390404
$$($$($1_BASE)_EXTRA_DEPS) $$($1_VARDEPS_FILE)
391405
$1_COMPILE_OPTIONS := $$($1_FLAGS) $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)
406+
# For reproducible builds with gcc ensure random symbol generation is seeded deterministically
407+
ifeq ($(TOOLCHAIN_TYPE), gcc)
408+
ifeq ($$(ENABLE_REPRODUCIBLE_BUILD), true)
409+
$1_COMPILE_OPTIONS += -frandom-seed="$$($1_FILENAME)"
410+
endif
411+
endif
392412

393413
$$($1_OBJ_JSON): $$($1_OBJ_DEPS)
394414
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation.
8+
#
9+
# This code is distributed in the hope that it will be useful, but WITHOUT
10+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
# version 2 for more details (a copy is included in the LICENSE file that
13+
# accompanied this code).
14+
#
15+
# You should have received a copy of the GNU General Public License version
16+
# 2 along with this work; if not, write to the Free Software Foundation,
17+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
#
19+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
# or visit www.oracle.com if you need additional information or have any
21+
# questions.
22+
#
23+
24+
// ASSEMBLY_SRC_FILE gets replaced by relative or absolute file path
25+
// in NativeCompilation.gmk for gcc tooling on Linux. This ensures a
26+
// reproducible object file through a predictable value of the STT_FILE
27+
// symbol, and subsequently a reproducible .debuginfo.
28+
.file ASSEMBLY_SRC_FILE
29+

make/hotspot/gensrc/GensrcAdlc.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ ifeq ($(call check-jvm-feature, compiler2), true)
5858

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

61+
# Add file macro mappings
62+
ADLC_CFLAGS += $(FILE_MACRO_CFLAGS)
63+
6164
$(eval $(call SetupNativeCompilation, BUILD_ADLC, \
6265
NAME := adlc, \
6366
TYPE := EXECUTABLE, \

make/jdk/src/classes/build/tools/makezipreproducible/MakeZipReproducible.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, 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
@@ -204,6 +204,10 @@ void addEntry(ZipOutputStream zos, ZipEntry entry, InputStream entryInputStream)
204204
entry.setTimeLocal(timestamp);
205205
}
206206

207+
// Ensure "extra" field is not set from original ZipEntry info that may be not deterministic
208+
// eg.may contain specific UID/GID
209+
entry.setExtra(null);
210+
207211
zos.putNextEntry(entry);
208212
if (entry.getSize() > 0 && entryInputStream != null) {
209213
entryInputStream.transferTo(zos);

src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameBorder.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2022, 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
@@ -378,9 +378,7 @@ public void drawWindowTitle(final Graphics g, final JInternalFrame frame, final
378378
final int x = inX;
379379
final int y = inY;
380380
final int w = inW;
381-
int h = inH;
382-
383-
h = metrics.titleBarHeight + inH;
381+
final int h = inH;
384382

385383
// paint the background
386384
titleBarPainter.state.set(frame.isSelected() ? State.ACTIVE : State.INACTIVE);

src/java.desktop/macosx/classes/sun/lwawt/macosx/CTextPipe.java

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2022, 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
@@ -81,17 +81,89 @@ public void drawString(final SunGraphics2D sg2d, final String s, final double x,
8181
}
8282
}
8383

84-
public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) {
85-
final Font prevFont = sg2d.getFont();
86-
sg2d.setFont(gV.getFont());
84+
private boolean hasSlotData(GlyphVector gv) {
85+
final int length = gv.getNumGlyphs();
86+
for (int i = 0; i < length; i++) {
87+
if ((gv.getGlyphCode(i) & CompositeGlyphMapper.SLOTMASK) != 0) {
88+
return true;
89+
}
90+
}
91+
return false;
92+
}
93+
94+
private Font getSlotFont(Font font, int slot) {
95+
Font2D f2d = FontUtilities.getFont2D(font);
96+
if (f2d instanceof CFont) {
97+
CompositeFont cf = ((CFont)f2d).getCompositeFont2D();
98+
PhysicalFont pf = cf.getSlotFont(slot);
99+
Font f = new Font(pf.getFontName(null),
100+
font.getStyle(), font.getSize());
101+
return f;
102+
}
103+
return null;
104+
}
105+
106+
private GlyphVector getGlyphVectorWithRange(final Font font, final GlyphVector gV, int start, int count) {
107+
int[] glyphs = new int[count];
108+
for (int i = 0; i < count; i++) {
109+
glyphs[i] = gV.getGlyphCode(start+i) & CompositeGlyphMapper.GLYPHMASK;
110+
}
111+
// Positions should be null to recalculate by native methods,
112+
// if GV was segmented.
113+
StandardGlyphVector sgv = new StandardGlyphVector(font,
114+
gV.getFontRenderContext(),
115+
glyphs,
116+
null, // positions
117+
null, // indices
118+
gV.getLayoutFlags());
119+
return sgv;
120+
}
121+
122+
private int getLengthOfSameSlot(final GlyphVector gV, final int targetSlot, final int start, final int length) {
123+
int count = 1;
124+
for (; start + count < length; count++) {
125+
int slot = (gV.getGlyphCode(start + count) &
126+
CompositeGlyphMapper.SLOTMASK) >> 24;
127+
if (targetSlot != slot) {
128+
break;
129+
}
130+
}
131+
return count;
132+
}
87133

134+
private void drawGlyphVectorImpl(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) {
88135
final long nativeStrikePtr = getNativeStrikePtr(sg2d);
89136
if (OSXSurfaceData.IsSimpleColor(sg2d.paint) && nativeStrikePtr != 0) {
90137
final OSXSurfaceData surfaceData = (OSXSurfaceData)sg2d.getSurfaceData();
91138
surfaceData.drawGlyphs(this, sg2d, nativeStrikePtr, gV, x, y);
92139
} else {
93140
drawGlyphVectorAsShape(sg2d, gV, x, y);
94141
}
142+
}
143+
144+
public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) {
145+
final Font prevFont = sg2d.getFont();
146+
sg2d.setFont(gV.getFont());
147+
148+
if (hasSlotData(gV)) {
149+
final int length = gV.getNumGlyphs();
150+
float[] positions = gV.getGlyphPositions(0, length, null);
151+
int start = 0;
152+
while (start < length) {
153+
int slot = (gV.getGlyphCode(start) &
154+
CompositeGlyphMapper.SLOTMASK) >> 24;
155+
sg2d.setFont(getSlotFont(gV.getFont(), slot));
156+
int count = getLengthOfSameSlot(gV, slot, start, length);
157+
GlyphVector rangeGV = getGlyphVectorWithRange(sg2d.getFont(),
158+
gV, start, count);
159+
drawGlyphVectorImpl(sg2d, rangeGV,
160+
x + positions[start * 2],
161+
y + positions[start * 2 + 1]);
162+
start += count;
163+
}
164+
} else {
165+
drawGlyphVectorImpl(sg2d, gV, x, y);
166+
}
95167
sg2d.setFont(prevFont);
96168
}
97169

src/java.desktop/share/classes/sun/awt/FontConfiguration.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2022, 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
@@ -963,7 +963,9 @@ private CharsetEncoder getFontCharsetEncoder(final String charsetName,
963963
return fc.newEncoder();
964964
}
965965

966-
if (!charsetName.startsWith("sun.awt.") && !charsetName.equals("default")) {
966+
if (!charsetName.startsWith("sun.awt.") &&
967+
!charsetName.equals("default") &&
968+
!charsetName.startsWith("sun.font.")) {
967969
fc = Charset.forName(charsetName);
968970
} else {
969971
@SuppressWarnings("removal")

0 commit comments

Comments
 (0)