Skip to content

Commit 37cc252

Browse files
[GR-50935] Merge in tag jdk-23+7.
PullRequest: labsjdk-ce/55
2 parents 1fe1eb2 + c18371b commit 37cc252

File tree

285 files changed

+5847
-2872
lines changed

Some content is hidden

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

285 files changed

+5847
-2872
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ local contains(str, needle) = std.findSubstr(needle, str) != [];
248248
# next JVMCI release has been made. Add the issue id as a comment here.
249249
# You might want to point this to the merge commit of a Graal PR, i.e., include
250250
# the "_gate" suffix.
251-
local downstream_branch = "labsjdk/automation-1-18-2024-242_gate",
251+
local downstream_branch = "labsjdk/automation-1-26-2024-655_gate",
252252

253253
local clone_graal(defs) = {
254254
# Checkout the graal-enterprise repo to the "_gate" version of the

make/Docs.gmk

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ ifeq ($(IS_DRAFT), true)
139139
endif
140140
DRAFT_TEXT := This specification is not final and is subject to change. \
141141
Use is subject to <a href="$(LICENSE_URL)">license terms</a>.
142-
143-
# Workaround stylesheet bug
144-
HEADER_STYLE := style="margin-top: 9px;"
145-
else
146-
HEADER_STYLE := style="margin-top: 14px;"
147142
endif
148143

149144
# $1 - Relative prefix to COPYRIGHT_URL
@@ -339,7 +334,7 @@ define SetupApiDocsGenerationBody
339334
$1_DOC_TITLE := $$($1_LONG_NAME)<br>Version $$(VERSION_SPECIFICATION) API \
340335
Specification
341336
$1_WINDOW_TITLE := $$(subst &amp;,&,$$($1_SHORT_NAME))$$(DRAFT_MARKER_TITLE)
342-
$1_HEADER_TITLE := <div $$(HEADER_STYLE)><strong>$$($1_SHORT_NAME)</strong> \
337+
$1_HEADER_TITLE := <div><strong>$$($1_SHORT_NAME)</strong> \
343338
$$(DRAFT_MARKER_STR)</div>
344339
ifneq ($$($1_OTHER_VERSIONS), )
345340
$1_JAVADOC_BOTTOM := $$(call JAVADOC_BOTTOM, <a href="$$($1_OTHER_VERSIONS)">Other versions.</a>)
@@ -647,7 +642,7 @@ ifeq ($(ENABLE_PANDOC), true)
647642
GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
648643
# Unset the following to suppress the link to the tool guides
649644
NAV_LINK_GUIDES := --nav-link-guides
650-
HEADER_RIGHT_SIDE_INFO := <strong>$(subst &amp;,&,$(JDK_SHORT_NAME))$(DRAFT_MARKER_STR)</strong>
645+
HEADER_RIGHT_SIDE_INFO := <strong>$(subst &amp;,&,$(JDK_SHORT_NAME))</strong>$(DRAFT_MARKER_STR)
651646

652647
$(foreach m, $(ALL_MODULES), \
653648
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \

make/Main.gmk

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,20 +969,28 @@ else
969969

970970
jdk.jdeps-gendata: java
971971

972-
# The ct.sym generation uses all the moduleinfos as input
973-
jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) $(JAVA_TARGETS)
974-
# jdk.compiler-gendata needs the BUILD_JDK. If the BUILD_JDK was supplied
975-
# externally, no extra prerequisites are needed.
972+
# jdk.compiler gendata generates ct.sym, which requires all generated
973+
# java source and compiled classes present.
974+
jdk.compiler-gendata: $(JAVA_TARGETS)
975+
976+
# jdk.javadoc gendata generates element-list, which requires all java sources
977+
# but not compiled classes.
978+
jdk.javadoc-gendata: $(GENSRC_TARGETS)
979+
980+
# ct.sym and element-list generation also needs the BUILD_JDK. If the
981+
# BUILD_JDK was supplied externally, no extra prerequisites are needed.
976982
ifeq ($(CREATE_BUILDJDK), true)
977983
ifneq ($(CREATING_BUILDJDK), true)
978984
# When cross compiling and an external BUILD_JDK wasn't supplied, it's
979985
# produced by the create-buildjdk target.
980986
jdk.compiler-gendata: create-buildjdk
987+
jdk.javadoc-gendata: create-buildjdk
981988
endif
982989
else ifeq ($(EXTERNAL_BUILDJDK), false)
983990
# When not cross compiling, the BUILD_JDK is the interim jdk image, and
984991
# the javac launcher is needed.
985992
jdk.compiler-gendata: jdk.compiler-launchers
993+
jdk.javadoc-gendata: jdk.compiler-launchers
986994
endif
987995

988996
# Declare dependencies between jmod targets.

make/autoconf/flags-cflags.m4

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2024, 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
@@ -117,6 +117,11 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
117117
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_PREFIX_CFLAGS}],
118118
IF_FALSE: [
119119
DEBUG_PREFIX_CFLAGS=
120+
],
121+
IF_TRUE: [
122+
# Add debug prefix map gcc system include paths, as they cause
123+
# non-deterministic debug paths depending on gcc path location.
124+
DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS
120125
]
121126
)
122127
fi
@@ -158,6 +163,55 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
158163
AC_SUBST(ASFLAGS_DEBUG_SYMBOLS)
159164
])
160165

