Skip to content

Commit d24b593

Browse files
committed
Merge
2 parents ffb601f + d354141 commit d24b593

File tree

1,165 files changed

+23217
-12414
lines changed

Some content is hidden

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

1,165 files changed

+23217
-12414
lines changed

make/Main.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,9 @@ else
10531053
# All modules include the main license files from java.base.
10541054
$(JMOD_TARGETS): java.base-copy
10551055

1056+
# jdk.javadoc uses an internal copy of the main license files from java.base.
1057+
jdk.javadoc-copy: java.base-copy
1058+
10561059
zip-security: $(filter jdk.crypto%, $(JAVA_TARGETS))
10571060

10581061
ifeq ($(ENABLE_GENERATE_CLASSLIST), true)

make/autoconf/flags-cflags.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
522522
# do this on s390x also for libjvm (where serviceability agent is not supported)
523523
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
524524
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -ffunction-sections -fdata-sections"
525-
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
525+
if test "x$OPENJDK_TARGET_CPU" = xs390x && test "x$DEBUG_LEVEL" == xrelease; then
526526
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
527527
fi
528528
fi

make/autoconf/lib-hsdis.m4

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,25 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS],
255255
disasm_header="\"$BINUTILS_INSTALL_DIR/include/dis-asm.h\""
256256
if test -e $BINUTILS_INSTALL_DIR/lib/libbfd.a && \
257257
test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \
258-
test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then
258+
(test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a || test -e $BINUTILS_INSTALL_DIR/lib64/libiberty.a); then
259259
HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB -I$BINUTILS_INSTALL_DIR/include"
260-
HSDIS_LIBS="$BINUTILS_INSTALL_DIR/lib/libbfd.a $BINUTILS_INSTALL_DIR/lib/libopcodes.a $BINUTILS_INSTALL_DIR/lib/libiberty.a"
260+
261+
# libiberty ignores --libdir and may be installed in $BINUTILS_INSTALL_DIR/lib or $BINUTILS_INSTALL_DIR/lib64
262+
# depending on system setup
263+
LIBIBERTY_LIB=""
264+
if test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then
265+
LIBIBERTY_LIB="$BINUTILS_INSTALL_DIR/lib/libiberty.a"
266+
else
267+
LIBIBERTY_LIB="$BINUTILS_INSTALL_DIR/lib64/libiberty.a"
268+
fi
269+
HSDIS_LIBS="$BINUTILS_INSTALL_DIR/lib/libbfd.a $BINUTILS_INSTALL_DIR/lib/libopcodes.a $LIBIBERTY_LIB"
261270
# If we have libsframe add it.
262271
if test -e $BINUTILS_INSTALL_DIR/lib/libsframe.a; then
263272
HSDIS_LIBS="$HSDIS_LIBS $BINUTILS_INSTALL_DIR/lib/libsframe.a"
264273
fi
265274
AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], AC_MSG_ERROR([libz not found]))
266275
else
267-
AC_MSG_ERROR(["$BINUTILS_INSTALL_DIR/libs/ must contain libbfd.a, libopcodes.a, libiberty.a"])
276+
AC_MSG_ERROR(["$BINUTILS_INSTALL_DIR/lib[64] must contain libbfd.a, libopcodes.a and libiberty.a"])
268277
fi
269278
fi
270279

