Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into elements-api-note
Browse files Browse the repository at this point in the history
  • Loading branch information
nizarbenalla committed Jan 23, 2025
2 parents 4f8877a + c00557f commit cc7cf7d
Show file tree
Hide file tree
Showing 3,159 changed files with 30,770 additions and 32,835 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 0 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,6 @@ jobs:
bootjdk-platform: linux-x64
runs-on: ubuntu-22.04

test-macos-x64:
name: macos-x64
needs:
- build-macos-x64
uses: ./.github/workflows/test.yml
with:
platform: macos-x64
bootjdk-platform: macos-x64
runs-on: macos-13
xcode-toolset-version: '14.3.1'

test-macos-aarch64:
name: macos-aarch64
needs:
Expand Down
4 changes: 2 additions & 2 deletions bin/idea.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2025, 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 @@ -99,7 +99,7 @@ if [ "$VERBOSE" = "true" ] ; then
echo "idea template dir: $IDEA_TEMPLATE"
fi

cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" $CONF_ARG || exit 1
cd $TOP ; make idea-gen-config IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
cd $SCRIPT_DIR

. $IDEA_OUTPUT/env.cfg
Expand Down
2 changes: 1 addition & 1 deletion doc/hotspot-unit-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h3 id="error-messages">Error messages</h3>
<p>All GoogleTest asserts print compared expressions and their values,
so there is no need to have them in error messages. Asserts print only
compared values, they do not print any of interim variables, e.g.
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8)) || i == 18)</code>
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8))) || i == 18)</code>
prints only one value. If you use some complex predicates, please
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
assertions family, they check that a predicate returns true/success and
Expand Down
2 changes: 1 addition & 1 deletion doc/hotspot-unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Provide informative, but not too verbose error messages.
All GoogleTest asserts print compared expressions and their values, so
there is no need to have them in error messages. Asserts print only
compared values, they do not print any of interim variables, e.g.
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
`ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only
one value. If you use some complex predicates, please consider
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
a predicate returns true/success and print out all parameters values.
Expand Down
11 changes: 9 additions & 2 deletions make/CompileDemos.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -132,12 +132,19 @@ define SetupBuildDemoBody
JARMAIN := $$($1_MAIN_CLASS), \
MANIFEST := $(DEMO_MANIFEST), \
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
))

$1 += $$(BUILD_DEMO_$1)

$$(eval $$(call SetupZipArchive, ZIP_SRC_DEMO_$1, \
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
))

$1 += $$(ZIP_SRC_DEMO_$1)
endif

# Copy files. Sort is needed to remove duplicates.
Expand Down
3 changes: 1 addition & 2 deletions make/Coverage.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2025, 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 @@ -47,7 +47,6 @@ $(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
-t $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)/template.xml \
-rt $(JCOV_HOME)/lib/jcov_network_saver.jar \
-exclude 'java.lang.Object' \
-exclude 'jdk.internal.org.objectweb.**' \
-exclude jdk.test.Main -exclude '**\$Proxy*' \
$(JCOV_FILTERS) \
$(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
Expand Down
10 changes: 9 additions & 1 deletion make/Main.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -356,6 +356,14 @@ $(eval $(call SetupTarget, vscode-project-ccls, \
DEPS := compile-commands, \
))

################################################################################
# IDEA IntelliJ projects

$(eval $(call SetupTarget, idea-gen-config, \
MAKEFILE := ide/idea/jdk/IdeaGenConfig, \
ARGS := IDEA_OUTPUT="$(IDEA_OUTPUT)" MODULES="$(MODULES)", \
))

################################################################################
# Build demos targets

Expand Down
9 changes: 4 additions & 5 deletions make/StaticLibs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ else ifeq ($(call isTargetOs, windows), true)
BROKEN_STATIC_LIBS += splashscreen
# libsspi_bridge has name conflicts with sunmscapi
BROKEN_STATIC_LIBS += sspi_bridge
# These libs define DllMain which conflict with Hotspot
BROKEN_STATIC_LIBS += awt dt_shmem dt_socket
# These libs are dependent on any of the above disabled libs
BROKEN_STATIC_LIBS += fontmanager jawt lcms net nio
# dt_shmem define jdwpTransport_OnLoad which conflict with dt_socket
BROKEN_STATIC_LIBS += dt_shmem
endif

$(foreach module, $(STATIC_LIB_MODULES), \
Expand Down Expand Up @@ -107,7 +105,8 @@ else
endif

$(eval $(call SetupBuildLauncher, java, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
ENABLE_ARG_FILES := true, \
EXPAND_CLASSPATH_WILDCARDS := true, \
EXTRA_RCFLAGS := $(JAVA_RCFLAGS), \
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
OPTIMIZATION := HIGH, \
Expand Down
20 changes: 18 additions & 2 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
# compilation of all source files regardless of the active code page on Windows.
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -MP"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -Zc:wchar_t-"
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -utf-8 -MP"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -utf-8 -Zc:wchar_t-"
fi
# CFLAGS C language level for JDK sources (hotspot only uses C++)
Expand Down Expand Up @@ -830,6 +830,22 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
FLAGS_SETUP_BRANCH_PROTECTION
if test "x$FLAGS_CPU" = xriscv64; then
AC_MSG_CHECKING([if RVV/vector sigcontext supported])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <linux/ptrace.h>],
[
return (int)sizeof(struct __riscv_v_ext_state);
])],
[
AC_MSG_RESULT([yes])
],
[
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -DNO_RVV_SIGCONTEXT"
AC_MSG_RESULT([no])
]
)
fi
# EXPORT to API
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
Expand Down
4 changes: 2 additions & 2 deletions make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$2LDFLAGS_STATIC_JDK="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY \
$OS_LDFLAGS ${$2EXTRA_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$2LDFLAGS_STATIC_JDK="$BASIC_LDFLAGS $OS_LDFLAGS ${$2EXTRA_LDFLAGS} \
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$2JVM_LDFLAGS="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY $OS_LDFLAGS $OS_LDFLAGS_JVM_ONLY \
$DEBUGLEVEL_LDFLAGS $DEBUGLEVEL_LDFLAGS_JVM_ONLY \
Expand Down
3 changes: 2 additions & 1 deletion make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -446,6 +446,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
fi
if test "x$TOOLCHAIN_TYPE" = "xclang"; then
ASAN_CFLAGS="$ASAN_CFLAGS -fsanitize-address-use-after-return=never"
ASAN_LDFLAGS="$ASAN_LDFLAGS -shared-libasan"
fi
elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
# -Oy- is equivalent to -fno-omit-frame-pointer in GCC/Clang.
Expand Down
5 changes: 4 additions & 1 deletion make/autoconf/lib-hsdis.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2021, 2025, 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 @@ -40,6 +40,9 @@ AC_DEFUN([LIB_SETUP_HSDIS_CAPSTONE],
HSDIS_CFLAGS="-I${CAPSTONE}/include/capstone"
if test "x$OPENJDK_TARGET_OS" != xwindows; then
HSDIS_LDFLAGS="-L${CAPSTONE}/lib"
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" ; then
HSDIS_LDFLAGS="-L${CAPSTONE}/lib64 $HSDIS_LDFLAGS"
fi
HSDIS_LIBS="-lcapstone"
else
HSDIS_LDFLAGS="-nodefaultlib:libcmt.lib"
Expand Down
20 changes: 2 additions & 18 deletions make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -32,10 +32,8 @@ endif

include MakeIO.gmk

# Java compilation needs SetupJarArchive and/or SetupZipArchive, if we're
# generating a jar file or a source zip.
# Java compilation needs SetupJarArchive if we're generating a jar file
include JarArchive.gmk
include ZipArchive.gmk

###
### Definitions for common release targets
Expand Down Expand Up @@ -156,7 +154,6 @@ endef
# COPY_FILES myapp/foo/setting.txt means copy this file over to the package myapp/foo
# CLEAN .properties means copy and clean all properties file to the corresponding package in BIN.
# CLEAN_FILES myapp/foo/setting.txt means clean this file over to the package myapp/foo
# SRCZIP Create a src.zip based on the found sources and copied files.
# INCLUDE_FILES "com/sun/SolarisFoobar.java" means only compile this file!
# EXCLUDE_FILES "com/sun/SolarisFoobar.java" means do not compile this particular file!
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
Expand Down Expand Up @@ -529,19 +526,6 @@ define SetupJavaCompilationBody
# Add jar to target list
$1 += $$($1_JAR)
endif

# Check if a srczip was specified, then setup the rules for the srczip.
ifneq ($$($1_SRCZIP), )
$$(eval $$(call SetupZipArchive, ZIP_ARCHIVE_$1, \
SRC := $$($1_SRC), \
ZIP := $$($1_SRCZIP), \
INCLUDES := $$($1_INCLUDES), \
EXCLUDES := $$($1_EXCLUDES), \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES)))

# Add zip to target list
$1 += $$($1_SRCZIP)
endif
endif # Source files found
endef

Expand Down
9 changes: 7 additions & 2 deletions make/common/JdkNativeCompilation.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2025, 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 @@ -266,6 +266,9 @@ JDK_RCFLAGS=$(RCFLAGS) \
# will be replaced with proper values for hotspot.
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
# header include dirs. (Defaults to true.)
# JAVA_HEADERS -- if false, does not add the directory with the generated
# headers from the Java compilation of the current module to the search
# path for include files. (Defaults to true.)
# JDK_LIBS -- libraries generated by the JDK build system to link against.
# These take the form <module>:<basename>. For the current module, the
# module name and colon can be omitted. The basename should be specified
Expand Down Expand Up @@ -385,7 +388,9 @@ define SetupJdkNativeCompilationBody

# Add the module specific java header dir
ifneq ($$(MODULE), )
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
ifneq ($$($1_JAVA_HEADERS), false)
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE)))
endif
endif

$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
Expand Down
43 changes: 20 additions & 23 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2025, 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 @@ -48,41 +48,44 @@ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
# used as the name of the executable.
#
# Remaining parameters are named arguments. These include:
# MAIN_MODULE The module of the main class to launch if different from the
# current module
# MAIN_CLASS The Java main class to launch
# JAVA_ARGS Processed into a -DJAVA_ARGS and added to CFLAGS
# EXTRA_JAVA_ARGS Processed into a -DEXTRA_JAVA_ARGS and is prepended
# before JAVA_ARGS to CFLAGS, primarily to allow long string literal
# compile time defines exceeding Visual Studio 2013 limitations.
# CFLAGS Additional CFLAGS
# CFLAGS_windows Additional CFLAGS_windows
# JAVA_ARGS Additional arguments to pass to Java when launching the main class
# EXPAND_CLASSPATH_WILDCARDS Set to true to pass EXPAND_CLASSPATH_WILDCARDS
# ENABLE_ARG_FILES Set to true to pass ENABLE_ARG_FILES
# WINDOWS_JAVAW Set to true to pass JAVAW on Windows
# EXTRA_RCFLAGS Additional EXTRA_RCFLAGS
# MACOSX_PRIVILEGED On macosx, allow to access other processes
# OPTIMIZATION Override default optimization level (LOW)
# OUTPUT_DIR Override default output directory
# VERSION_INFO_RESOURCE Override default Windows resource file
# STATIC_LAUNCHER If true, will use settings for building a static launcher
# LIBS Additional libraries to pass as LIBS argument to SetupJdkExecutable
SetupBuildLauncher = $(NamedParamsMacroTemplate)
define SetupBuildLauncherBody
# Setup default values (unless overridden)
ifeq ($$($1_OPTIMIZATION), )
$1_OPTIMIZATION := LOW
endif

ifeq ($$($1_MAIN_MODULE), )
$1_MAIN_MODULE := $(MODULE)
endif
$1_MAIN_MODULE := $(MODULE)

ifneq ($$($1_MAIN_CLASS), )
$1_JAVA_ARGS += -Xms8m
$1_LAUNCHER_CLASS := -m $$($1_MAIN_MODULE)/$$($1_MAIN_CLASS)
endif

ifneq ($$($1_EXTRA_JAVA_ARGS), )
$1_EXTRA_JAVA_ARGS_STR := '{ $$(strip $$(foreach a, \
$$(addprefix -J, $$($1_EXTRA_JAVA_ARGS)), "$$a"$(COMMA) )) }'
$1_CFLAGS += -DEXTRA_JAVA_ARGS=$$($1_EXTRA_JAVA_ARGS_STR)
ifeq ($$($1_EXPAND_CLASSPATH_WILDCARDS), true)
$1_CFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
endif

ifeq ($$($1_ENABLE_ARG_FILES), true)
$1_CFLAGS += -DENABLE_ARG_FILES
endif

ifeq ($(call isTargetOs, windows), true)
ifeq ($$($1_WINDOWS_JAVAW), true)
$1_CFLAGS += -DJAVAW
endif
endif

ifneq ($$($1_JAVA_ARGS), )
Expand Down Expand Up @@ -143,8 +146,8 @@ define SetupBuildLauncherBody
-DLAUNCHER_NAME='"$$(LAUNCHER_NAME)"' \
-DPROGNAME='"$1"' \
$$($1_CFLAGS), \
CFLAGS_windows := $$($1_CFLAGS_windows), \
EXTRA_HEADER_DIRS := java.base:libjvm, \
JAVA_HEADERS := false, \
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
DISABLED_WARNINGS_clang := unused-function, \
LDFLAGS := $$($1_LDFLAGS), \
Expand All @@ -154,12 +157,6 @@ define SetupBuildLauncherBody
JDK_LIBS := $$($1_JDK_LIBS), \
JDK_LIBS_windows := $$($1_JDK_LIBS_windows), \
LIBS := $$($1_LIBS), \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \
LIBS_macosx := \
-framework ApplicationServices \
-framework Cocoa \
-framework Security, \
LINK_TYPE := $$($1_LINK_TYPE), \
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
OBJECT_DIR := $$($1_OBJECT_DIR), \
Expand Down
Loading

0 comments on commit cc7cf7d

Please sign in to comment.