166+
# gcc will embed the full system include paths in the debug info
167+
# resulting in non-deterministic debug symbol files and thus
168+
# non-reproducible native libraries if gcc includes are located
169+
# in different paths.
170+
# Add -fdebug-prefix-map'ings for root and gcc include paths,
171+
# pointing to a common set of folders so that the binaries are deterministic:
172+
# root include : /usr/include
173+
# gcc include : /usr/local/gcc_include
174+
# g++ include : /usr/local/gxx_include
175+
AC_DEFUN([DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS],
176+
[
177+
# Determine gcc system include paths.
178+
# Assume default roots to start with:
179+
GCC_ROOT_INCLUDE="/usr/include"
180+
181+
# Determine is sysroot or devkit specified?
182+
if test "x$SYSROOT" != "x"; then
183+
GCC_ROOT_INCLUDE="${SYSROOT%/}/usr/include"
184+
fi
185+
186+
# Add root include mapping => /usr/include
187+
GCC_INCLUDE_DEBUG_MAP_FLAGS="-fdebug-prefix-map=${GCC_ROOT_INCLUDE}/=/usr/include/"
188+
189+
# Add gcc system include mapping => /usr/local/gcc_include
190+
# Find location of stddef.h using build C compiler
191+
GCC_SYSTEM_INCLUDE=`$ECHO "#include <stddef.h>" | \
192+
$CC $CFLAGS -v -E - 2>&1 | \
193+
$GREP stddef | $TAIL -1 | $TR -s " " | $CUT -d'"' -f2`
194+
if test "x$GCC_SYSTEM_INCLUDE" != "x"; then
195+
GCC_SYSTEM_INCLUDE=`$DIRNAME $GCC_SYSTEM_INCLUDE`
196+
GCC_INCLUDE_DEBUG_MAP_FLAGS="$GCC_INCLUDE_DEBUG_MAP_FLAGS \
197+
-fdebug-prefix-map=${GCC_SYSTEM_INCLUDE}/=/usr/local/gcc_include/"
198+
fi
199+
200+
# Add g++ system include mapping => /usr/local/gxx_include
201+
# Find location of cstddef using build C++ compiler
202+
GXX_SYSTEM_INCLUDE=`$ECHO "#include <cstddef>" | \
203+
$CXX $CXXFLAGS -v -E -x c++ - 2>&1 | \
204+
$GREP cstddef | $TAIL -1 | $TR -s " " | $CUT -d'"' -f2`
205+
if test "x$GXX_SYSTEM_INCLUDE" != "x"; then
206+
GXX_SYSTEM_INCLUDE=`$DIRNAME $GXX_SYSTEM_INCLUDE`
207+
GCC_INCLUDE_DEBUG_MAP_FLAGS="$GCC_INCLUDE_DEBUG_MAP_FLAGS \
208+
-fdebug-prefix-map=${GXX_SYSTEM_INCLUDE}/=/usr/local/gxx_include/"
209+
fi
210+
211+
# Add to debug prefix cflags
212+
DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS $GCC_INCLUDE_DEBUG_MAP_FLAGS"
213+
])
214+
161215
AC_DEFUN([FLAGS_SETUP_WARNINGS],
162216
[
163217
# Set default value.
@@ -425,7 +479,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
425479
[
426480
#### OS DEFINES, these should be independent on toolchain
427481
if test "x$OPENJDK_TARGET_OS" = xlinux; then
428-
CFLAGS_OS_DEF_JVM="-DLINUX"
482+
CFLAGS_OS_DEF_JVM="-DLINUX -D_FILE_OFFSET_BITS=64"
429483
CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
430484
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
431485
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"

make/hotspot/lib/JvmOverrideFiles.gmk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ ifneq ($(FDLIBM_CFLAGS), )
4848
endif
4949

5050
ifeq ($(call isTargetOs, linux), true)
51-
BUILD_LIBJVM_ostream.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64
52-
BUILD_LIBJVM_logFileOutput.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64
53-
5451
BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
5552
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
5653

make/test/BuildMicrobenchmark.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
107107
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
108108
--add-exports java.base/sun.security.util=ALL-UNNAMED \
109109
--enable-preview \
110+
-XDsuppressNotes \
110111
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
111112
JAVA_FLAGS := \
112113
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, 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
@@ -111,10 +111,10 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
111111
// Handle existing monitor.
112112
bind(object_has_monitor);
113113

114-
// The object's monitor m is unlocked iff m->owner == NULL,
114+
// The object's monitor m is unlocked iff m->owner == nullptr,
115115
// otherwise m->owner may contain a thread or a stack address.
116116
//
117-
// Try to CAS m->owner from NULL to current thread.
117+
// Try to CAS m->owner from null to current thread.
118118
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset())-markWord::monitor_value));
119119
cmpxchg(tmp, zr, rthread, Assembler::xword, /*acquire*/ true,
120120
/*release*/ true, /*weak*/ false, tmp3Reg); // Sets flags for result