make/langtools/tools/javacserver/client/Client.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
public class Client {
5252
private static final Log.Level LOG_LEVEL = Log.Level.INFO;
5353

54-
// Wait 2 seconds for response, before giving up on javac server.
55-
private static final int CONNECTION_TIMEOUT = 2000;
56-
private static final int MAX_CONNECT_ATTEMPTS = 3;
54+
// Wait 4 seconds for response, before giving up on javac server.
55+
private static final int CONNECTION_TIMEOUT = 4000;
56+
private static final int MAX_CONNECT_ATTEMPTS = 10;
5757
private static final int WAIT_BETWEEN_CONNECT_ATTEMPTS = 2000;
5858

5959
private final ClientConfiguration conf;
@@ -130,7 +130,7 @@ private Socket tryConnect() throws IOException, InterruptedException {
130130
Log.error("Connection attempt failed: " + ex.getMessage());
131131
if (attempt >= MAX_CONNECT_ATTEMPTS) {
132132
Log.error("Giving up");
133-
throw new IOException("Could not connect to server", ex);
133+
throw new IOException("Could not connect to server after " + MAX_CONNECT_ATTEMPTS + " attempts with timeout " + CONNECTION_TIMEOUT, ex);
134134
}
135135
}
136136
Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);

make/modules/java.desktop/lib/Awt2dLibraries.gmk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,11 @@ else
495495
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
496496
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc
497497

498+
# list of disabled warnings and the compilers for which it was specifically added.
499+
# array-bounds -> GCC 12 on Alpine Linux
500+
# parentheses -> GCC 6
501+
# range-loop-analysis -> clang on Xcode12
502+
498503
HARFBUZZ_DISABLED_WARNINGS_gcc := missing-field-initializers strict-aliasing \
499504
unused-result array-bounds parentheses
500505
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.

make/modules/jdk.javadoc/Copy.gmk

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Copyright (c) 2023, 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. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, write to the Free Software Foundation,
19+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
# or visit www.oracle.com if you need additional information or have any
23+
# questions.
24+
#
25+
26+
include CopyCommon.gmk
27+
28+
JDK_JAVADOC_DIR := $(JDK_OUTPUTDIR)/modules/jdk.javadoc
29+
JDK_JAVADOC_DOCLET_RESOURCE_DIR := $(JDK_JAVADOC_DIR)/jdk/javadoc/internal/doclets/formats/html/resources
30+
31+
################################################################################
32+
33+
$(eval $(call SetupCopyFiles, COPY_JAVADOC_MODULE_LEGAL_RESOURCES, \
34+
DEST := $(JDK_JAVADOC_DOCLET_RESOURCE_DIR)/legal, \
35+
FILES := $(wildcard $(MODULE_SRC)/share/legal/*.md), \
36+
))
37+
TARGETS += $(COPY_JAVADOC_MODULE_LEGAL_RESOURCES)
38+
39+
################################################################################
40+
41+
$(eval $(call SetupCopyFiles, COPY_JAVADOC_COMMON_LEGAL_RESOURCES, \
42+
DEST := $(JDK_JAVADOC_DOCLET_RESOURCE_DIR)/legal, \
43+
FILES := $(wildcard $(COMMON_LEGAL_DST_DIR)/*), \
44+
))
45+
TARGETS += $(COPY_JAVADOC_COMMON_LEGAL_RESOURCES)
46+
47+
################################################################################

src/hotspot/cpu/riscv/assembler_riscv.hpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,26 @@ enum operand_size { int8, int16, int32, uint32, int64 };
10741074

10751075
#undef INSN
10761076

1077-
// Float and Double Conversion Instruction
1077+
enum fclass_mask {
1078+
minf = 1 << 0, // negative infinite
1079+
mnorm = 1 << 1, // negative normal number
1080+
msubnorm = 1 << 2, // negative subnormal number
1081+
mzero = 1 << 3, // negative zero
1082+
pzero = 1 << 4, // positive zero
1083+
psubnorm = 1 << 5, // positive subnormal number
1084+
pnorm = 1 << 6, // positive normal number
1085+
pinf = 1 << 7, // positive infinite
1086+
snan = 1 << 8, // signaling NaN
1087+
qnan = 1 << 9, // quiet NaN
1088+
zero = mzero | pzero,
1089+
subnorm = msubnorm | psubnorm,
1090+
norm = mnorm | pnorm,
1091+
inf = minf | pinf,
1092+
nan = snan | qnan,
1093+
finite = zero | subnorm | norm,
1094+
};
1095+
1096+
// Float and Double Conversion/Classify Instruction
10781097
#define INSN(NAME, op, funct3, funct5, funct7) \
10791098
void NAME(Register Rd, FloatRegister Rs1) { \
10801099
unsigned insn = 0; \

src/hotspot/cpu/riscv/c1_LIRAssembler_arith_riscv.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void LIR_Assembler::arithmetic_idiv(LIR_Code code, LIR_Opr left, LIR_Opr right,
8686
}
8787
} else {
8888
Register rreg = right->as_register();
89-
__ corrected_idivl(dreg, lreg, rreg, is_irem);
89+
__ corrected_idivl(dreg, lreg, rreg, is_irem, /* is_signed */ true);
9090
}
9191
}
9292

