Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Dec 6, 2024
2 parents 0837b95 + 4966419 commit a6da529
Show file tree
Hide file tree
Showing 550 changed files with 7,287 additions and 1,397 deletions.
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk
jbs=JDK
version=24
version=25

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
10 changes: 5 additions & 5 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -863,12 +863,12 @@ <h3 id="gnu-bash">GNU Bash</h3>
are supported.</p>
<p>At least version 3.2 of GNU Bash must be used.</p>
<h3 id="graphviz-and-pandoc">Graphviz and Pandoc</h3>
<p>In order to build the full docs (see the
<p>In order to build man pages and the full docs (see the
<code>--enable-full-docs</code> configure option) <a
href="https://www.graphviz.org">Graphviz</a> and <a
href="https://pandoc.org">Pandoc</a> are required. Any recent versions
should work. For reference, and subject to change, Oracle builds use
Graphviz 9.0.0 and Pandoc 2.19.2.</p>
href="https://pandoc.org">Pandoc</a> is required. For full docs also <a
href="https://www.graphviz.org">Graphviz</a> is required. Any recent
versions should work. For reference, and subject to change, Oracle
builds use Graphviz 9.0.0 and Pandoc 2.19.2.</p>
<h2 id="running-configure">Running Configure</h2>
<p>To build the JDK, you need a "configuration", which consists of a
directory where to store the build output, coupled with information
Expand Down
6 changes: 3 additions & 3 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,9 @@ At least version 3.2 of GNU Bash must be used.

### Graphviz and Pandoc

In order to build the full docs (see the `--enable-full-docs`
configure option) [Graphviz](https://www.graphviz.org) and
[Pandoc](https://pandoc.org) are required. Any recent versions should
In order to build man pages and the full docs (see the `--enable-full-docs`
configure option) [Pandoc](https://pandoc.org) is required. For full docs also
[Graphviz](https://www.graphviz.org) is required. Any recent versions should
work. For reference, and subject to change, Oracle builds use Graphviz
9.0.0 and Pandoc 2.19.2.

Expand Down
1 change: 1 addition & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include DebugInfoUtils.gmk
include Execute.gmk
include Modules.gmk
include Utils.gmk
Expand Down
1 change: 1 addition & 0 deletions make/StaticLibs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include $(SPEC)
include MakeBase.gmk

include CopyFiles.gmk
include DebugInfoUtils.gmk
include Modules.gmk
include modules/LauncherCommon.gmk

Expand Down
4 changes: 2 additions & 2 deletions make/autoconf/boot-jdk.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2024, 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 @@ -470,7 +470,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
# Maximum amount of heap memory.
JVM_HEAP_LIMIT_32="768"
# Running a 64 bit JVM allows for and requires a bigger heap
JVM_HEAP_LIMIT_64="1600"
JVM_HEAP_LIMIT_64="2048"
JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2`
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then
JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL
Expand Down
24 changes: 8 additions & 16 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],

AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
[
if test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
C_O_FLAG_HIGHEST_JVM="-O3"
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
Expand All @@ -311,6 +311,13 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
C_O_FLAG_DEBUG="-O0"
C_O_FLAG_DEBUG_JVM="-O0"
C_O_FLAG_NONE="-O0"
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
C_O_FLAG_HIGHEST_JVM="${C_O_FLAG_HIGHEST_JVM} -finline-functions"
C_O_FLAG_HIGHEST="${C_O_FLAG_HIGHEST} -finline-functions"
C_O_FLAG_HI="${C_O_FLAG_HI} -finline-functions"
fi
# -D_FORTIFY_SOURCE=2 hardening option needs optimization (at least -O1) enabled
# set for lower O-levels -U_FORTIFY_SOURCE to overwrite previous settings
if test "x$OPENJDK_TARGET_OS" = xlinux -a "x$DEBUG_LEVEL" = "xfastdebug"; then
Expand All @@ -331,21 +338,6 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
C_O_FLAG_DEBUG_JVM="${C_O_FLAG_DEBUG_JVM} ${DISABLE_FORTIFY_CFLAGS}"
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
fi
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xaix; then
C_O_FLAG_HIGHEST_JVM="-O3 -finline-functions"
C_O_FLAG_HIGHEST="-O3 -finline-functions"
C_O_FLAG_HI="-O3 -finline-functions"
else
C_O_FLAG_HIGHEST_JVM="-O3"
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
fi
C_O_FLAG_NORM="-O2"
C_O_FLAG_DEBUG_JVM="-O0"
C_O_FLAG_SIZE="-Os"
C_O_FLAG_DEBUG="-O0"
C_O_FLAG_NONE="-O0"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-"
C_O_FLAG_HIGHEST="-O2"
Expand Down
4 changes: 2 additions & 2 deletions make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
if test "x$DOT" != "x"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, cannot generate full docs])
AC_MSG_RESULT([no, cannot generate full docs or man pages])
FULL_DOCS_AVAILABLE=false
fi
AC_MSG_CHECKING([for pandoc])
if test "x$ENABLE_PANDOC" = "xtrue"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, cannot generate full docs])
AC_MSG_RESULT([no, cannot generate full docs or man pages])
FULL_DOCS_AVAILABLE=false
fi
Expand Down
58 changes: 58 additions & 0 deletions make/common/DebugInfoUtils.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# Copyright (c) 2024, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#

ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including DebugInfoUtils.gmk)
endif

################################################################################
#
# Common debuginfo utility functions
#
################################################################################

################################################################################
# Find native debuginfo files in a directory
#
# Param 1 - dir to find debuginfo files in
FindDebuginfoFiles = \
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))

# Pick the correct debug info files to copy, either zipped or not.
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
DEBUGINFO_SUFFIXES += .diz
else
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
# dirs.
ifeq ($(call isTargetOs, macosx), true)
$(call FillFindCache, \
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
FindDebuginfoFiles = \
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
endif
endif
23 changes: 0 additions & 23 deletions make/common/FileUtils.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -307,26 +307,3 @@ ifeq ($(DISABLE_CACHE_FIND), true)
else
FindFiles = $(CacheFindFiles)
endif

# Find native debuginfo files in a directory
#
# Param 1 - dir to find debuginfo files in
FindDebuginfoFiles = \
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))

# Pick the correct debug info files to copy, either zipped or not.
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
DEBUGINFO_SUFFIXES += .diz
else
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
# dirs.
ifeq ($(call isTargetOs, macosx), true)
$(call FillFindCache, \
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
FindDebuginfoFiles = \
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
endif
endif
4 changes: 1 addition & 3 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
MAN_FILES_MD := $(wildcard $(addsuffix /*.md, $(call FindModuleManDirs, $(MODULE))))

ifneq ($(MAN_FILES_MD), )
ifeq ($(ENABLE_PANDOC), false)
$(info Warning: pandoc not found. Not generating man pages)
else
ifeq ($(ENABLE_PANDOC), true)
# Create dynamic man pages from markdown using pandoc. We need
# PANDOC_TROFF_MANPAGE_FILTER, a wrapper around
# PANDOC_TROFF_MANPAGE_FILTER_JAVASCRIPT. This is created by buildtools-jdk.
Expand Down
10 changes: 5 additions & 5 deletions make/conf/version-numbers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
# Default version, product, and vendor information to use,
# unless overridden by configure

DEFAULT_VERSION_FEATURE=24
DEFAULT_VERSION_FEATURE=25
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=0
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2025-03-18
DEFAULT_VERSION_CLASSFILE_MAJOR=68 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_DATE=2025-09-16
DEFAULT_VERSION_CLASSFILE_MAJOR=69 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="23 24"
DEFAULT_JDK_SOURCE_TARGET_VERSION=24
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="23 24 25"
DEFAULT_JDK_SOURCE_TARGET_VERSION=25
DEFAULT_PROMOTED_VERSION_PRE=ea
6 changes: 6 additions & 0 deletions make/hotspot/lib/JvmFeatures.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ ifeq ($(call check-jvm-feature, link-time-opt), true)
-fno-fat-lto-objects
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto \
-fuse-linker-plugin -fno-strict-aliasing
else ifeq ($(call isCompiler, clang), true)
JVM_CFLAGS_FEATURES += -flto -fno-strict-aliasing
ifeq ($(call isBuildOs, aix), true)
JVM_CFLAGS_FEATURES += -ffat-lto-objects
endif
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto -fno-strict-aliasing
else ifeq ($(call isCompiler, microsoft), true)
JVM_CFLAGS_FEATURES += -GL
JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL
Expand Down
6 changes: 3 additions & 3 deletions make/ide/xcode/hotspot/CreateXcodeProject.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifeq ($(call isTargetOs, macosx), true)
PROJECT_FILE_NAME := hotspot.xcodeproj

COMPILE_COMMAND_FILE := $(OUTPUTDIR)/compile_commands.json
LINKER_FLAGS_FILE := $(MAKESUPPORT_OUTPUTDIR)/compile-commands/jvm-ldflags.txt
LINKER_FLAGS_FILE := $(MAKESUPPORT_OUTPUTDIR)/compile-commands/LIBRARY_hotspot_variant-server_libjvm_libjvm-ldflags.txt

$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
Expand All @@ -60,7 +60,7 @@ ifeq ($(call isTargetOs, macosx), true)
XCODE_PROJ_DEBUG_OPTION := -d
endif

XCODE_PROJ_VARDEPS := $(WORKSPACE_ROOT) $(IDE_OUTPUTDIR) \
XCODE_PROJ_VARDEPS := $(TOPDIR) $(IDE_OUTPUTDIR) \
$(PROJECT_MAKER_DIR)/data $(COMPILE_COMMAND_FILE) $(LINKER_FLAGS_FILE)
XCODE_PROJ_VARDEPS_FILE := $(call DependOnVariable, XCODE_PROJ_VARDEPS, \
$(TOOLS_OUTPUTDIR)/xcodeproj.vardeps)
Expand All @@ -70,7 +70,7 @@ ifeq ($(call isTargetOs, macosx), true)
DEPS := $(BUILD_PROJECT_CREATOR) $(COMPILE_COMMAND_FILE) \
$(LINKER_FLAGS_FILE) $(XCODE_PROJ_VARDEPS_FILE), \
OUTPUT_DIR := $(TOOLS_OUTPUTDIR), \
COMMAND := $(PROJECT_CREATOR_TOOL) $(WORKSPACE_ROOT) $(IDE_OUTPUTDIR) \
COMMAND := $(PROJECT_CREATOR_TOOL) $(TOPDIR) $(IDE_OUTPUTDIR) \
$(PROJECT_MAKER_DIR)/data $(COMPILE_COMMAND_FILE) \
$(LINKER_FLAGS_FILE) $(XCODE_PROJ_DEBUG_OPTION), \
))
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5305,7 +5305,7 @@ MacroAssembler::KlassDecodeMode MacroAssembler::klass_decode_mode() {
if (operand_valid_for_logical_immediate(
/*is32*/false, (uint64_t)CompressedKlassPointers::base())) {
const size_t range = CompressedKlassPointers::klass_range_end() - CompressedKlassPointers::base();
const uint64_t range_mask = right_n_bits(ceil_log2(range));
const uint64_t range_mask = right_n_bits(log2i_ceil(range));
if (((uint64_t)CompressedKlassPointers::base() & range_mask) == 0) {
return (_klass_decode_mode = KlassDecodeXor);
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ void MacroAssembler::emit_static_call_stub() {

// Jump to the entry point of the c2i stub.
int32_t offset = 0;
movptr(t1, 0, offset, t0); // lui + lui + slli + add
movptr2(t1, 0, offset, t0); // lui + lui + slli + add
jr(t1, offset);
}

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2024, 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 @@ -79,7 +79,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity)
_initialized(false) {

// Reserve address space for backing memory
_base = (uintptr_t)os::reserve_memory(max_capacity);
_base = (uintptr_t)os::reserve_memory(max_capacity, false, mtJavaHeap);
if (_base == 0) {
// Failed
ZInitialize::error("Failed to reserve address space for backing memory");
Expand Down
6 changes: 2 additions & 4 deletions src/hotspot/os/linux/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4582,23 +4582,21 @@ static void workaround_expand_exec_shield_cs_limit() {
*/
char* hint = (char*)(os::Linux::initial_thread_stack_bottom() -
(StackOverflow::stack_guard_zone_size() + page_size));
char* codebuf = os::attempt_reserve_memory_at(hint, page_size);
char* codebuf = os::attempt_reserve_memory_at(hint, page_size, false, mtThread);

if (codebuf == nullptr) {
// JDK-8197429: There may be a stack gap of one megabyte between
// the limit of the stack and the nearest memory region: this is a
// Linux kernel workaround for CVE-2017-1000364. If we failed to
// map our codebuf, try again at an address one megabyte lower.
hint -= 1 * M;
codebuf = os::attempt_reserve_memory_at(hint, page_size);
codebuf = os::attempt_reserve_memory_at(hint, page_size, false, mtThread);
}

if ((codebuf == nullptr) || (!os::commit_memory(codebuf, page_size, true))) {
return; // No matter, we tried, best effort.
}

MemTracker::record_virtual_memory_tag((address)codebuf, mtInternal);

log_info(os)("[CS limit NX emulation work-around, exec code at: %p]", codebuf);

// Some code to exec: the 'ret' instruction
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static inline void atomic_copy64(const volatile void *src, volatile void *dst) {
}

extern "C" {
// needs local assembler label '1:' to avoid trouble when using linktime optimization
int SpinPause() {
// We don't use StubRoutines::aarch64::spin_wait stub in order to
// avoid a costly call to os::current_thread_enable_wx() on MacOS.
Expand All @@ -523,14 +524,14 @@ extern "C" {
// to entry for case SpinWait::NOP
" add %[d], %[d], %[o] \n"
" br %[d] \n"
" b SpinPause_return \n" // case SpinWait::NONE (-1)
" b 1f \n" // case SpinWait::NONE (-1)
" nop \n" // padding
" nop \n" // case SpinWait::NOP ( 0)
" b SpinPause_return \n"
" b 1f \n"
" isb \n" // case SpinWait::ISB ( 1)
" b SpinPause_return \n"
" b 1f \n"
" yield \n" // case SpinWait::YIELD ( 2)
"SpinPause_return: \n"
"1: \n"
: [d]"=&r"(br_dst)
: [o]"r"(off)
: "memory");
Expand Down
Loading

0 comments on commit a6da529

Please sign in to comment.