src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
3-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
5858
0x7ffc, 0x7ffe, 0x7fff
5959
};
6060
static constexpr int num_immediates = sizeof(immediates) / sizeof(immediates[0]);
61-
const int start_index = aslr ? os::random() : 0;
61+
const int start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
6262
constexpr int max_tries = 64;
6363
for (int ntry = 0; result == nullptr && ntry < max_tries; ntry ++) {
6464
// As in os::attempt_reserve_memory_between, we alternate between higher and lower

src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -121,10 +121,10 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg,
121121

122122
// Handle existing monitor.
123123
bind(object_has_monitor);
124-
// The object's monitor m is unlocked iff m->owner == NULL,
124+
// The object's monitor m is unlocked iff m->owner == nullptr,
125125
// otherwise m->owner may contain a thread or a stack address.
126126
//
127-
// Try to CAS m->owner from NULL to current thread.
127+
// Try to CAS m->owner from null to current thread.
128128
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset()) - markWord::monitor_value));
129129
cmpxchg(/*memory address*/tmp, /*expected value*/zr, /*new value*/xthread, Assembler::int64, Assembler::aq,
130130
Assembler::rl, /*result*/flag); // cas succeeds if flag == zr(expected)
@@ -1829,6 +1829,49 @@ void C2_MacroAssembler::float16_to_float(FloatRegister dst, Register src, Regist
18291829
bind(stub->continuation());
18301830
}
18311831

1832+
static void float_to_float16_slow_path(C2_MacroAssembler& masm, C2GeneralStub<Register, FloatRegister, Register>& stub) {
1833+
#define __ masm.
1834+
Register dst = stub.data<0>();
1835+
FloatRegister src = stub.data<1>();
1836+
Register tmp = stub.data<2>();
1837+
__ bind(stub.entry());
1838+
1839+
__ fmv_x_w(dst, src);
1840+
1841+
// preserve the payloads of non-canonical NaNs.
1842+
__ srai(dst, dst, 13);
1843+
// preserve the sign bit.
1844+
__ srai(tmp, dst, 13);
1845+
__ slli(tmp, tmp, 10);
1846+
__ mv(t0, 0x3ff);
1847+
__ orr(tmp, tmp, t0);
1848+
1849+
// get the result by merging sign bit and payloads of preserved non-canonical NaNs.
1850+
__ andr(dst, dst, tmp);
1851+
1852+
__ j(stub.continuation());
1853+
#undef __
1854+
}
1855+
1856+
// j.l.Float.floatToFloat16
1857+
void C2_MacroAssembler::float_to_float16(Register dst, FloatRegister src, FloatRegister ftmp, Register xtmp) {
1858+
auto stub = C2CodeStub::make<Register, FloatRegister, Register>(dst, src, xtmp, 130, float_to_float16_slow_path);
1859+
1860+
// in riscv, NaN needs a special process as fcvt does not work in that case.
1861+
1862+
// check whether it's a NaN.
1863+
// replace fclass with feq as performance optimization.
1864+
feq_s(t0, src, src);
1865+
// jump to stub processing NaN cases.
1866+
beqz(t0, stub->entry());
1867+
1868+
// non-NaN cases, just use built-in instructions.
1869+
fcvt_h_s(ftmp, src);
1870+
fmv_x_h(dst, ftmp);
1871+
1872+
bind(stub->continuation());
1873+
}
1874+
18321875
void C2_MacroAssembler::signum_fp_v(VectorRegister dst, VectorRegister one, BasicType bt, int vlen) {
18331876
vsetvli_helper(bt, vlen);
18341877

src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
void signum_fp(FloatRegister dst, FloatRegister one, bool is_double);
174174

175175
void float16_to_float(FloatRegister dst, Register src, Register tmp);
176+
void float_to_float16(Register dst, FloatRegister src, FloatRegister ftmp, Register xtmp);
176177

177178
void signum_fp_v(VectorRegister dst, VectorRegister one, BasicType bt, int vlen);
178179

0 commit comments

Comments
 (0)