@@ -172,8 +172,12 @@ void LIR_Assembler::arith_op_double_cpu(LIR_Code code, LIR_Opr left, LIR_Opr rig
172172
case lir_add: __ add(dest->as_register_lo(), lreg_lo, rreg_lo); break;
173173
case lir_sub: __ sub(dest->as_register_lo(), lreg_lo, rreg_lo); break;
174174
case lir_mul: __ mul(dest->as_register_lo(), lreg_lo, rreg_lo); break;
175-
case lir_div: __ corrected_idivq(dest->as_register_lo(), lreg_lo, rreg_lo, false); break;
176-
case lir_rem: __ corrected_idivq(dest->as_register_lo(), lreg_lo, rreg_lo, true); break;
175+
case lir_div: __ corrected_idivq(dest->as_register_lo(), lreg_lo, rreg_lo,
176+
/* want_remainder */ false, /* is_signed */ true);
177+
break;
178+
case lir_rem: __ corrected_idivq(dest->as_register_lo(), lreg_lo, rreg_lo,
179+
/* want_remainder */ true, /* is_signed */ true);
180+
break;
177181
default:
178182
ShouldNotReachHere();
179183
}

src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
6363
if (DiagnoseSyncOnValueBasedClasses != 0) {
6464
load_klass(flag, oop);
6565
lwu(flag, Address(flag, Klass::access_flags_offset()));
66-
test_bit(flag, flag, exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS), tmp /* tmp */);
66+
test_bit(flag, flag, exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS));
6767
bnez(flag, cont, true /* is_far */);
6868
}
6969

@@ -1571,7 +1571,7 @@ void C2_MacroAssembler::minmax_fp(FloatRegister dst, FloatRegister src1, FloatRe
15711571
is_double ? fclass_d(t1, src2)
15721572
: fclass_s(t1, src2);
15731573
orr(t0, t0, t1);
1574-
andi(t0, t0, 0b1100000000); //if src1 or src2 is quiet or signaling NaN then return NaN
1574+
andi(t0, t0, fclass_mask::nan); // if src1 or src2 is quiet or signaling NaN then return NaN
15751575
beqz(t0, Compare);
15761576
is_double ? fadd_d(dst, src1, src2)
15771577
: fadd_s(dst, src1, src2);
@@ -1669,12 +1669,8 @@ void C2_MacroAssembler::signum_fp(FloatRegister dst, FloatRegister src, FloatReg
16691669
is_double ? fmv_d(dst, src)
16701670
: fmv_s(dst, src);
16711671

1672-
//bitmask 0b1100011000 specifies this bits:
1673-
// 3 - src is -0
1674-
// 4 - src is +0
1675-
// 8 - src is signaling NaN
1676-
// 9 - src is a quiet NaN
1677-
andi(tmp1, tmp1, 0b1100011000);
1672+
// check if input is -0, +0, signaling NaN or quiet NaN
1673+
andi(tmp1, tmp1, fclass_mask::zero | fclass_mask::nan);
16781674

16791675
bnez(tmp1, done);
16801676

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,7 @@ void MacroAssembler::store_heap_oop_null(Address dst) {
23862386
}
23872387

23882388
int MacroAssembler::corrected_idivl(Register result, Register rs1, Register rs2,
2389-
bool want_remainder)
2389+
bool want_remainder, bool is_signed)
23902390
{
23912391
// Full implementation of Java idiv and irem. The function
23922392
// returns the (pc) offset of the div instruction - may be needed
@@ -2402,15 +2402,24 @@ int MacroAssembler::corrected_idivl(Register result, Register rs1, Register rs2,
24022402

24032403
int idivl_offset = offset();
24042404
if (!want_remainder) {
2405-
divw(result, rs1, rs2);
2405+
if (is_signed) {
2406+
divw(result, rs1, rs2);
2407+
} else {
2408+
divuw(result, rs1, rs2);
2409+
}
24062410
} else {
2407-
remw(result, rs1, rs2); // result = rs1 % rs2;
2411+
// result = rs1 % rs2;
2412+
if (is_signed) {
2413+
remw(result, rs1, rs2);
2414+
} else {
2415+
remuw(result, rs1, rs2);
2416+
}
24082417
}
24092418
return idivl_offset;
24102419
}
24112420

24122421
int MacroAssembler::corrected_idivq(Register result, Register rs1, Register rs2,
2413-
bool want_remainder)
2422+
bool want_remainder, bool is_signed)
24142423
{
24152424
// Full implementation of Java ldiv and lrem. The function
24162425
// returns the (pc) offset of the div instruction - may be needed
@@ -2425,9 +2434,18 @@ int MacroAssembler::corrected_idivq(Register result, Register rs1, Register rs2,
24252434

24262435
int idivq_offset = offset();
24272436
if (!want_remainder) {
2428-
div(result, rs1, rs2);
2437+
if (is_signed) {
2438+
div(result, rs1, rs2);
2439+
} else {
2440+
divu(result, rs1, rs2);
2441+
}
24292442
} else {
2430-
rem(result, rs1, rs2); // result = rs1 % rs2;
2443+
// result = rs1 % rs2;
2444+
if (is_signed) {
2445+
rem(result, rs1, rs2);
2446+
} else {
2447+
remu(result, rs1, rs2);
2448+
}
24312449
}
24322450
return idivq_offset;
24332451
}
@@ -4228,7 +4246,7 @@ void MacroAssembler::FLOATCVT##_safe(Register dst, FloatRegister src, Register t
42284246
fclass_##FLOATSIG(tmp, src); \
42294247
mv(dst, zr); \
42304248
/* check if src is NaN */ \
4231-
andi(tmp, tmp, 0b1100000000); \
4249+
andi(tmp, tmp, fclass_mask::nan); \
42324250
bnez(tmp, done); \
42334251
FLOATCVT(dst, src); \
42344252
bind(done); \
@@ -4659,13 +4677,19 @@ void MacroAssembler::rt_call(address dest, Register tmp) {
46594677
}
46604678
}
46614679

4662-
void MacroAssembler::test_bit(Register Rd, Register Rs, uint32_t bit_pos, Register tmp) {
4680+
void MacroAssembler::test_bit(Register Rd, Register Rs, uint32_t bit_pos) {
46634681
assert(bit_pos < 64, "invalid bit range");
46644682
if (UseZbs) {
46654683
bexti(Rd, Rs, bit_pos);
46664684
return;
46674685
}
4668-
andi(Rd, Rs, 1UL << bit_pos, tmp);
4686+
int64_t imm = (int64_t)(1UL << bit_pos);
4687+
if (is_simm12(imm)) {
4688+
and_imm12(Rd, Rs, imm);
4689+
} else {
4690+
srli(Rd, Rs, bit_pos);
4691+
and_imm12(Rd, Rd, 1);
4692+
}
46694693
}
46704694

46714695
// Implements lightweight-locking.

0 commit comments

Comments
 (0)