diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 210d53be65819..3ea07501477f8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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:
diff --git a/bin/idea.sh b/bin/idea.sh
index c85ae294454e5..1ebe9d96c7fa1 100644
--- a/bin/idea.sh
+++ b/bin/idea.sh
@@ -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
@@ -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
diff --git a/doc/hotspot-unit-tests.html b/doc/hotspot-unit-tests.html
index 556cfecc42d7f..fcd4a93f8e485 100644
--- a/doc/hotspot-unit-tests.html
+++ b/doc/hotspot-unit-tests.html
@@ -245,7 +245,7 @@
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)
+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
diff --git a/doc/hotspot-unit-tests.md b/doc/hotspot-unit-tests.md
index 62ace4ef6ee8b..e1222baa2e3a4 100644
--- a/doc/hotspot-unit-tests.md
+++ b/doc/hotspot-unit-tests.md
@@ -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.
diff --git a/make/CompileDemos.gmk b/make/CompileDemos.gmk
index 6c751552e5042..6c95aa08c2b00 100644
--- a/make/CompileDemos.gmk
+++ b/make/CompileDemos.gmk
@@ -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
@@ -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.
diff --git a/make/Coverage.gmk b/make/Coverage.gmk
index 503acbe03ab18..c6c82af240119 100644
--- a/make/Coverage.gmk
+++ b/make/Coverage.gmk
@@ -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
@@ -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)
diff --git a/make/Main.gmk b/make/Main.gmk
index 7675fe6fcf718..79b2932439cba 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -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
@@ -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
diff --git a/make/StaticLibs.gmk b/make/StaticLibs.gmk
index d54c67b50b3ea..e4b8e422caf21 100644
--- a/make/StaticLibs.gmk
+++ b/make/StaticLibs.gmk
@@ -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), \
@@ -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, \
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
index d33f1885922d5..729e508cc2624 100644
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -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++)
@@ -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 ],
+ [
+ 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} \
diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4
index ffb1f0d6e1979..2e060a71d4d05 100644
--- a/make/autoconf/flags-ldflags.m4
+++ b/make/autoconf/flags-ldflags.m4
@@ -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 \
diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4
index c09f581688ca0..b90f04a89e255 100644
--- a/make/autoconf/jdk-options.m4
+++ b/make/autoconf/jdk-options.m4
@@ -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
@@ -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.
diff --git a/make/autoconf/lib-hsdis.m4 b/make/autoconf/lib-hsdis.m4
index a4d2c5f81f3f3..784c76424cf0d 100644
--- a/make/autoconf/lib-hsdis.m4
+++ b/make/autoconf/lib-hsdis.m4
@@ -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
@@ -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"
diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk
index 59ea23d359b6a..c56217b9f33c2 100644
--- a/make/common/JavaCompilation.gmk
+++ b/make/common/JavaCompilation.gmk
@@ -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
@@ -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
@@ -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.
@@ -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
diff --git a/make/common/JdkNativeCompilation.gmk b/make/common/JdkNativeCompilation.gmk
index ca0f1429c6165..a4f48385f4189 100644
--- a/make/common/JdkNativeCompilation.gmk
+++ b/make/common/JdkNativeCompilation.gmk
@@ -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
@@ -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 :. For the current module, the
# module name and colon can be omitted. The basename should be specified
@@ -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))
diff --git a/make/common/modules/LauncherCommon.gmk b/make/common/modules/LauncherCommon.gmk
index 38485283dcb98..32b14353b5274 100644
--- a/make/common/modules/LauncherCommon.gmk
+++ b/make/common/modules/LauncherCommon.gmk
@@ -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
@@ -48,21 +48,18 @@ 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)
@@ -70,19 +67,25 @@ define SetupBuildLauncherBody
$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), )
@@ -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), \
@@ -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), \
diff --git a/make/common/native/CompileFile.gmk b/make/common/native/CompileFile.gmk
index 0c67a337acf82..498a04a0fdaf0 100644
--- a/make/common/native/CompileFile.gmk
+++ b/make/common/native/CompileFile.gmk
@@ -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
@@ -253,11 +253,13 @@ define CreatePrecompiledHeader
$$(eval $$(call CreateCompiledNativeFile, $1_$$(notdir $$($1_GENERATED_PCH_SRC)), \
FILE := $$($1_GENERATED_PCH_SRC), \
BASE := $1, \
- EXTRA_CXXFLAGS := -Fp$$($1_PCH_FILE) -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
+ EXTRA_CXXFLAGS := -I$$(dir $$($1_PRECOMPILED_HEADER)) -Fp$$($1_PCH_FILE) \
+ -Yc$$(notdir $$($1_PRECOMPILED_HEADER)), \
))
$1_USE_PCH_FLAGS := \
- -Fp$$($1_PCH_FILE) -Yu$$(notdir $$($1_PRECOMPILED_HEADER))
+ -FI$$(notdir $$($1_PRECOMPILED_HEADER)) -Fp$$($1_PCH_FILE) \
+ -Yu$$(notdir $$($1_PRECOMPILED_HEADER))
$$($1_ALL_OBJS): $$($1_GENERATED_PCH_OBJ)
@@ -271,7 +273,8 @@ define CreatePrecompiledHeader
else ifneq ($(findstring $(TOOLCHAIN_TYPE), gcc clang), )
ifeq ($(TOOLCHAIN_TYPE), gcc)
$1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).gch
- $1_USE_PCH_FLAGS := -I$$($1_OBJECT_DIR)/precompiled
+ $1_USE_PCH_FLAGS := -I$$($1_OBJECT_DIR)/precompiled \
+ -include $$(notdir $$($1_PRECOMPILED_HEADER))
else ifeq ($(TOOLCHAIN_TYPE), clang)
$1_PCH_FILE := $$($1_OBJECT_DIR)/precompiled/$$(notdir $$($1_PRECOMPILED_HEADER)).pch
$1_USE_PCH_FLAGS := -include-pch $$($1_PCH_FILE)
diff --git a/make/conf/module-loader-map.conf b/make/conf/module-loader-map.conf
index b628bfbf2da30..92bffc0e9bcdf 100644
--- a/make/conf/module-loader-map.conf
+++ b/make/conf/module-loader-map.conf
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
@@ -103,6 +103,7 @@ NATIVE_ACCESS_MODULES= \
java.smartcardio \
jdk.accessibility \
jdk.attach \
+ jdk.compiler \
jdk.crypto.cryptoki \
jdk.crypto.mscapi \
jdk.hotspot.agent \
diff --git a/make/hotspot/gensrc/GensrcAdlc.gmk b/make/hotspot/gensrc/GensrcAdlc.gmk
index d43a8b8d3aba5..2be368e2694ab 100644
--- a/make/hotspot/gensrc/GensrcAdlc.gmk
+++ b/make/hotspot/gensrc/GensrcAdlc.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 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
@@ -37,13 +37,8 @@ ifeq ($(call check-jvm-feature, compiler2), true)
ifeq ($(call isBuildOs, linux), true)
ADLC_CFLAGS := -fno-exceptions -DLINUX
else ifeq ($(call isBuildOs, aix), true)
- ifeq ($(TOOLCHAIN_TYPE), clang)
- ADLC_LDFLAGS += -m64
- ADLC_CFLAGS := -fno-rtti -fexceptions -ffunction-sections -m64 -DAIX -mcpu=pwr8
- else
- ADLC_LDFLAGS += -q64
- ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
- endif
+ ADLC_LDFLAGS += -m64
+ ADLC_CFLAGS := -fno-rtti -fexceptions -ffunction-sections -m64 -DAIX -mcpu=pwr8
else ifeq ($(call isBuildOs, windows), true)
ADLC_CFLAGS := -nologo -EHsc
ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
diff --git a/make/hotspot/lib/JvmFlags.gmk b/make/hotspot/lib/JvmFlags.gmk
index e5929ab994ba0..5544f391d4ad3 100644
--- a/make/hotspot/lib/JvmFlags.gmk
+++ b/make/hotspot/lib/JvmFlags.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 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
@@ -43,7 +43,6 @@ JVM_SRC_DIRS += $(call uniq, $(wildcard $(foreach d, $(JVM_SRC_ROOTS), \
JVM_CFLAGS_INCLUDES += \
$(patsubst %,-I%,$(JVM_SRC_DIRS)) \
- -I$(TOPDIR)/src/hotspot/share/precompiled \
-I$(TOPDIR)/src/hotspot/share/include \
-I$(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include \
-I$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
@@ -93,11 +92,6 @@ JVM_CFLAGS += \
$(EXTRA_CFLAGS) \
#
-# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
-ifeq ($(USE_PRECOMPILED_HEADER), false)
- JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
-endif
-
ifneq ($(HOTSPOT_OVERRIDE_LIBPATH), )
JVM_CFLAGS += -DOVERRIDE_LIBPATH='"$(HOTSPOT_OVERRIDE_LIBPATH)"'
endif
diff --git a/make/ide/idea/jdk/idea.gmk b/make/ide/idea/jdk/IdeaGenConfig.gmk
similarity index 60%
rename from make/ide/idea/jdk/idea.gmk
rename to make/ide/idea/jdk/IdeaGenConfig.gmk
index b27de609c49be..8318463776f94 100644
--- a/make/ide/idea/jdk/idea.gmk
+++ b/make/ide/idea/jdk/IdeaGenConfig.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 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
@@ -23,36 +23,35 @@
# questions.
#
-include Makefile
-include make/MainSupport.gmk
-
-.PHONY: idea
-
-ifeq ($(SPEC), )
- ifneq ($(words $(SPECS)), 1)
- @echo "Error: Multiple build specification files found. Please select one explicitly."
- @exit 2
- endif
- idea:
- @cd $(topdir)
- @$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/ide/idea/jdk/idea.gmk SPEC=$(SPECS) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) MODULES="$(MODULES)" idea
-else #with SPEC
- include make/common/Modules.gmk
-
- ifeq ($(MODULES), )
- SEL_MODULES := $(call FindAllModules)
- else
- SEL_MODULES := $(MODULES)
- endif
-
- idea:
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+include Modules.gmk
+
+# MODULES and IDEA_OUTPUT is passed on the command line
+ifeq ($(MODULES), )
+ override MODULES := $(call FindAllModules)
+endif
+
+ifeq ($(IDEA_OUTPUT), )
+ override IDEA_OUTPUT := $(WORKSPACE_ROOT)/.idea
+endif
+
+OUT := $(IDEA_OUTPUT)/env.cfg
+
+idea:
+ $(RM) $(OUT)
$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
- $(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
- $(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
- $(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
+ $(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
+ $(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(MODULES), $(mod)))\"" >> $(OUT)
+ $(ECHO) "SEL_MODULES=\"$(MODULES)\"" >> $(OUT)
$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
$(ECHO) "CYGPATH=\"$(PATHTOOL)\"" >> $(OUT)
$(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
-endif
+all: idea
+
+.PHONY: default all idea
diff --git a/make/modules/java.base/Launcher.gmk b/make/modules/java.base/Launcher.gmk
index 024c1c4731b0c..246767f393718 100644
--- a/make/modules/java.base/Launcher.gmk
+++ b/make/modules/java.base/Launcher.gmk
@@ -38,7 +38,8 @@ JAVA_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
################################################################################
$(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, \
@@ -50,7 +51,9 @@ $(eval $(call SetupBuildLauncher, java, \
ifeq ($(call isTargetOs, windows), true)
$(eval $(call SetupBuildLauncher, javaw, \
- CFLAGS := -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
+ ENABLE_ARG_FILES := true, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
+ WINDOWS_JAVAW := true, \
EXTRA_RCFLAGS := $(JAVA_RCFLAGS), \
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
))
diff --git a/make/modules/jdk.compiler/Launcher.gmk b/make/modules/jdk.compiler/Launcher.gmk
index e80c31bcb18f3..e5c4bbe4b8cdb 100644
--- a/make/modules/jdk.compiler/Launcher.gmk
+++ b/make/modules/jdk.compiler/Launcher.gmk
@@ -32,7 +32,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, javac, \
MAIN_CLASS := com.sun.tools.javac.Main, \
JAVA_ARGS := --add-modules ALL-DEFAULT, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
################################################################################
@@ -41,5 +41,5 @@ $(eval $(call SetupBuildLauncher, javac, \
$(eval $(call SetupBuildLauncher, serialver, \
MAIN_CLASS := sun.tools.serialver.SerialVer, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
diff --git a/make/modules/jdk.javadoc/Launcher.gmk b/make/modules/jdk.javadoc/Launcher.gmk
index 30d714be30d6a..608468962f382 100644
--- a/make/modules/jdk.javadoc/Launcher.gmk
+++ b/make/modules/jdk.javadoc/Launcher.gmk
@@ -32,5 +32,5 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, javadoc, \
MAIN_CLASS := jdk.javadoc.internal.tool.Main, \
JAVA_ARGS := --add-modules ALL-DEFAULT, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
diff --git a/make/modules/jdk.jconsole/Launcher.gmk b/make/modules/jdk.jconsole/Launcher.gmk
index 3e65c3cccc37a..35d93d6feb917 100644
--- a/make/modules/jdk.jconsole/Launcher.gmk
+++ b/make/modules/jdk.jconsole/Launcher.gmk
@@ -36,5 +36,5 @@ $(eval $(call SetupBuildLauncher, jconsole, \
--add-modules ALL-DEFAULT \
-Djconsole.showOutputViewer \
-Djdk.attach.allowAttachSelf=true, \
- CFLAGS_windows := -DJAVAW, \
+ WINDOWS_JAVAW := true, \
))
diff --git a/make/modules/jdk.jdeps/Launcher.gmk b/make/modules/jdk.jdeps/Launcher.gmk
index 1aa54e16f4564..812d690a91d34 100644
--- a/make/modules/jdk.jdeps/Launcher.gmk
+++ b/make/modules/jdk.jdeps/Launcher.gmk
@@ -31,7 +31,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, javap, \
MAIN_CLASS := com.sun.tools.javap.Main, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
################################################################################
@@ -40,7 +40,7 @@ $(eval $(call SetupBuildLauncher, javap, \
$(eval $(call SetupBuildLauncher, jdeps, \
MAIN_CLASS := com.sun.tools.jdeps.Main, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
################################################################################
@@ -49,7 +49,7 @@ $(eval $(call SetupBuildLauncher, jdeps, \
$(eval $(call SetupBuildLauncher, jdeprscan, \
MAIN_CLASS := com.sun.tools.jdeprscan.Main, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
################################################################################
@@ -58,5 +58,5 @@ $(eval $(call SetupBuildLauncher, jdeprscan, \
$(eval $(call SetupBuildLauncher, jnativescan, \
MAIN_CLASS := com.sun.tools.jnativescan.Main, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
diff --git a/make/modules/jdk.jfr/Launcher.gmk b/make/modules/jdk.jfr/Launcher.gmk
index 2dd3586a92072..ad07c839f9073 100644
--- a/make/modules/jdk.jfr/Launcher.gmk
+++ b/make/modules/jdk.jfr/Launcher.gmk
@@ -31,5 +31,5 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jfr, \
MAIN_CLASS := jdk.jfr.internal.tool.Main, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
diff --git a/make/modules/jdk.jlink/Launcher.gmk b/make/modules/jdk.jlink/Launcher.gmk
index d427906519357..ef6f5ad1665bd 100644
--- a/make/modules/jdk.jlink/Launcher.gmk
+++ b/make/modules/jdk.jlink/Launcher.gmk
@@ -31,7 +31,7 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jimage, \
MAIN_CLASS := jdk.tools.jimage.Main, \
- CFLAGS := -DENABLE_ARG_FILES, \
+ ENABLE_ARG_FILES := true, \
))
################################################################################
@@ -41,7 +41,8 @@ $(eval $(call SetupBuildLauncher, jimage, \
$(eval $(call SetupBuildLauncher, jlink, \
MAIN_CLASS := jdk.tools.jlink.internal.Main, \
JAVA_ARGS := --add-modules ALL-DEFAULT, \
- CFLAGS := -DENABLE_ARG_FILES -DEXPAND_CLASSPATH_WILDCARDS, \
+ ENABLE_ARG_FILES := true, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
################################################################################
@@ -50,5 +51,6 @@ $(eval $(call SetupBuildLauncher, jlink, \
$(eval $(call SetupBuildLauncher, jmod, \
MAIN_CLASS := jdk.tools.jmod.Main, \
- CFLAGS := -DENABLE_ARG_FILES -DEXPAND_CLASSPATH_WILDCARDS, \
+ ENABLE_ARG_FILES := true, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
diff --git a/make/modules/jdk.jshell/Launcher.gmk b/make/modules/jdk.jshell/Launcher.gmk
index bf555d7f64c13..66da3a9e5fcae 100644
--- a/make/modules/jdk.jshell/Launcher.gmk
+++ b/make/modules/jdk.jshell/Launcher.gmk
@@ -31,5 +31,5 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jshell, \
MAIN_CLASS := jdk.internal.jshell.tool.JShellToolProvider, \
- CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
+ EXPAND_CLASSPATH_WILDCARDS := true, \
))
diff --git a/make/test/BuildMicrobenchmark.gmk b/make/test/BuildMicrobenchmark.gmk
index 1052e422f7b06..272cb1af0a6bb 100644
--- a/make/test/BuildMicrobenchmark.gmk
+++ b/make/test/BuildMicrobenchmark.gmk
@@ -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
@@ -96,8 +96,6 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
--add-exports java.base/jdk.internal.util=ALL-UNNAMED \
- --add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
- --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
--add-exports java.base/sun.security.util=ALL-UNNAMED \
diff --git a/make/test/BuildTestLib.gmk b/make/test/BuildTestLib.gmk
index 5659423826136..1a13e1914685c 100644
--- a/make/test/BuildTestLib.gmk
+++ b/make/test/BuildTestLib.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 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
@@ -64,7 +64,6 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \
HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \
JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
- DISABLED_WARNINGS := try deprecation rawtypes unchecked serial cast removal preview restricted dangling-doc-comments, \
JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \
diff --git a/src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp b/src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp
index 33a72263a2774..a3c729fdd56e7 100644
--- a/src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/constMethod.hpp"
#include "oops/klass.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp
index 76f88764416e3..b03344f2d8027 100644
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020 Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/bytecodes_aarch64.cpp b/src/hotspot/cpu/aarch64/bytecodes_aarch64.cpp
index 744a983b18341..119ad8baec368 100644
--- a/src/hotspot/cpu/aarch64/bytecodes_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/bytecodes_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/bytecodes.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
index 89a97a4984fc8..2334cbdff24e4 100644
--- a/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.cpp
index c50da1c8bebf3..158af57603ca8 100644
--- a/src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -28,4 +28,3 @@
//--------------------------------------------------------
// No FPU stack on AARCH64
-#include "precompiled.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp
index 91582b6733e5e..051b2ff47c142 100644
--- a/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
index b01360c3f7ebc..31a775e4f0335 100644
--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "asm/assembler.hpp"
#include "c1/c1_CodeStubs.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
index 4ae2da6680263..64f1799a75923 100644
--- a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
@@ -779,13 +778,11 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
}
case vmIntrinsics::_floatToFloat16: {
LIR_Opr tmp = new_register(T_FLOAT);
- __ move(LIR_OprFact::floatConst(-0.0), tmp);
__ f2hf(src, dst, tmp);
break;
}
case vmIntrinsics::_float16ToFloat: {
LIR_Opr tmp = new_register(T_FLOAT);
- __ move(LIR_OprFact::floatConst(-0.0), tmp);
__ hf2f(src, dst, tmp);
break;
}
diff --git a/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp
index 0dd1a2156e89e..5d2890251d7d4 100644
--- a/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
#include "c1/c1_LIR.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.cpp
index 4b426694cd7e3..d99916ecb8863 100644
--- a/src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_LinearScan.hpp"
#include "utilities/bitMap.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
index fc6cadc8450cb..6b1a5a7f1e0c4 100644
--- a/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
index 19665d1b89404..5ab753188cbe0 100644
--- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_Defs.hpp"
diff --git a/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp
index 90157a5668d94..5d8d1fbd9cb44 100644
--- a/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/c2_MacroAssembler.hpp"
#include "opto/c2_CodeStubs.hpp"
#include "runtime/objectMonitor.hpp"
diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
index 5cc579762969d..e3d197a457215 100644
--- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "opto/c2_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/c2_init_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_init_aarch64.cpp
index 436e0c5e41c31..e1bf8e3d1af11 100644
--- a/src/hotspot/cpu/aarch64/c2_init_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/c2_init_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
diff --git a/src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp b/src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp
index 31618414e31b7..97d9f7afdfb48 100644
--- a/src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.inline.hpp"
#include "asm/macroAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp
index b9248b01a0911..24a7a78b8004b 100644
--- a/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp b/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp
index 6ad6e3134bc51..0c2d9a32c8c13 100644
--- a/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/compressedKlass_aarch64.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "logging/log.hpp"
#include "oops/compressedKlass.hpp"
diff --git a/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp b/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp
index 4322eb1c4fcb6..7febbaa63bbc9 100644
--- a/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, Arm Limited. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/cpu/aarch64/foreignGlobals_aarch64.cpp b/src/hotspot/cpu/aarch64/foreignGlobals_aarch64.cpp
index 9d1a66f887126..1ed5e6f312f76 100644
--- a/src/hotspot/cpu/aarch64/foreignGlobals_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/foreignGlobals_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022, Arm Limited. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/vmreg.inline.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/jniHandles.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/frame_aarch64.cpp b/src/hotspot/cpu/aarch64/frame_aarch64.cpp
index 361b913fd2ea2..7201674cd639c 100644
--- a/src/hotspot/cpu/aarch64/frame_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/frame_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
@@ -163,6 +162,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
if (Continuation::is_return_barrier_entry(sender_pc)) {
+ // sender_pc might be invalid so check that the frame
+ // actually belongs to a Continuation.
+ if (!Continuation::is_frame_in_continuation(thread, *this)) {
+ return false;
+ }
// If our sender_pc is the return barrier, then our "real" sender is the continuation entry
frame s = Continuation::continuation_bottom_sender(thread, *this, sender_sp);
sender_sp = s.sp();
diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp
index df521f94d1f84..42f3c4a015ac4 100644
--- a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp
index 0161843036bc5..828033975a065 100644
--- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp
index 5169a510154ab..c45611c882b5a 100644
--- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nativeInst.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp
index 6afdb285914fb..ea36183c9de95 100644
--- a/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp
index a50152d244fba..6890159189310 100644
--- a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp
index 666335330ed1b..e33ef47cf3c38 100644
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
index f682e86cdfbdd..19270d9fecf57 100644
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
#include "gc/shenandoah/shenandoahForwarding.hpp"
diff --git a/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp
index c656736aa6473..a58c91a6a41e1 100644
--- a/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/z/zAddress_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddress.hpp"
@@ -85,7 +84,7 @@ static size_t probe_valid_max_address_bit() {
munmap(result_addr, page_size);
}
}
- log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
+ log_info_p(gc, init)("Probing address space for the highest valid bit: %zu", max_address_bit);
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
#else // LINUX
return DEFAULT_MAX_ADDRESS_BIT;
diff --git a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp
index 3f1898b6742e1..5d4f0801ec62f 100644
--- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/vmreg.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/icache_aarch64.cpp b/src/hotspot/cpu/aarch64/icache_aarch64.cpp
index 8bdddd4f1516a..311f3a7de1f73 100644
--- a/src/hotspot/cpu/aarch64/icache_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/icache_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020 Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/icache.hpp"
void ICacheStubGenerator::generate_icache_flush(
diff --git a/src/hotspot/cpu/aarch64/immediate_aarch64.cpp b/src/hotspot/cpu/aarch64/immediate_aarch64.cpp
index 9c67a0dfeada9..024d554b98f54 100644
--- a/src/hotspot/cpu/aarch64/immediate_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/immediate_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -26,7 +26,6 @@
#include
#include
-#include "precompiled.hpp"
#include "immediate_aarch64.hpp"
#include "metaprogramming/primitiveConversions.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
index 836caa86cb0af..9892de21a8114 100644
--- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/compiler_globals.hpp"
#include "gc/shared/barrierSet.hpp"
@@ -503,7 +502,7 @@ void InterpreterMacroAssembler::remove_activation(
// get method access flags
ldr(r1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
- ldr(r2, Address(r1, Method::access_flags_offset()));
+ ldrh(r2, Address(r1, Method::access_flags_offset()));
tbz(r2, exact_log2(JVM_ACC_SYNCHRONIZED), unlocked);
// Don't unlock anything if the _do_not_unlock_if_synchronized flag
diff --git a/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp b/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp
index 90c7ca6f08a3d..d6310a2d326c9 100644
--- a/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
diff --git a/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp b/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp
index aea268ea94443..8bec45b4b479a 100644
--- a/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp
index 45ad873ae2747..3015206dadc4d 100644
--- a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "jvmci/jvmci.hpp"
#include "jvmci/jvmciCodeInstaller.hpp"
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
index d561fb912a311..b6472b1b94812 100644
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "ci/ciEnv.hpp"
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_aes.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_aes.cpp
index 03853a7ca46be..84b85b7b445cb 100644
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_aes.cpp
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_aes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_chacha.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_chacha.cpp
index 9e53258730e50..1f7bb8f46f64f 100644
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_chacha.cpp
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_chacha.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,9 +22,6 @@
*
*/
-#include "precompiled.hpp"
-
-#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_aarch64.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp
index 91226dc78eb4f..d4bc983511f1d 100644
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, Cavium. All rights reserved. (By BELLSOFT)
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_aarch64.hpp"
diff --git a/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp b/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp
index aa6a9d14ff176..588b8898d2d2a 100644
--- a/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp
index 1f6d729238974..33158d6b97a91 100644
--- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/aarch64/registerMap_aarch64.cpp b/src/hotspot/cpu/aarch64/registerMap_aarch64.cpp
index 7bf513eba31ed..b58386ec80291 100644
--- a/src/hotspot/cpu/aarch64/registerMap_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/registerMap_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Arm Limited. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "runtime/registerMap.hpp"
#include "vmreg_aarch64.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/register_aarch64.cpp b/src/hotspot/cpu/aarch64/register_aarch64.cpp
index 3a46e38a72a76..82683daae4f08 100644
--- a/src/hotspot/cpu/aarch64/register_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/register_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_aarch64.hpp"
Register::RegisterImpl all_RegisterImpls [Register::number_of_declared_registers + 1];
diff --git a/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp b/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp
index c4c8648d552d0..f5d7d9e4387ec 100644
--- a/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/nmethod.hpp"
#include "code/relocInfo.hpp"
diff --git a/src/hotspot/cpu/aarch64/runtime_aarch64.cpp b/src/hotspot/cpu/aarch64/runtime_aarch64.cpp
index 5358a4e6a1d48..635c074eadc63 100644
--- a/src/hotspot/cpu/aarch64/runtime_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/runtime_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
index fa48092fd505a..b0b299876018a 100644
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeCache.hpp"
@@ -760,7 +759,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;
{ // Bypass the barrier for non-static methods
- __ ldrw(rscratch1, Address(rmethod, Method::access_flags_offset()));
+ __ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
__ br(Assembler::EQ, L_skip_barrier); // non-static
}
diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
index de5df5c1af156..0986e45a0a2c2 100644
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "asm/register.hpp"
diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp
index dee615df5a51f..407e3d70af9ac 100644
--- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
index f70450b722223..fbe06a6d78138 100644
--- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "compiler/disassembler.hpp"
@@ -809,7 +808,7 @@ void TemplateInterpreterGenerator::lock_method() {
#ifdef ASSERT
{
Label L;
- __ ldrw(r0, access_flags);
+ __ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_SYNCHRONIZED);
__ br(Assembler::NE, L);
__ stop("method doesn't need synchronization");
@@ -820,7 +819,7 @@ void TemplateInterpreterGenerator::lock_method() {
// get synchronization object
{
Label done;
- __ ldrw(r0, access_flags);
+ __ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_STATIC);
// get receiver (assume this is frequent case)
__ ldr(r0, Address(rlocals, Interpreter::local_offset_in_bytes(0)));
@@ -1225,7 +1224,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// make sure method is native & not abstract
#ifdef ASSERT
- __ ldrw(r0, access_flags);
+ __ ldrh(r0, access_flags);
{
Label L;
__ tst(r0, JVM_ACC_NATIVE);
@@ -1277,7 +1276,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
#ifdef ASSERT
{
Label L;
- __ ldrw(r0, access_flags);
+ __ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_SYNCHRONIZED);
__ br(Assembler::EQ, L);
__ stop("method needs synchronization");
@@ -1354,7 +1353,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// pass mirror handle if static call
{
Label L;
- __ ldrw(t, Address(rmethod, Method::access_flags_offset()));
+ __ ldrh(t, Address(rmethod, Method::access_flags_offset()));
__ tbz(t, exact_log2(JVM_ACC_STATIC), L);
// get mirror
__ load_mirror(t, rmethod, r10, rscratch2);
@@ -1564,7 +1563,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// do unlocking if necessary
{
Label L;
- __ ldrw(t, Address(rmethod, Method::access_flags_offset()));
+ __ ldrh(t, Address(rmethod, Method::access_flags_offset()));
__ tbz(t, exact_log2(JVM_ACC_SYNCHRONIZED), L);
// the code below should be shared with interpreter macro
// assembler implementation
@@ -1695,7 +1694,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// make sure method is not native & not abstract
#ifdef ASSERT
- __ ldrw(r0, access_flags);
+ __ ldrh(r0, access_flags);
{
Label L;
__ tst(r0, JVM_ACC_NATIVE);
@@ -1751,7 +1750,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
{
Label L;
- __ ldrw(r0, access_flags);
+ __ ldrh(r0, access_flags);
__ tst(r0, JVM_ACC_SYNCHRONIZED);
__ br(Assembler::EQ, L);
__ stop("method needs synchronization");
diff --git a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
index 60d4c3c511009..e50810486c80d 100644
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/disassembler.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp b/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp
index a2925f00b053f..ac597bea07d5c 100644
--- a/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/upcallLinker_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022, Arm Limited. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.hpp"
#include "logging/logStream.hpp"
diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
index 87c7862e2503d..874f8a380ae48 100644
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "pauth_aarch64.hpp"
#include "register_aarch64.hpp"
#include "runtime/arguments.hpp"
@@ -158,6 +157,10 @@ void VM_Version::initialize() {
if (FLAG_IS_DEFAULT(OnSpinWaitInstCount)) {
FLAG_SET_DEFAULT(OnSpinWaitInstCount, 2);
}
+ if (FLAG_IS_DEFAULT(CodeEntryAlignment) &&
+ (_model == CPU_MODEL_AMPERE_1A || _model == CPU_MODEL_AMPERE_1B)) {
+ FLAG_SET_DEFAULT(CodeEntryAlignment, 32);
+ }
}
// ThunderX
diff --git a/src/hotspot/cpu/aarch64/vmreg_aarch64.cpp b/src/hotspot/cpu/aarch64/vmreg_aarch64.cpp
index 49adb39834005..47ca0b30708b9 100644
--- a/src/hotspot/cpu/aarch64/vmreg_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vmreg_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
#include "vmreg_aarch64.inline.hpp"
diff --git a/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp b/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
index 56da06433e0b8..11ea02621d765 100644
--- a/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/arm/abstractInterpreter_arm.cpp b/src/hotspot/cpu/arm/abstractInterpreter_arm.cpp
index 53e557fad86c8..075db4736f132 100644
--- a/src/hotspot/cpu/arm/abstractInterpreter_arm.cpp
+++ b/src/hotspot/cpu/arm/abstractInterpreter_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "interpreter/bytecode.hpp"
#include "interpreter/interpreter.hpp"
diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad
index a3db5c0619ced..617745dee20ab 100644
--- a/src/hotspot/cpu/arm/arm.ad
+++ b/src/hotspot/cpu/arm/arm.ad
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2008, 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
@@ -283,7 +283,7 @@ void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
}
st->print_cr("PUSH R_FP|R_LR_LR"); st->print("\t");
if (framesize != 0) {
- st->print ("SUB R_SP, R_SP, " SIZE_FORMAT,framesize);
+ st->print ("SUB R_SP, R_SP, %zu", framesize);
}
if (C->stub_function() == nullptr && BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
@@ -362,7 +362,7 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
framesize -= 2*wordSize;
if (framesize != 0) {
- st->print("ADD R_SP, R_SP, " SIZE_FORMAT "\n\t",framesize);
+ st->print("ADD R_SP, R_SP, %zu\n\t",framesize);
}
st->print("POP R_FP|R_LR_LR");
diff --git a/src/hotspot/cpu/arm/assembler_arm.cpp b/src/hotspot/cpu/arm/assembler_arm.cpp
index ec34912ad5113..246c25c6575c1 100644
--- a/src/hotspot/cpu/arm/assembler_arm.cpp
+++ b/src/hotspot/cpu/arm/assembler_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "ci/ciEnv.hpp"
diff --git a/src/hotspot/cpu/arm/assembler_arm_32.cpp b/src/hotspot/cpu/arm/assembler_arm_32.cpp
index b140bce707633..36a0ae6ebacaa 100644
--- a/src/hotspot/cpu/arm/assembler_arm_32.cpp
+++ b/src/hotspot/cpu/arm/assembler_arm_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "ci/ciEnv.hpp"
diff --git a/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp b/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp
index 8e85fa88a8749..bca6c7ca30cb8 100644
--- a/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/arm/c1_FrameMap_arm.cpp b/src/hotspot/cpu/arm/c1_FrameMap_arm.cpp
index 7eb4009be1136..0fd113c8ceb1b 100644
--- a/src/hotspot/cpu/arm/c1_FrameMap_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_FrameMap_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp
index b14e6f0b4ca0c..14a51bf4b1352 100644
--- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_LIRAssembler.hpp"
diff --git a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp
index a70bf2cbda953..39c20700a2d6c 100644
--- a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/arm/c1_LIR_arm.cpp b/src/hotspot/cpu/arm/c1_LIR_arm.cpp
index 9d70fd12f3558..b8d693093483b 100644
--- a/src/hotspot/cpu/arm/c1_LIR_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_LIR_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LIR.hpp"
FloatRegister LIR_Opr::as_float_reg() const {
diff --git a/src/hotspot/cpu/arm/c1_LinearScan_arm.cpp b/src/hotspot/cpu/arm/c1_LinearScan_arm.cpp
index 21030b9a23f95..f1d6c6a0ff94f 100644
--- a/src/hotspot/cpu/arm/c1_LinearScan_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_LinearScan_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_LinearScan.hpp"
#include "utilities/bitMap.inline.hpp"
diff --git a/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp
index 70542d278acf7..195607d5c9119 100644
--- a/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp
index bae882ea93d93..949e985ab1eea 100644
--- a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp
+++ b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_LIRAssembler.hpp"
diff --git a/src/hotspot/cpu/arm/c2_MacroAssembler_arm.cpp b/src/hotspot/cpu/arm/c2_MacroAssembler_arm.cpp
index 900bd33fd9d46..89be6d288ffeb 100644
--- a/src/hotspot/cpu/arm/c2_MacroAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/c2_MacroAssembler_arm.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "opto/c2_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/arm/compiledIC_arm.cpp b/src/hotspot/cpu/arm/compiledIC_arm.cpp
index 2556a79126a6d..86927cd24ab9e 100644
--- a/src/hotspot/cpu/arm/compiledIC_arm.cpp
+++ b/src/hotspot/cpu/arm/compiledIC_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/nativeInst.hpp"
diff --git a/src/hotspot/cpu/arm/downcallLinker_arm.cpp b/src/hotspot/cpu/arm/downcallLinker_arm.cpp
index eb15424eb38cf..e0d32dbe154e0 100644
--- a/src/hotspot/cpu/arm/downcallLinker_arm.cpp
+++ b/src/hotspot/cpu/arm/downcallLinker_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "prims/downcallLinker.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/arm/foreignGlobals_arm.cpp b/src/hotspot/cpu/arm/foreignGlobals_arm.cpp
index 5f5a4eb32e0c7..677440e380235 100644
--- a/src/hotspot/cpu/arm/foreignGlobals_arm.cpp
+++ b/src/hotspot/cpu/arm/foreignGlobals_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/vmreg.hpp"
#include "prims/foreignGlobals.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/arm/frame_arm.cpp b/src/hotspot/cpu/arm/frame_arm.cpp
index 13a5c471c6fea..2722f93edec55 100644
--- a/src/hotspot/cpu/arm/frame_arm.cpp
+++ b/src/hotspot/cpu/arm/frame_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp
index 17ac726ada774..466dcc8fe66c1 100644
--- a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp
index 521c766bcd072..704ca71ce990d 100644
--- a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
diff --git a/src/hotspot/cpu/arm/gc/shared/barrierSetNMethod_arm.cpp b/src/hotspot/cpu/arm/gc/shared/barrierSetNMethod_arm.cpp
index ed15cc5ebcfe7..224a499ff5420 100644
--- a/src/hotspot/cpu/arm/gc/shared/barrierSetNMethod_arm.cpp
+++ b/src/hotspot/cpu/arm/gc/shared/barrierSetNMethod_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nativeInst.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
diff --git a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp
index 11b2ca2ef1d8c..91d3b8e9e5cee 100644
--- a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
diff --git a/src/hotspot/cpu/arm/gc/shared/modRefBarrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/shared/modRefBarrierSetAssembler_arm.cpp
index 73208cec4e8fe..cb4058d48edb9 100644
--- a/src/hotspot/cpu/arm/gc/shared/modRefBarrierSetAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/gc/shared/modRefBarrierSetAssembler_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/arm/icache_arm.cpp b/src/hotspot/cpu/arm/icache_arm.cpp
index 61fcb8a358048..53e9824756a2e 100644
--- a/src/hotspot/cpu/arm/icache_arm.cpp
+++ b/src/hotspot/cpu/arm/icache_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.hpp"
#include "runtime/icache.hpp"
diff --git a/src/hotspot/cpu/arm/interp_masm_arm.cpp b/src/hotspot/cpu/arm/interp_masm_arm.cpp
index 3a81fdddb3c32..e9e6187a6d181 100644
--- a/src/hotspot/cpu/arm/interp_masm_arm.cpp
+++ b/src/hotspot/cpu/arm/interp_masm_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
@@ -736,7 +735,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, Register ret_a
ldrb(Rflag, do_not_unlock_if_synchronized);
// get method access flags
- ldr_u32(Raccess_flags, Address(Rmethod, Method::access_flags_offset()));
+ ldrh(Raccess_flags, Address(Rmethod, Method::access_flags_offset()));
strb(zero_register(Rtemp), do_not_unlock_if_synchronized); // reset the flag
diff --git a/src/hotspot/cpu/arm/interpreterRT_arm.cpp b/src/hotspot/cpu/arm/interpreterRT_arm.cpp
index c8996bc266ca3..20dcbcdd8be0e 100644
--- a/src/hotspot/cpu/arm/interpreterRT_arm.cpp
+++ b/src/hotspot/cpu/arm/interpreterRT_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
diff --git a/src/hotspot/cpu/arm/jniFastGetField_arm.cpp b/src/hotspot/cpu/arm/jniFastGetField_arm.cpp
index 2a7e16578fffa..3a5dd10e82eba 100644
--- a/src/hotspot/cpu/arm/jniFastGetField_arm.cpp
+++ b/src/hotspot/cpu/arm/jniFastGetField_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.hpp"
#include "code/codeBlob.hpp"
diff --git a/src/hotspot/cpu/arm/macroAssembler_arm.cpp b/src/hotspot/cpu/arm/macroAssembler_arm.cpp
index 8e7b323e535f1..638b3a5404c25 100644
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.hpp"
diff --git a/src/hotspot/cpu/arm/methodHandles_arm.cpp b/src/hotspot/cpu/arm/methodHandles_arm.cpp
index f59e01112e904..3710fa33f365e 100644
--- a/src/hotspot/cpu/arm/methodHandles_arm.cpp
+++ b/src/hotspot/cpu/arm/methodHandles_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -26,7 +26,6 @@
// cross platform development for JSR292.
// Last synchronization: changeset f8c9417e3571
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmClasses.hpp"
#include "interpreter/interpreter.hpp"
@@ -497,7 +496,7 @@ void trace_method_handle_stub(const char* adaptername,
if (!has_mh) {
mh_reg_name = "R5";
}
- log_info(methodhandles)("MH %s %s=" PTR_FORMAT " sp=(" PTR_FORMAT "+" INTX_FORMAT ") stack_size=" INTX_FORMAT " bp=" PTR_FORMAT,
+ log_info(methodhandles)("MH %s %s=" PTR_FORMAT " sp=(" PTR_FORMAT "+%zd) stack_size=%zd bp=" PTR_FORMAT,
adaptername, mh_reg_name, mh_reg,
(intptr_t)entry_sp, (intptr_t)saved_sp - (intptr_t)entry_sp, (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp);
diff --git a/src/hotspot/cpu/arm/nativeInst_arm_32.cpp b/src/hotspot/cpu/arm/nativeInst_arm_32.cpp
index 6a4062f29b3ba..2caf2d7587e53 100644
--- a/src/hotspot/cpu/arm/nativeInst_arm_32.cpp
+++ b/src/hotspot/cpu/arm/nativeInst_arm_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/codeCache.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/arm/register_arm.cpp b/src/hotspot/cpu/arm/register_arm.cpp
index a0ae9ff4f92a9..ea3ef87e6708f 100644
--- a/src/hotspot/cpu/arm/register_arm.cpp
+++ b/src/hotspot/cpu/arm/register_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_arm.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/arm/relocInfo_arm.cpp b/src/hotspot/cpu/arm/relocInfo_arm.cpp
index fb112cdcfc0fa..2006be978bcdf 100644
--- a/src/hotspot/cpu/arm/relocInfo_arm.cpp
+++ b/src/hotspot/cpu/arm/relocInfo_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_arm.hpp"
diff --git a/src/hotspot/cpu/arm/runtime_arm.cpp b/src/hotspot/cpu/arm/runtime_arm.cpp
index cd76843d6dfef..cf4b398cf1fb9 100644
--- a/src/hotspot/cpu/arm/runtime_arm.cpp
+++ b/src/hotspot/cpu/arm/runtime_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/assembler.inline.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp
index 82e16836acb57..c63d72920a5b6 100644
--- a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp
+++ b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/debugInfoRec.hpp"
diff --git a/src/hotspot/cpu/arm/stubGenerator_arm.cpp b/src/hotspot/cpu/arm/stubGenerator_arm.cpp
index 9b91e02cf07f2..be550d818c00c 100644
--- a/src/hotspot/cpu/arm/stubGenerator_arm.cpp
+++ b/src/hotspot/cpu/arm/stubGenerator_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/arm/stubRoutines_arm.cpp b/src/hotspot/cpu/arm/stubRoutines_arm.cpp
index 0cd174d8da673..ac98896163f9f 100644
--- a/src/hotspot/cpu/arm/stubRoutines_arm.cpp
+++ b/src/hotspot/cpu/arm/stubRoutines_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
index 9df7a455eeb84..3f1cd1e23de8c 100644
--- a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
+++ b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
@@ -579,7 +578,7 @@ void TemplateInterpreterGenerator::lock_method() {
#ifdef ASSERT
{ Label L;
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tbnz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
__ stop("method doesn't need synchronization");
__ bind(L);
@@ -588,7 +587,7 @@ void TemplateInterpreterGenerator::lock_method() {
// get synchronization object
{ Label done;
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tst(Rtemp, JVM_ACC_STATIC);
__ ldr(R0, Address(Rlocals, Interpreter::local_offset_in_bytes(0)), eq); // get receiver (assume this is frequent case)
__ b(done, eq);
@@ -851,7 +850,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// make sure method is native & not abstract
#ifdef ASSERT
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
{
Label L;
__ tbnz(Rtemp, JVM_ACC_NATIVE_BIT, L);
@@ -893,7 +892,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// no synchronization necessary
#ifdef ASSERT
{ Label L;
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
__ stop("method needs synchronization");
__ bind(L);
@@ -975,7 +974,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Pass JNIEnv and mirror for static methods
{
Label L;
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ add(R0, Rthread, in_bytes(JavaThread::jni_environment_offset()));
__ tbz(Rtemp, JVM_ACC_STATIC_BIT, L);
__ load_mirror(Rtemp, Rmethod, Rtemp);
@@ -1204,7 +1203,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// make sure method is not native & not abstract
#ifdef ASSERT
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
{
Label L;
__ tbz(Rtemp, JVM_ACC_NATIVE_BIT, L);
@@ -1249,7 +1248,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// no synchronization necessary
#ifdef ASSERT
{ Label L;
- __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset()));
+ __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset()));
__ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L);
__ stop("method needs synchronization");
__ bind(L);
diff --git a/src/hotspot/cpu/arm/templateTable_arm.cpp b/src/hotspot/cpu/arm/templateTable_arm.cpp
index 0974ff1f9a9c3..bbe5713090af5 100644
--- a/src/hotspot/cpu/arm/templateTable_arm.cpp
+++ b/src/hotspot/cpu/arm/templateTable_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/collectedHeap.hpp"
diff --git a/src/hotspot/cpu/arm/upcallLinker_arm.cpp b/src/hotspot/cpu/arm/upcallLinker_arm.cpp
index 696b2001e6b7b..532ff7be8bc31 100644
--- a/src/hotspot/cpu/arm/upcallLinker_arm.cpp
+++ b/src/hotspot/cpu/arm/upcallLinker_arm.cpp
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "prims/upcallLinker.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/arm/vm_version_arm_32.cpp b/src/hotspot/cpu/arm/vm_version_arm_32.cpp
index d3ba352f78b15..148786a55da41 100644
--- a/src/hotspot/cpu/arm/vm_version_arm_32.cpp
+++ b/src/hotspot/cpu/arm/vm_version_arm_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "jvm.h"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/arm/vmreg_arm.cpp b/src/hotspot/cpu/arm/vmreg_arm.cpp
index c7c972db5c9b6..4ce1dd0be20f5 100644
--- a/src/hotspot/cpu/arm/vmreg_arm.cpp
+++ b/src/hotspot/cpu/arm/vmreg_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -23,7 +23,6 @@
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/arm/vtableStubs_arm.cpp b/src/hotspot/cpu/arm/vtableStubs_arm.cpp
index 8f453558848b5..2d7ccd1969b0d 100644
--- a/src/hotspot/cpu/arm/vtableStubs_arm.cpp
+++ b/src/hotspot/cpu/arm/vtableStubs_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/ppc/abstractInterpreter_ppc.cpp b/src/hotspot/cpu/ppc/abstractInterpreter_ppc.cpp
index 56f8fce5ce926..cc094ad4f995b 100644
--- a/src/hotspot/cpu/ppc/abstractInterpreter_ppc.cpp
+++ b/src/hotspot/cpu/ppc/abstractInterpreter_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/constMethod.hpp"
#include "oops/klass.inline.hpp"
diff --git a/src/hotspot/cpu/ppc/assembler_ppc.cpp b/src/hotspot/cpu/ppc/assembler_ppc.cpp
index 40c69dd290280..23f17dbb0400d 100644
--- a/src/hotspot/cpu/ppc/assembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/assembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp b/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp
index 4d3927dc644b8..baf21ec493205 100644
--- a/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp b/src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp
index a776dbcc4ef58..e4684613e2589 100644
--- a/src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
index af426935b2f2b..499ed73218923 100644
--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_LIRAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp
index b332ffbcee7d1..b0cf941fb7a9f 100644
--- a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
@@ -702,8 +701,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
value.load_item();
LIR_Opr dst = rlock_result(x);
LIR_Opr tmp = new_register(T_FLOAT);
- // f2hf treats tmp as live_in. Workaround: initialize to some value.
- __ move(LIR_OprFact::floatConst(-0.0), tmp); // just to satisfy LinearScan
__ f2hf(value.result(), dst, tmp);
break;
}
diff --git a/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp
index d031aaa1e4061..56a9307f21f96 100644
--- a/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
#include "c1/c1_LIR.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_LinearScan_ppc.cpp b/src/hotspot/cpu/ppc/c1_LinearScan_ppc.cpp
index 026540f25b213..d6ceab8b27b1b 100644
--- a/src/hotspot/cpu/ppc/c1_LinearScan_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_LinearScan_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_LinearScan.hpp"
#include "utilities/bitMap.inline.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp
index 8cd21478d41a4..c89bf29177e26 100644
--- a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
diff --git a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp
index 47cafc45f33ea..41d2fcb5730c4 100644
--- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/c2_CodeStubs_ppc.cpp b/src/hotspot/cpu/ppc/c2_CodeStubs_ppc.cpp
index 93ee0659a57f8..484e0fd0196db 100644
--- a/src/hotspot/cpu/ppc/c2_CodeStubs_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c2_CodeStubs_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/c2_MacroAssembler.hpp"
#include "opto/c2_CodeStubs.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp
index d7f2aefd9c477..9754acd349c1e 100644
--- a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "opto/c2_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/c2_init_ppc.cpp b/src/hotspot/cpu/ppc/c2_init_ppc.cpp
index d570abc431a9d..3c524f3b80e94 100644
--- a/src/hotspot/cpu/ppc/c2_init_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c2_init_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
#include "runtime/globals.hpp"
diff --git a/src/hotspot/cpu/ppc/compiledIC_ppc.cpp b/src/hotspot/cpu/ppc/compiledIC_ppc.cpp
index a7907b43c4bac..c8cb68e3eb4eb 100644
--- a/src/hotspot/cpu/ppc/compiledIC_ppc.cpp
+++ b/src/hotspot/cpu/ppc/compiledIC_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/cpu/ppc/compressedKlass_ppc.cpp b/src/hotspot/cpu/ppc/compressedKlass_ppc.cpp
index 51012eef86594..060eb058cfa4e 100644
--- a/src/hotspot/cpu/ppc/compressedKlass_ppc.cpp
+++ b/src/hotspot/cpu/ppc/compressedKlass_ppc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "oops/compressedKlass.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/cpu/ppc/downcallLinker_ppc.cpp b/src/hotspot/cpu/ppc/downcallLinker_ppc.cpp
index 45859f33bfb20..026283d35278b 100644
--- a/src/hotspot/cpu/ppc/downcallLinker_ppc.cpp
+++ b/src/hotspot/cpu/ppc/downcallLinker_ppc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, 2024 SAP SE. All rights reserved.
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/cpu/ppc/foreignGlobals_ppc.cpp b/src/hotspot/cpu/ppc/foreignGlobals_ppc.cpp
index 2143d1394992e..4d98b7630784f 100644
--- a/src/hotspot/cpu/ppc/foreignGlobals_ppc.cpp
+++ b/src/hotspot/cpu/ppc/foreignGlobals_ppc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, 2023, SAP SE. All rights reserved.
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/vmreg.inline.hpp"
#include "runtime/jniHandles.hpp"
diff --git a/src/hotspot/cpu/ppc/frame_ppc.cpp b/src/hotspot/cpu/ppc/frame_ppc.cpp
index f698b14d312b8..38c26e5e4970b 100644
--- a/src/hotspot/cpu/ppc/frame_ppc.cpp
+++ b/src/hotspot/cpu/ppc/frame_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
@@ -122,6 +121,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
address sender_pc = (address) sender_abi->lr;
if (Continuation::is_return_barrier_entry(sender_pc)) {
+ // sender_pc might be invalid so check that the frame
+ // actually belongs to a Continuation.
+ if (!Continuation::is_frame_in_continuation(thread, *this)) {
+ return false;
+ }
// If our sender_pc is the return barrier, then our "real" sender is the continuation entry
frame s = Continuation::continuation_bottom_sender(thread, *this, sender_sp);
sender_sp = s.sp();
diff --git a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp
index 39693bdf925bf..46ab535b9c9ef 100644
--- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp
@@ -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.
* Copyright (c) 2018, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp
index 956b082d194b4..360e0bcbf8c37 100644
--- a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp
@@ -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.
* Copyright (c) 2018, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp
index d1d0e5ab02412..19084ed27c7c0 100644
--- a/src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeBlob.hpp"
#include "code/nmethod.hpp"
#include "code/nativeInst.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp
index c9b6b94e1ee72..c0d078890fc4d 100644
--- a/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/shared/modRefBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/modRefBarrierSetAssembler_ppc.cpp
index a500a078c2d33..3a3ed391be0f7 100644
--- a/src/hotspot/cpu/ppc/gc/shared/modRefBarrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shared/modRefBarrierSetAssembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
#include "runtime/jniHandles.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp
index ce12d1fcf03f1..48422bc66212e 100644
--- a/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
index 9ce0b7c8eb4ee..38423f119003d 100644
--- a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/gcArguments.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp b/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp
index 5891d50f715ee..28a57b2dc293f 100644
--- a/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/z/zAddress_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddress.inline.hpp"
@@ -82,7 +81,7 @@ static size_t probe_valid_max_address_bit() {
munmap(result_addr, page_size);
}
}
- log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
+ log_info_p(gc, init)("Probing address space for the highest valid bit: %zu", max_address_bit);
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
#else // LINUX
return DEFAULT_MAX_ADDRESS_BIT;
diff --git a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp
index b9ea67dabe3d6..7b9d86142afea 100644
--- a/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp
@@ -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.
* Copyright (c) 2021, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "asm/register.hpp"
#include "code/codeBlob.hpp"
diff --git a/src/hotspot/cpu/ppc/icache_ppc.cpp b/src/hotspot/cpu/ppc/icache_ppc.cpp
index 6901efc37b77a..05ad3c7a30d14 100644
--- a/src/hotspot/cpu/ppc/icache_ppc.cpp
+++ b/src/hotspot/cpu/ppc/icache_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/icache.hpp"
// Use inline assembler to implement icache flush.
diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
index 67b9bdc04142f..ffbcb083f3cd1 100644
--- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -24,7 +24,6 @@
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
@@ -681,14 +680,14 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
// Check if synchronized method or unlocking prevented by
// JavaThread::do_not_unlock_if_synchronized flag.
lbz(Rdo_not_unlock_flag, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread);
- lwz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method);
+ lhz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method);
li(R0, 0);
stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread); // reset flag
push(state);
// Skip if we don't have to unlock.
- rldicl_(R0, Raccess_flags, 64-JVM_ACC_SYNCHRONIZED_BIT, 63); // Extract bit and compare to 0.
+ testbitdi(CCR0, R0, Raccess_flags, JVM_ACC_SYNCHRONIZED_BIT);
beq(CCR0, Lunlocked);
cmpwi(CCR0, Rdo_not_unlock_flag, 0);
diff --git a/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp b/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp
index e2043db71004b..c3d4bb01e5f1b 100644
--- a/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp
+++ b/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
diff --git a/src/hotspot/cpu/ppc/jniFastGetField_ppc.cpp b/src/hotspot/cpu/ppc/jniFastGetField_ppc.cpp
index 819ecaf550e38..a6174959fe682 100644
--- a/src/hotspot/cpu/ppc/jniFastGetField_ppc.cpp
+++ b/src/hotspot/cpu/ppc/jniFastGetField_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
index 971ed99f9eb50..f73325b652e85 100644
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "compiler/disassembler.hpp"
diff --git a/src/hotspot/cpu/ppc/methodHandles_ppc.cpp b/src/hotspot/cpu/ppc/methodHandles_ppc.cpp
index ccec05e710530..5017284c39d2f 100644
--- a/src/hotspot/cpu/ppc/methodHandles_ppc.cpp
+++ b/src/hotspot/cpu/ppc/methodHandles_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp
index 78ed81be9cb75..1114da60d2bb6 100644
--- a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp
+++ b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/ppc/register_ppc.cpp b/src/hotspot/cpu/ppc/register_ppc.cpp
index e84f89373adb0..4591d3ec2e447 100644
--- a/src/hotspot/cpu/ppc/register_ppc.cpp
+++ b/src/hotspot/cpu/ppc/register_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_ppc.hpp"
const char* Register::name() const {
diff --git a/src/hotspot/cpu/ppc/relocInfo_ppc.cpp b/src/hotspot/cpu/ppc/relocInfo_ppc.cpp
index c0fe87a1e13d4..559d30a8f23f7 100644
--- a/src/hotspot/cpu/ppc/relocInfo_ppc.cpp
+++ b/src/hotspot/cpu/ppc/relocInfo_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_ppc.hpp"
diff --git a/src/hotspot/cpu/ppc/runtime_ppc.cpp b/src/hotspot/cpu/ppc/runtime_ppc.cpp
index eceebc45c94e8..efd2ffa5672f7 100644
--- a/src/hotspot/cpu/ppc/runtime_ppc.cpp
+++ b/src/hotspot/cpu/ppc/runtime_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/macroAssembler.inline.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
index c2e4c2e9b55c9..95544045ff7a7 100644
--- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
+++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/debugInfoRec.hpp"
#include "code/compiledIC.hpp"
@@ -1202,7 +1201,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;
{ // Bypass the barrier for non-static methods
- __ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
+ __ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ andi_(R0, R0, JVM_ACC_STATIC);
__ beq(CCR0, L_skip_barrier); // non-static
}
diff --git a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp
index f1168b5d07bf2..da17b2fced44d 100644
--- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp
+++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp b/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp
index 7df905b90682c..60cca4efb5771 100644
--- a/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp
index 9147dfc1677ab..c8b5dbe0c163e 100644
--- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp
+++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "compiler/disassembler.hpp"
@@ -144,9 +143,9 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
// TODO PPC port: requires change in shared code.
//assert(in_bytes(AccessFlags::flags_offset()) == 0,
// "MethodDesc._access_flags == MethodDesc._access_flags._flags");
- // _access_flags must be a 32 bit value.
- assert(sizeof(AccessFlags) == 4, "wrong size");
- __ lwa(R11_scratch1/*access_flags*/, method_(access_flags));
+ // _access_flags must be a 16 bit value.
+ assert(sizeof(AccessFlags) == 2, "wrong size");
+ __ lhz(R11_scratch1/*access_flags*/, method_(access_flags));
// testbit with condition register.
__ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT);
__ btrue(CCR0, L);
@@ -823,7 +822,7 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc
{
if (!flags_preloaded) {
- __ lwz(Rflags, method_(access_flags));
+ __ lhz(Rflags, method_(access_flags));
}
#ifdef ASSERT
@@ -1301,8 +1300,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
assert(__ nonvolatile_accross_vthread_preemtion(access_flags),
"access_flags not preserved");
// Type check.
- assert(4 == sizeof(AccessFlags), "unexpected field size");
- __ lwz(access_flags, method_(access_flags));
+ assert(2 == sizeof(AccessFlags), "unexpected field size");
+ __ lhz(access_flags, method_(access_flags));
// We don't want to reload R19_method and access_flags after calls
// to some helper functions.
@@ -1769,7 +1768,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
else {
Label Lok;
- __ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method);
+ __ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method);
__ andi_(R0, R0, JVM_ACC_SYNCHRONIZED);
__ asm_assert_eq("method needs synchronization");
__ bind(Lok);
diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
index 43e78dd9d1514..d2f03c76df17f 100644
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "cds/cdsConfig.hpp"
#include "compiler/disassembler.hpp"
diff --git a/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp b/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp
index 40da31fa20932..872eee3b98e5a 100644
--- a/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp
+++ b/src/hotspot/cpu/ppc/upcallLinker_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "logging/logStream.hpp"
diff --git a/src/hotspot/cpu/ppc/vm_version_ppc.cpp b/src/hotspot/cpu/ppc/vm_version_ppc.cpp
index 9a4f13e41a04d..6aada789c1daf 100644
--- a/src/hotspot/cpu/ppc/vm_version_ppc.cpp
+++ b/src/hotspot/cpu/ppc/vm_version_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/disassembler.hpp"
@@ -90,7 +89,7 @@ void VM_Version::initialize() {
default: break;
}
guarantee(PowerArchitecturePPC64_ok, "PowerArchitecturePPC64 cannot be set to "
- UINTX_FORMAT " on this machine", PowerArchitecturePPC64);
+ "%zu on this machine", PowerArchitecturePPC64);
// Power 8: Configure Data Stream Control Register.
if (PowerArchitecturePPC64 >= 8 && has_mfdscr()) {
diff --git a/src/hotspot/cpu/ppc/vmreg_ppc.cpp b/src/hotspot/cpu/ppc/vmreg_ppc.cpp
index e76a83bc26961..d8a5c35cac0f5 100644
--- a/src/hotspot/cpu/ppc/vmreg_ppc.cpp
+++ b/src/hotspot/cpu/ppc/vmreg_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/ppc/vtableStubs_ppc_64.cpp b/src/hotspot/cpu/ppc/vtableStubs_ppc_64.cpp
index 567cfae8d0a5e..189a1fdeb147e 100644
--- a/src/hotspot/cpu/ppc/vtableStubs_ppc_64.cpp
+++ b/src/hotspot/cpu/ppc/vtableStubs_ppc_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/cpu/riscv/abstractInterpreter_riscv.cpp b/src/hotspot/cpu/riscv/abstractInterpreter_riscv.cpp
index 7e7321501cbbc..843a58e28d712 100644
--- a/src/hotspot/cpu/riscv/abstractInterpreter_riscv.cpp
+++ b/src/hotspot/cpu/riscv/abstractInterpreter_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/constMethod.hpp"
#include "oops/klass.inline.hpp"
diff --git a/src/hotspot/cpu/riscv/assembler_riscv.cpp b/src/hotspot/cpu/riscv/assembler_riscv.cpp
index 6a581a4d08193..4659afc09b57c 100644
--- a/src/hotspot/cpu/riscv/assembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/assembler_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +27,6 @@
#include
#include
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "compiler/disassembler.hpp"
diff --git a/src/hotspot/cpu/riscv/assembler_riscv.hpp b/src/hotspot/cpu/riscv/assembler_riscv.hpp
index 31713d7362a18..21a41bd3eb400 100644
--- a/src/hotspot/cpu/riscv/assembler_riscv.hpp
+++ b/src/hotspot/cpu/riscv/assembler_riscv.hpp
@@ -552,24 +552,6 @@ class Assembler : public AbstractAssembler {
#undef INSN
-#define INSN(NAME, op, funct3) \
- void NAME(FloatRegister Rd, Register Rs, const int32_t offset) { \
- guarantee(is_simm12(offset), "offset is invalid."); \
- unsigned insn = 0; \
- uint32_t val = offset & 0xfff; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, funct3); \
- patch_reg((address)&insn, 15, Rs); \
- patch_reg((address)&insn, 7, Rd); \
- patch((address)&insn, 31, 20, val); \
- emit(insn); \
- }
-
- INSN(flw, 0b0000111, 0b010);
- INSN(_fld, 0b0000111, 0b011);
-
-#undef INSN
-
#define INSN(NAME, op, funct3) \
void NAME(Register Rs1, Register Rs2, const int64_t offset) { \
guarantee(is_simm13(offset) && ((offset % 2) == 0), "offset is invalid."); \
@@ -813,29 +795,9 @@ enum operand_size { int8, int16, int32, uint32, int64 };
INSN(sc_d, 0b0101111, 0b011, 0b00011);
#undef INSN
-#define INSN(NAME, op, funct5, funct7) \
- void NAME(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, rm); \
- patch((address)&insn, 24, 20, funct5); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- emit(insn); \
- }
-
- INSN(fsqrt_s, 0b1010011, 0b00000, 0b0101100);
- INSN(fsqrt_d, 0b1010011, 0b00000, 0b0101101);
- INSN(fcvt_s_h, 0b1010011, 0b00010, 0b0100000);
- INSN(fcvt_h_s, 0b1010011, 0b00000, 0b0100010);
- INSN(fcvt_s_d, 0b1010011, 0b00001, 0b0100000);
- INSN(fcvt_d_s, 0b1010011, 0b00000, 0b0100001);
-#undef INSN
-
// Immediate Instruction
#define INSN(NAME, op, funct3) \
- void NAME(Register Rd, Register Rs1, int32_t imm) { \
+ void NAME(Register Rd, Register Rs1, int64_t imm) { \
guarantee(is_simm12(imm), "Immediate is out of validity"); \
unsigned insn = 0; \
patch((address)&insn, 6, 0, op); \
@@ -846,17 +808,17 @@ enum operand_size { int8, int16, int32, uint32, int64 };
emit(insn); \
}
- INSN(_addi, 0b0010011, 0b000);
- INSN(slti, 0b0010011, 0b010);
- INSN(_addiw, 0b0011011, 0b000);
- INSN(_and_imm12, 0b0010011, 0b111);
- INSN(ori, 0b0010011, 0b110);
- INSN(xori, 0b0010011, 0b100);
+ INSN(_addi, 0b0010011, 0b000);
+ INSN(_addiw, 0b0011011, 0b000);
+ INSN(_andi, 0b0010011, 0b111);
+ INSN(ori, 0b0010011, 0b110);
+ INSN(xori, 0b0010011, 0b100);
+ INSN(slti, 0b0010011, 0b010);
#undef INSN
#define INSN(NAME, op, funct3) \
- void NAME(Register Rd, Register Rs1, uint32_t imm) { \
+ void NAME(Register Rd, Register Rs1, uint64_t imm) { \
guarantee(is_uimm12(imm), "Immediate is out of validity"); \
unsigned insn = 0; \
patch((address)&insn,6, 0, op); \
@@ -928,209 +890,408 @@ enum operand_size { int8, int16, int32, uint32, int64 };
#undef INSN
-// Float and Double Rigster Instruction
-#define INSN(NAME, op, funct2) \
- void NAME(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, rm); \
- patch((address)&insn, 26, 25, funct2); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- patch_reg((address)&insn, 20, Rs2); \
- patch_reg((address)&insn, 27, Rs3); \
- emit(insn); \
- }
-
- INSN(fmadd_s, 0b1000011, 0b00);
- INSN(fmsub_s, 0b1000111, 0b00);
- INSN(fnmsub_s, 0b1001011, 0b00);
- INSN(fnmadd_s, 0b1001111, 0b00);
- INSN(fmadd_d, 0b1000011, 0b01);
- INSN(fmsub_d, 0b1000111, 0b01);
- INSN(fnmsub_d, 0b1001011, 0b01);
- INSN(fnmadd_d, 0b1001111, 0b01);
-
-#undef INSN
-
-// Float and Double Rigster Instruction
-#define INSN(NAME, op, funct3, funct7) \
- void NAME(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, funct3); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- patch_reg((address)&insn, 20, Rs2); \
- emit(insn); \
- }
-
- INSN(fsgnj_s, 0b1010011, 0b000, 0b0010000);
- INSN(fsgnjn_s, 0b1010011, 0b001, 0b0010000);
- INSN(fsgnjx_s, 0b1010011, 0b010, 0b0010000);
- INSN(fmin_s, 0b1010011, 0b000, 0b0010100);
- INSN(fmax_s, 0b1010011, 0b001, 0b0010100);
- INSN(fsgnj_d, 0b1010011, 0b000, 0b0010001);
- INSN(fsgnjn_d, 0b1010011, 0b001, 0b0010001);
- INSN(fsgnjx_d, 0b1010011, 0b010, 0b0010001);
- INSN(fmin_d, 0b1010011, 0b000, 0b0010101);
- INSN(fmax_d, 0b1010011, 0b001, 0b0010101);
-
-#undef INSN
-
-// Float and Double Rigster Arith Instruction
-#define INSN(NAME, op, funct3, funct7) \
- void NAME(Register Rd, FloatRegister Rs1, FloatRegister Rs2) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, funct3); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- patch_reg((address)&insn, 20, Rs2); \
- emit(insn); \
+// ==========================
+// Floating Point Instructions
+// ==========================
+ static constexpr uint32_t OP_FP_MAJOR = 0b1010011;
+
+ enum FmtPrecision : uint8_t {
+ S_32_sp = 0b00,
+ D_64_dp = 0b01,
+ H_16_hp = 0b10,
+ Q_128_qp = 0b11
+ };
+
+ private:
+
+ template
+ void fp_base(uint8_t Rd, uint8_t Rs1, uint8_t Rs2, RoundingMode rm) {
+ assert(Fmt != H_16_hp || UseZfh || UseZfhmin, "No half precision enabled");
+ assert_cond(Fmt != Q_128_qp);
+ guarantee(is_uimm3(rm), "Rounding mode is out of validity");
+ guarantee(is_uimm2(Fmt), "FMT is out of validity");
+ guarantee(is_uimm5(funct5), "Funct5 is out of validity");
+ uint32_t insn = 0;
+ patch((address)&insn, 6, 0, OP_FP_MAJOR);
+ patch((address)&insn, 11, 7, Rd);
+ patch((address)&insn, 14, 12, rm);
+ patch((address)&insn, 19, 15, Rs1);
+ patch((address)&insn, 24, 20, Rs2);
+ patch((address)&insn, 26, 25, Fmt);
+ patch((address)&insn, 31, 27, funct5);
+ emit(insn);
}
- INSN(feq_s, 0b1010011, 0b010, 0b1010000);
- INSN(flt_s, 0b1010011, 0b001, 0b1010000);
- INSN(fle_s, 0b1010011, 0b000, 0b1010000);
- INSN(feq_d, 0b1010011, 0b010, 0b1010001);
- INSN(fle_d, 0b1010011, 0b000, 0b1010001);
- INSN(flt_d, 0b1010011, 0b001, 0b1010001);
-#undef INSN
+ template
+ void fp_base(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm) {
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2->raw_encoding(), rm);
+ }
-// Float and Double Arith Instruction
-#define INSN(NAME, op, funct7) \
- void NAME(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, rm); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- patch_reg((address)&insn, 20, Rs2); \
- emit(insn); \
+ template
+ void fp_base(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, int8_t rm) {
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2->raw_encoding(), (RoundingMode)rm);
}
- INSN(fadd_s, 0b1010011, 0b0000000);
- INSN(fsub_s, 0b1010011, 0b0000100);
- INSN(fmul_s, 0b1010011, 0b0001000);
- INSN(fdiv_s, 0b1010011, 0b0001100);
- INSN(fadd_d, 0b1010011, 0b0000001);
- INSN(fsub_d, 0b1010011, 0b0000101);
- INSN(fmul_d, 0b1010011, 0b0001001);
- INSN(fdiv_d, 0b1010011, 0b0001101);
+ template
+ void fp_base(Register Rd, FloatRegister Rs1, FloatRegister Rs2, int8_t rm) {
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2->raw_encoding(), (RoundingMode)rm);
+ }
-#undef INSN
+ template
+ void fp_base(FloatRegister Rd, FloatRegister Rs1, int8_t Rs2, int8_t rm) {
+ guarantee(is_uimm5(Rs2), "Rs2 is out of validity");
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2, (RoundingMode)rm);
+ }
-// Whole Float and Double Conversion Instruction
-#define INSN(NAME, op, funct5, funct7) \
- void NAME(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, rm); \
- patch((address)&insn, 24, 20, funct5); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- emit(insn); \
+ template
+ void fp_base(FloatRegister Rd, Register Rs1, FloatRegister Rs2, RoundingMode rm) {
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2->raw_encoding(), rm);
}
- INSN(fcvt_s_w, 0b1010011, 0b00000, 0b1101000);
- INSN(fcvt_s_wu, 0b1010011, 0b00001, 0b1101000);
- INSN(fcvt_s_l, 0b1010011, 0b00010, 0b1101000);
- INSN(fcvt_s_lu, 0b1010011, 0b00011, 0b1101000);
- INSN(fcvt_d_w, 0b1010011, 0b00000, 0b1101001);
- INSN(fcvt_d_wu, 0b1010011, 0b00001, 0b1101001);
- INSN(fcvt_d_l, 0b1010011, 0b00010, 0b1101001);
- INSN(fcvt_d_lu, 0b1010011, 0b00011, 0b1101001);
+ template
+ void fp_base(Register Rd, FloatRegister Rs1, uint8_t Rs2, RoundingMode rm) {
+ guarantee(is_uimm5(Rs2), "Rs2 is out of validity");
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2, rm);
+ }
-#undef INSN
+ template
+ void fp_base(Register Rd, FloatRegister Rs1, uint8_t Rs2, uint8_t rm) {
+ guarantee(is_uimm5(Rs2), "Rs2 is out of validity");
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2, (RoundingMode)rm);
+ }
-// Float and Double Conversion Instruction
-#define INSN(NAME, op, funct5, funct7) \
- void NAME(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, rm); \
- patch((address)&insn, 24, 20, funct5); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- emit(insn); \
+ template
+ void fp_base(FloatRegister Rd, Register Rs1, uint8_t Rs2, RoundingMode rm) {
+ guarantee(is_uimm5(Rs2), "Rs2 is out of validity");
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2, rm);
}
- INSN(fcvt_w_s, 0b1010011, 0b00000, 0b1100000);
- INSN(fcvt_l_s, 0b1010011, 0b00010, 0b1100000);
- INSN(fcvt_wu_s, 0b1010011, 0b00001, 0b1100000);
- INSN(fcvt_lu_s, 0b1010011, 0b00011, 0b1100000);
- INSN(fcvt_w_d, 0b1010011, 0b00000, 0b1100001);
- INSN(fcvt_wu_d, 0b1010011, 0b00001, 0b1100001);
- INSN(fcvt_l_d, 0b1010011, 0b00010, 0b1100001);
- INSN(fcvt_lu_d, 0b1010011, 0b00011, 0b1100001);
-
-#undef INSN
-
-// Float and Double Move Instruction
-#define INSN(NAME, op, funct3, funct5, funct7) \
- void NAME(FloatRegister Rd, Register Rs1) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, funct3); \
- patch((address)&insn, 20, funct5); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- emit(insn); \
- }
-
- INSN(fmv_h_x, 0b1010011, 0b000, 0b00000, 0b1111010);
- INSN(fmv_w_x, 0b1010011, 0b000, 0b00000, 0b1111000);
- INSN(fmv_d_x, 0b1010011, 0b000, 0b00000, 0b1111001);
-
-#undef INSN
-
-enum fclass_mask {
- minf = 1 << 0, // negative infinite
- mnorm = 1 << 1, // negative normal number
- msubnorm = 1 << 2, // negative subnormal number
- mzero = 1 << 3, // negative zero
- pzero = 1 << 4, // positive zero
- psubnorm = 1 << 5, // positive subnormal number
- pnorm = 1 << 6, // positive normal number
- pinf = 1 << 7, // positive infinite
- snan = 1 << 8, // signaling NaN
- qnan = 1 << 9, // quiet NaN
- zero = mzero | pzero,
- subnorm = msubnorm | psubnorm,
- norm = mnorm | pnorm,
- inf = minf | pinf,
- nan = snan | qnan,
- finite = zero | subnorm | norm,
-};
+ template
+ void fp_base(FloatRegister Rd, Register Rs1, uint8_t Rs2, int8_t rm) {
+ guarantee(is_uimm5(Rs2), "Rs2 is out of validity");
+ fp_base(Rd->raw_encoding(), Rs1->raw_encoding(), Rs2, (RoundingMode)rm);
+ }
+
+ public:
-// Float and Double Conversion/Classify Instruction
-#define INSN(NAME, op, funct3, funct5, funct7) \
- void NAME(Register Rd, FloatRegister Rs1) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, op); \
- patch((address)&insn, 14, 12, funct3); \
- patch((address)&insn, 20, funct5); \
- patch((address)&insn, 31, 25, funct7); \
- patch_reg((address)&insn, 7, Rd); \
- patch_reg((address)&insn, 15, Rs1); \
- emit(insn); \
+ enum FClassBits {
+ minf = 1 << 0, // negative infinite
+ mnorm = 1 << 1, // negative normal number
+ msubnorm = 1 << 2, // negative subnormal number
+ mzero = 1 << 3, // negative zero
+ pzero = 1 << 4, // positive zero
+ psubnorm = 1 << 5, // positive subnormal number
+ pnorm = 1 << 6, // positive normal number
+ pinf = 1 << 7, // positive infinite
+ snan = 1 << 8, // signaling NaN
+ qnan = 1 << 9, // quiet NaN
+ zero = mzero | pzero,
+ subnorm = msubnorm | psubnorm,
+ norm = mnorm | pnorm,
+ inf = minf | pinf,
+ nan = snan | qnan,
+ finite = zero | subnorm | norm,
+ };
+
+ void fsqrt_s(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00000, rm);
}
- INSN(fclass_h, 0b1010011, 0b001, 0b00000, 0b1110010);
- INSN(fclass_s, 0b1010011, 0b001, 0b00000, 0b1110000);
- INSN(fclass_d, 0b1010011, 0b001, 0b00000, 0b1110001);
- INSN(fmv_x_h, 0b1010011, 0b000, 0b00000, 0b1110010);
- INSN(fmv_x_w, 0b1010011, 0b000, 0b00000, 0b1110000);
- INSN(fmv_x_d, 0b1010011, 0b000, 0b00000, 0b1110001);
+ void fsqrt_d(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
-#undef INSN
+ void fcvt_s_d(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00001, rm);
+ }
+
+ void fcvt_d_s(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
+
+ void fsgnj_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b000);
+ }
+
+ void fsgnjn_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b001);
+ }
+
+ void fsgnjx_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b010);
+ }
+
+ void fmin_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b000);
+ }
+
+ void fmax_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b001);
+ }
+
+ void fsgnj_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b000);
+ }
+
+ void fsgnjn_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b001);
+ }
+
+ void fsgnjx_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b010);
+ }
+
+ void fmin_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b000);
+ }
+
+ void fmax_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b001);
+ }
+
+ void feq_s(Register Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b010);
+ }
+
+ void flt_s(Register Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b001);
+ }
+
+ void fle_s(Register Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b000);
+ }
+
+ void feq_d(Register Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b010);
+ }
+
+ void fle_d(Register Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b000);
+ }
+
+ void flt_d(Register Rd, FloatRegister Rs1, FloatRegister Rs2) {
+ fp_base(Rd, Rs1, Rs2, 0b001);
+ }
+
+ void fadd_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fsub_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fmul_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fdiv_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fadd_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fsub_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fmul_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fdiv_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, Rs2, rm);
+ }
+
+ void fcvt_s_w(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
+
+ void fcvt_s_wu(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00001, rm);
+ }
+
+ void fcvt_s_l(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00010, rm);
+ }
+
+ void fcvt_s_lu(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00011, rm);
+ }
+
+ void fcvt_d_w(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
+
+ void fcvt_d_wu(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00001, rm);
+ }
+
+ void fcvt_d_l(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00010, rm);
+ }
+
+ void fcvt_d_lu(FloatRegister Rd, Register Rs1, RoundingMode rm = rne) {
+ fp_base(Rd, Rs1, 0b00011, rm);
+ }
+
+ void fcvt_w_s(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
+
+ void fcvt_l_s(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00010, rm);
+ }
+
+ void fcvt_wu_s(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00001, rm);
+ }
+
+ void fcvt_lu_s(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00011, rm);
+ }
+
+ void fcvt_w_d(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
+
+ void fcvt_wu_d(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00001, rm);
+ }
+
+ void fcvt_l_d(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00010, rm);
+ }
+
+ void fcvt_lu_d(Register Rd, FloatRegister Rs1, RoundingMode rm = rtz) {
+ fp_base(Rd, Rs1, 0b00011, rm);
+ }
+
+ void fmv_w_x(FloatRegister Rd, Register Rs1) {
+ fp_base(Rd, Rs1, 0b00000, 0b000);
+ }
+
+ void fmv_d_x(FloatRegister Rd, Register Rs1) {
+ fp_base(Rd, Rs1, 0b00000, 0b000);
+ }
+
+ void fclass_s(Register Rd, FloatRegister Rs1) {
+ fp_base(Rd, Rs1, 0b00000, 0b001);
+ }
+
+ void fclass_d(Register Rd, FloatRegister Rs1) {
+ fp_base(Rd, Rs1, 0b00000, 0b001);
+ }
+
+ void fmv_x_w(Register Rd, FloatRegister Rs1) {
+ fp_base(Rd, Rs1, 0b00000, 0b000);
+ }
+
+ void fmv_x_d(Register Rd, FloatRegister Rs1) {
+ fp_base(Rd, Rs1, 0b00000, 0b000);
+ }
+
+ private:
+ static constexpr unsigned int OP_LOAD_FP = 0b0000111;
+
+ template
+ void fp_load(FloatRegister Rd, Register Rs, const int32_t offset) {
+ guarantee(is_uimm3(FpWidth), "Rounding mode is out of validity");
+ guarantee(is_simm12(offset), "offset is invalid.");
+ unsigned insn = 0;
+ uint32_t val = offset & 0xfff;
+ patch((address)&insn, 6, 0, OP_LOAD_FP);
+ patch_reg((address)&insn, 7, Rd);
+ patch((address)&insn, 14, 12, FpWidth);
+ patch_reg((address)&insn, 15, Rs);
+ patch((address)&insn, 31, 20, val);
+ emit(insn);
+ }
+
+ public:
+
+ void flw(FloatRegister Rd, Register Rs, const int32_t offset) { fp_load<0b010>(Rd, Rs, offset); }
+ void _fld(FloatRegister Rd, Register Rs, const int32_t offset) { fp_load<0b011>(Rd, Rs, offset); }
+
+ private:
+ template
+ void fp_fm(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm) {
+ assert_cond(Fmt != Q_128_qp);
+ guarantee(is_uimm3(rm), "Rounding mode is out of validity");
+ guarantee(is_uimm2(Fmt), "FMT is out of validity");
+ unsigned insn = 0;
+ patch((address)&insn, 6, 0, OpVal);
+ patch_reg((address)&insn, 7, Rd);
+ patch((address)&insn, 14, 12, rm);
+ patch_reg((address)&insn, 15, Rs1);
+ patch_reg((address)&insn, 20, Rs2);
+ patch((address)&insn, 26, 25, Fmt);
+ patch_reg((address)&insn, 27, Rs3);
+ emit(insn);
+ }
+
+ public:
+ void fmadd_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fmsub_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fnmsub_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fnmadd_s(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fmadd_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fmsub_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fnmsub_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+ void fnmadd_d(FloatRegister Rd, FloatRegister Rs1, FloatRegister Rs2, FloatRegister Rs3, RoundingMode rm = rne) {
+ fp_fm(Rd, Rs1, Rs2, Rs3, rm);
+ }
+
+// -------------- ZFH Instruction Definitions --------------
+// Zfh Standard Extensions for Half-Precision Floating-Point
+ void fclass_h(Register Rd, FloatRegister Rs1) {
+ assert_cond(UseZfh);
+ fp_base(Rd, Rs1, 0b00000, 0b001);
+ }
+
+// Zfh and Zfhmin Half-Precision Floating-Point
+ void fcvt_s_h(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) {
+ assert_cond(UseZfh || UseZfhmin);
+ fp_base(Rd, Rs1, 0b00010, rm);
+ }
+
+ void fcvt_h_s(FloatRegister Rd, FloatRegister Rs1, RoundingMode rm = rne) {
+ assert_cond(UseZfh || UseZfhmin);
+ fp_base(Rd, Rs1, 0b00000, rm);
+ }
+
+ void fmv_h_x(FloatRegister Rd, Register Rs1) {
+ assert_cond(UseZfh || UseZfhmin);
+ fp_base(Rd, Rs1, 0b00000, 0b000);
+ }
+
+ void fmv_x_h(Register Rd, FloatRegister Rs1) {
+ assert_cond(UseZfh || UseZfhmin);
+ fp_base(Rd, Rs1, 0b00000, 0b000);
+ }
// ==========================
// RISC-V Vector Extension
@@ -2015,10 +2176,10 @@ enum Nf {
}
INSN(add_uw, 0b0111011, 0b000, 0b0000100);
- INSN(rol, 0b0110011, 0b001, 0b0110000);
- INSN(rolw, 0b0111011, 0b001, 0b0110000);
- INSN(ror, 0b0110011, 0b101, 0b0110000);
- INSN(rorw, 0b0111011, 0b101, 0b0110000);
+ INSN(rolr, 0b0110011, 0b001, 0b0110000);
+ INSN(rolrw, 0b0111011, 0b001, 0b0110000);
+ INSN(rorr, 0b0110011, 0b101, 0b0110000);
+ INSN(rorrw, 0b0111011, 0b101, 0b0110000);
INSN(sh1add, 0b0110011, 0b010, 0b0010000);
INSN(sh2add, 0b0110011, 0b100, 0b0010000);
INSN(sh3add, 0b0110011, 0b110, 0b0010000);
@@ -2230,7 +2391,7 @@ enum Nf {
}
#define INSN(NAME, funct3, op) \
- void NAME(Register Rd_Rs1, int32_t imm) { \
+ void NAME(Register Rd_Rs1, int64_t imm) { \
assert_cond(is_simm6(imm)); \
uint16_t insn = 0; \
c_patch((address)&insn, 1, 0, op); \
@@ -2247,7 +2408,7 @@ enum Nf {
#undef INSN
#define INSN(NAME, funct3, op) \
- void NAME(int32_t imm) { \
+ void NAME(int64_t imm) { \
assert_cond(is_simm10(imm)); \
assert_cond((imm & 0b1111) == 0); \
assert_cond(imm != 0); \
@@ -2268,7 +2429,7 @@ enum Nf {
#undef INSN
#define INSN(NAME, funct3, op) \
- void NAME(Register Rd, uint32_t uimm) { \
+ void NAME(Register Rd, uint64_t uimm) { \
assert_cond(is_uimm10(uimm)); \
assert_cond((uimm & 0b11) == 0); \
assert_cond(uimm != 0); \
@@ -2325,7 +2486,7 @@ enum Nf {
#undef INSN
#define INSN(NAME, funct3, funct2, op) \
- void NAME(Register Rd_Rs1, int32_t imm) { \
+ void NAME(Register Rd_Rs1, int64_t imm) { \
assert_cond(is_simm6(imm)); \
uint16_t insn = 0; \
c_patch((address)&insn, 1, 0, op); \
@@ -2950,7 +3111,7 @@ enum Nf {
// Immediate Instructions
// --------------------------
#define INSN(NAME) \
- void NAME(Register Rd, Register Rs1, int32_t imm) { \
+ void NAME(Register Rd, Register Rs1, int64_t imm) { \
/* addi -> c.addi/c.nop/c.mv/c.addi16sp/c.addi4spn */ \
if (do_compress()) { \
if (Rd == Rs1 && is_simm6(imm)) { \
@@ -2978,7 +3139,7 @@ enum Nf {
// --------------------------
#define INSN(NAME) \
- void NAME(Register Rd, Register Rs1, int32_t imm) { \
+ void NAME(Register Rd, Register Rs1, int64_t imm) { \
/* addiw -> c.addiw */ \
if (do_compress() && (Rd == Rs1 && Rd != x0 && is_simm6(imm))) { \
c_addiw(Rd, imm); \
@@ -2993,17 +3154,17 @@ enum Nf {
// --------------------------
#define INSN(NAME) \
- void NAME(Register Rd, Register Rs1, int32_t imm) { \
- /* and_imm12 -> c.andi */ \
+ void NAME(Register Rd, Register Rs1, int64_t imm) { \
+ /* andi -> c.andi */ \
if (do_compress() && \
(Rd == Rs1 && Rd->is_compressed_valid() && is_simm6(imm))) { \
c_andi(Rd, imm); \
return; \
} \
- _and_imm12(Rd, Rs1, imm); \
+ _andi(Rd, Rs1, imm); \
}
- INSN(and_imm12);
+ INSN(andi);
#undef INSN
@@ -3070,42 +3231,63 @@ enum Nf {
#undef INSN
// Cache Management Operations
-#define INSN(NAME, funct) \
- void NAME(Register Rs1) { \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, 0b0001111); \
- patch((address)&insn, 14, 12, 0b010); \
- patch_reg((address)&insn, 15, Rs1); \
- patch((address)&insn, 31, 20, funct); \
- emit(insn); \
+// These instruction may be turned off for user space.
+ private:
+ enum CBO_FUNCT : unsigned int {
+ CBO_INVAL = 0b0000000000000,
+ CBO_CLEAN = 0b0000000000001,
+ CBO_FLUSH = 0b0000000000010,
+ CBO_ZERO = 0b0000000000100
+ };
+
+ template
+ void cbo_base(Register Rs1) {
+ assert((UseZicbom && FUNCT != CBO_ZERO) || UseZicboz, "sanity");
+ unsigned insn = 0;
+ patch((address)&insn, 6, 0, 0b0001111);
+ patch((address)&insn, 14, 12, 0b010);
+ patch_reg((address)&insn, 15, Rs1);
+ patch((address)&insn, 31, 20, FUNCT);
+ emit(insn);
}
- INSN(cbo_inval, 0b0000000000000);
- INSN(cbo_clean, 0b0000000000001);
- INSN(cbo_flush, 0b0000000000010);
- INSN(cbo_zero, 0b0000000000100);
+ // This instruction have some security implication.
+ // At this time it's not likely to be enabled for user mode.
+ void cbo_inval(Register Rs1) { cbo_base(Rs1); }
+ public:
+ // Zicbom
+ void cbo_clean(Register Rs1) { cbo_base(Rs1); }
+ void cbo_flush(Register Rs1) { cbo_base(Rs1); }
+ // Zicboz
+ void cbo_zero(Register Rs1) { cbo_base(Rs1); }
-#undef INSN
+ private:
+ enum PREFETCH_FUNCT : unsigned int {
+ PREFETCH_I = 0b0000000000000,
+ PREFETCH_R = 0b0000000000001,
+ PREFETCH_W = 0b0000000000011
+ };
-#define INSN(NAME, funct) \
- void NAME(Register Rs1, int32_t offset) { \
- guarantee((offset & 0x1f) == 0, "offset lowest 5 bits must be zero"); \
- int32_t upperOffset = offset >> 5; \
- unsigned insn = 0; \
- patch((address)&insn, 6, 0, 0b0010011); \
- patch((address)&insn, 14, 12, 0b110); \
- patch_reg((address)&insn, 15, Rs1); \
- patch((address)&insn, 24, 20, funct); \
- upperOffset &= 0x7f; \
- patch((address)&insn, 31, 25, upperOffset); \
- emit(insn); \
+ template
+ void prefetch_base(Register Rs1, int32_t offset) {
+ assert_cond(UseZicbop);
+ guarantee((offset & 0x1f) == 0, "offset lowest 5 bits must be zero");
+ int32_t upperOffset = offset >> 5;
+ unsigned insn = 0;
+ patch((address)&insn, 6, 0, 0b0010011);
+ patch((address)&insn, 14, 12, 0b110);
+ patch_reg((address)&insn, 15, Rs1);
+ patch((address)&insn, 24, 20, FUNCT);
+ upperOffset &= 0x7f;
+ patch((address)&insn, 31, 25, upperOffset);
+ emit(insn);
}
- INSN(prefetch_i, 0b0000000000000);
- INSN(prefetch_r, 0b0000000000001);
- INSN(prefetch_w, 0b0000000000011);
-
-#undef INSN
+ public:
+ // Zicbop
+ void prefetch_i(Register Rs1, int32_t offset) { prefetch_base(Rs1, offset); }
+ void prefetch_r(Register Rs1, int32_t offset) { prefetch_base(Rs1, offset); }
+ void prefetch_w(Register Rs1, int32_t offset) { prefetch_base(Rs1, offset); }
// -------------- Zicond Instruction Definitions --------------
// Zicond conditional operations extension
@@ -3381,6 +3563,7 @@ enum Nf {
static bool is_simm18(int64_t x);
static bool is_simm21(int64_t x);
+ static bool is_uimm2(uint64_t x);
static bool is_uimm3(uint64_t x);
static bool is_uimm5(uint64_t x);
static bool is_uimm6(uint64_t x);
diff --git a/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp b/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp
index c51650881fc73..1f9e6df217206 100644
--- a/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp
+++ b/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp
@@ -38,6 +38,7 @@ inline bool Assembler::is_simm13(int64_t x) { return is_simm(x, 13); }
inline bool Assembler::is_simm18(int64_t x) { return is_simm(x, 18); }
inline bool Assembler::is_simm21(int64_t x) { return is_simm(x, 21); }
+inline bool Assembler::is_uimm2(uint64_t x) { return is_uimm(x, 2); }
inline bool Assembler::is_uimm3(uint64_t x) { return is_uimm(x, 3); }
inline bool Assembler::is_uimm5(uint64_t x) { return is_uimm(x, 5); }
inline bool Assembler::is_uimm6(uint64_t x) { return is_uimm(x, 6); }
diff --git a/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp b/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp
index 46af27a011f5a..b9bd7b356fa6b 100644
--- a/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/riscv/c1_FrameMap_riscv.cpp b/src/hotspot/cpu/riscv/c1_FrameMap_riscv.cpp
index 172031941b2b0..d3ccd46048b06 100644
--- a/src/hotspot/cpu/riscv/c1_FrameMap_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_FrameMap_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_arith_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_arith_riscv.cpp
index ee6dedfcc076b..f84c44d6fea9b 100644
--- a/src/hotspot/cpu/riscv/c1_LIRAssembler_arith_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_arith_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp
index 7d673383cad26..5aa213fba7a7b 100644
--- a/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_arraycopy_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
@@ -211,7 +210,7 @@ void LIR_Assembler::arraycopy_type_check(Register src, Register src_pos, Registe
Label cont, slow;
#define PUSH(r1, r2) \
- __ addi(sp, sp, -2 * wordSize); \
+ __ subi(sp, sp, 2 * wordSize); \
__ sd(r1, Address(sp, 1 * wordSize)); \
__ sd(r2, Address(sp, 0));
@@ -337,10 +336,10 @@ void LIR_Assembler::arraycopy_prepare_params(Register src, Register src_pos, Reg
Register dst, Register dst_pos, BasicType basic_type) {
int scale = array_element_size(basic_type);
__ shadd(c_rarg0, src_pos, src, t0, scale);
- __ add(c_rarg0, c_rarg0, arrayOopDesc::base_offset_in_bytes(basic_type));
+ __ addi(c_rarg0, c_rarg0, arrayOopDesc::base_offset_in_bytes(basic_type));
assert_different_registers(c_rarg0, dst, dst_pos, length);
__ shadd(c_rarg1, dst_pos, dst, t0, scale);
- __ add(c_rarg1, c_rarg1, arrayOopDesc::base_offset_in_bytes(basic_type));
+ __ addi(c_rarg1, c_rarg1, arrayOopDesc::base_offset_in_bytes(basic_type));
assert_different_registers(c_rarg1, dst, length);
__ mv(c_rarg2, length);
assert_different_registers(c_rarg2, dst);
diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp
index d587a557a7312..8d5299aa0fd2c 100644
--- a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
@@ -1084,7 +1083,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe
// check for self
__ beq(klass_RInfo, k_RInfo, *success_target);
- __ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo
+ __ subi(sp, sp, 2 * wordSize); // 2: store k_RInfo and klass_RInfo
__ sd(k_RInfo, Address(sp, 0)); // sub klass
__ sd(klass_RInfo, Address(sp, wordSize)); // super klass
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
@@ -1099,7 +1098,7 @@ void LIR_Assembler::typecheck_helper_slowcheck(ciKlass *k, Register obj, Registe
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr);
// call out-of-line instance of __ check_klass_subtytpe_slow_path(...)
- __ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo
+ __ subi(sp, sp, 2 * wordSize); // 2: store k_RInfo and klass_RInfo
__ sd(klass_RInfo, Address(sp, wordSize)); // sub klass
__ sd(k_RInfo, Address(sp, 0)); // super klass
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
@@ -2139,7 +2138,7 @@ void LIR_Assembler::lir_store_slowcheck(Register k_RInfo, Register klass_RInfo,
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, nullptr);
// call out-of-line instance of __ check_klass_subtype_slow_path(...)
- __ addi(sp, sp, -2 * wordSize); // 2: store k_RInfo and klass_RInfo
+ __ subi(sp, sp, 2 * wordSize); // 2: store k_RInfo and klass_RInfo
__ sd(klass_RInfo, Address(sp, wordSize)); // sub klass
__ sd(k_RInfo, Address(sp, 0)); // super klass
__ far_call(RuntimeAddress(Runtime1::entry_for(C1StubId::slow_subtype_check_id)));
diff --git a/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp
index b328d457192ba..00de4488793cb 100644
--- a/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/riscv/c1_LIR_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIR_riscv.cpp
index 5f1c394ab3d46..6ce70f48cb459 100644
--- a/src/hotspot/cpu/riscv/c1_LIR_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_LIR_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
#include "c1/c1_LIR.hpp"
diff --git a/src/hotspot/cpu/riscv/c1_LinearScan_riscv.cpp b/src/hotspot/cpu/riscv/c1_LinearScan_riscv.cpp
index 78a61128bdd5d..8a6dfbbdf1eb4 100644
--- a/src/hotspot/cpu/riscv/c1_LinearScan_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_LinearScan_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_LinearScan.hpp"
#include "utilities/bitMap.inline.hpp"
diff --git a/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp
index ed932dddcd8d8..76089e8dd4536 100644
--- a/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LIR.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
@@ -199,16 +198,16 @@ void C1_MacroAssembler::initialize_body(Register obj, Register len_in_bytes, int
Label done;
// len_in_bytes is positive and ptr sized
- sub(len_in_bytes, len_in_bytes, hdr_size_in_bytes);
+ subi(len_in_bytes, len_in_bytes, hdr_size_in_bytes);
beqz(len_in_bytes, done);
// Preserve obj
if (hdr_size_in_bytes) {
- add(obj, obj, hdr_size_in_bytes);
+ addi(obj, obj, hdr_size_in_bytes);
}
zero_memory(obj, len_in_bytes, tmp);
if (hdr_size_in_bytes) {
- sub(obj, obj, hdr_size_in_bytes);
+ subi(obj, obj, hdr_size_in_bytes);
}
bind(done);
@@ -262,7 +261,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
j(entry_point);
bind(loop);
- sub(index, index, 1);
+ subi(index, index, 1);
for (int i = -unroll; i < 0; i++) {
if (-i == remainder) {
bind(entry_point);
@@ -272,7 +271,7 @@ void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register
if (remainder == 0) {
bind(entry_point);
}
- add(t0, t0, unroll * wordSize);
+ addi(t0, t0, unroll * wordSize);
bnez(index, loop);
}
}
@@ -301,7 +300,7 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register tmp1
// align object end
mv(arr_size, (int32_t)base_offset_in_bytes + MinObjAlignmentInBytesMask);
shadd(arr_size, len, arr_size, t0, f);
- andi(arr_size, arr_size, ~(uint)MinObjAlignmentInBytesMask);
+ andi(arr_size, arr_size, ~MinObjAlignmentInBytesMask);
try_allocate(obj, arr_size, 0, tmp1, tmp2, slow_case);
diff --git a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp
index 6f59f5c2b9559..c076f28be6cab 100644
--- a/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_Defs.hpp"
@@ -147,7 +146,7 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres
const int arg1_sp_offset = 0;
const int arg2_sp_offset = 1;
const int arg3_sp_offset = 2;
- addi(sp, sp, -(arg_num + 1) * wordSize);
+ subi(sp, sp, (arg_num + 1) * wordSize);
sd(arg1, Address(sp, arg1_sp_offset * wordSize));
sd(arg2, Address(sp, arg2_sp_offset * wordSize));
sd(arg3, Address(sp, arg3_sp_offset * wordSize));
@@ -301,14 +300,14 @@ static OopMap* save_live_registers(StubAssembler* sasm,
if (save_fpu_registers) {
// float registers
- __ addi(sp, sp, -(FrameMap::nof_fpu_regs * wordSize));
+ __ subi(sp, sp, FrameMap::nof_fpu_regs * wordSize);
for (int i = 0; i < FrameMap::nof_fpu_regs; i++) {
__ fsd(as_FloatRegister(i), Address(sp, i * wordSize));
}
} else {
// we define reg_save_layout = 62 as the fixed frame size,
// we should also sub 32 * wordSize to sp when save_fpu_registers == false
- __ addi(sp, sp, -32 * wordSize);
+ __ subi(sp, sp, 32 * wordSize);
}
return generate_oop_map(sasm, save_fpu_registers);
@@ -543,7 +542,7 @@ void Runtime1::generate_unwind_exception(StubAssembler *sasm) {
// Save our return address because
// exception_handler_for_return_address will destroy it. We also
// save exception_oop
- __ addi(sp, sp, -2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ sd(exception_oop, Address(sp, wordSize));
__ sd(ra, Address(sp));
@@ -883,7 +882,13 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
__ ld(x10, Address(sp, (sup_k_off) * VMRegImpl::stack_slot_size)); // super klass
Label miss;
- __ check_klass_subtype_slow_path(x14, x10, x12, x15, nullptr, &miss);
+ __ check_klass_subtype_slow_path(x14, /*sub_klass*/
+ x10, /*super_klass*/
+ x12, /*tmp1_reg*/
+ x15, /*tmp2_reg*/
+ nullptr, /*L_success*/
+ &miss /*L_failure*/);
+ // Need extras for table lookup: x7, x11, x13
// fallthrough on success:
__ mv(t0, 1);
diff --git a/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp b/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp
index 6ed6a1979212d..3436f9f8fc9db 100644
--- a/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/c2_CodeStubs.hpp"
#include "opto/c2_MacroAssembler.hpp"
#include "runtime/objectMonitor.hpp"
diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
index 798804269d4ae..7564df6b861cf 100644
--- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "opto/c2_MacroAssembler.hpp"
@@ -211,16 +210,14 @@ void C2_MacroAssembler::fast_unlock(Register objectReg, Register boxReg,
// Handle existing monitor.
bind(object_has_monitor);
- STATIC_ASSERT(markWord::monitor_value <= INT_MAX);
- add(tmp, tmp, -(int)markWord::monitor_value); // monitor
-
+ subi(tmp, tmp, (int)markWord::monitor_value); // monitor
ld(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset()));
Label notRecursive;
beqz(disp_hdr, notRecursive); // Will be 0 if not recursive.
// Recursive lock
- addi(disp_hdr, disp_hdr, -1);
+ subi(disp_hdr, disp_hdr, 1);
sd(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset()));
j(unlocked);
@@ -537,7 +534,7 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register box,
if (!UseObjectMonitorTable) {
assert(tmp1_monitor == tmp1_mark, "should be the same here");
// Untag the monitor.
- add(tmp1_monitor, tmp1_mark, -(int)markWord::monitor_value);
+ subi(tmp1_monitor, tmp1_mark, (int)markWord::monitor_value);
} else {
ld(tmp1_monitor, Address(box, BasicLock::object_monitor_cache_offset_in_bytes()));
// No valid pointer below alignof(ObjectMonitor*). Take the slow path.
@@ -553,7 +550,7 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register box,
beqz(tmp2_recursions, not_recursive);
// Recursive unlock.
- addi(tmp2_recursions, tmp2_recursions, -1);
+ subi(tmp2_recursions, tmp2_recursions, 1);
sd(tmp2_recursions, Address(tmp1_monitor, ObjectMonitor::recursions_offset()));
j(unlocked);
@@ -732,7 +729,7 @@ void C2_MacroAssembler::string_indexof_char(Register str1, Register cnt1,
BLOCK_COMMENT("string_indexof_char {");
beqz(cnt1, NOMATCH);
- addi(t0, cnt1, isL ? -32 : -16);
+ subi(t0, cnt1, isL ? 32 : 16);
bgtz(t0, DO_LONG);
string_indexof_char_short(str1, cnt1, ch, result, isL);
j(DONE);
@@ -780,7 +777,7 @@ void C2_MacroAssembler::string_indexof_char(Register str1, Register cnt1,
bind(CH1_LOOP);
ld(ch1, Address(str1));
addi(str1, str1, 8);
- addi(cnt1, cnt1, -8);
+ subi(cnt1, cnt1, 8);
compute_match_mask(ch1, ch, match_mask, mask1, mask2);
bnez(match_mask, HIT);
bgtz(cnt1, CH1_LOOP);
@@ -957,7 +954,7 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
const int ASIZE = 256;
const int STORE_BYTES = 8; // 8 bytes stored per instruction(sd)
- sub(sp, sp, ASIZE);
+ subi(sp, sp, ASIZE);
// init BC offset table with default value: needle_len
slli(t0, needle_len, 8);
@@ -976,16 +973,16 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
for (int i = 0; i < 4; i++) {
sd(tmp5, Address(ch1, i * wordSize));
}
- add(ch1, ch1, 32);
- sub(tmp6, tmp6, 4);
+ addi(ch1, ch1, 32);
+ subi(tmp6, tmp6, 4);
bgtz(tmp6, BM_INIT_LOOP);
- sub(nlen_tmp, needle_len, 1); // m - 1, index of the last element in pattern
+ subi(nlen_tmp, needle_len, 1); // m - 1, index of the last element in pattern
Register orig_haystack = tmp5;
mv(orig_haystack, haystack);
// result_tmp = tmp4
shadd(haystack_end, result_tmp, haystack, haystack_end, haystack_chr_shift);
- sub(ch2, needle_len, 1); // bc offset init value, ch2 is t1
+ subi(ch2, needle_len, 1); // bc offset init value, ch2 is t1
mv(tmp3, needle);
// for (i = 0; i < m - 1; ) {
@@ -1000,7 +997,7 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
// }
bind(BCLOOP);
(this->*needle_load_1chr)(ch1, Address(tmp3), noreg);
- add(tmp3, tmp3, needle_chr_size);
+ addi(tmp3, tmp3, needle_chr_size);
if (!needle_isL) {
// ae == StrIntrinsicNode::UU
mv(tmp6, ASIZE);
@@ -1010,7 +1007,7 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
sb(ch2, Address(tmp4)); // store skip offset to BC offset table
bind(BCSKIP);
- sub(ch2, ch2, 1); // for next pattern element, skip distance -1
+ subi(ch2, ch2, 1); // for next pattern element, skip distance -1
bgtz(ch2, BCLOOP);
// tmp6: pattern end, address after needle
@@ -1047,7 +1044,7 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
// compare pattern to source string backward
shadd(result, nlen_tmp, haystack, result, haystack_chr_shift);
(this->*haystack_load_1chr)(skipch, Address(result), noreg);
- sub(nlen_tmp, nlen_tmp, firstStep); // nlen_tmp is positive here, because needle_len >= 8
+ subi(nlen_tmp, nlen_tmp, firstStep); // nlen_tmp is positive here, because needle_len >= 8
if (needle_isL == haystack_isL) {
// re-init tmp3. It's for free because it's executed in parallel with
// load above. Alternative is to initialize it before loop, but it'll
@@ -1066,7 +1063,7 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
if (isLL) {
j(BMLOOPSTR1_AFTER_LOAD);
} else {
- sub(nlen_tmp, nlen_tmp, 1); // no need to branch for UU/UL case. cnt1 >= 8
+ subi(nlen_tmp, nlen_tmp, 1); // no need to branch for UU/UL case. cnt1 >= 8
j(BMLOOPSTR1_CMP);
}
@@ -1077,7 +1074,7 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
(this->*haystack_load_1chr)(ch2, Address(ch2), noreg);
bind(BMLOOPSTR1_AFTER_LOAD);
- sub(nlen_tmp, nlen_tmp, 1);
+ subi(nlen_tmp, nlen_tmp, 1);
bltz(nlen_tmp, BMLOOPSTR1_LASTCMP);
bind(BMLOOPSTR1_CMP);
@@ -1099,11 +1096,11 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
lbu(result_tmp, Address(result_tmp)); // load skip offset
bind(BMADV);
- sub(nlen_tmp, needle_len, 1);
+ subi(nlen_tmp, needle_len, 1);
// move haystack after bad char skip offset
shadd(haystack, result_tmp, haystack, result, haystack_chr_shift);
ble(haystack, haystack_end, BMLOOPSTR2);
- add(sp, sp, ASIZE);
+ addi(sp, sp, ASIZE);
j(NOMATCH);
bind(BMLOOPSTR1_LASTCMP);
@@ -1114,11 +1111,11 @@ void C2_MacroAssembler::string_indexof(Register haystack, Register needle,
if (!haystack_isL) {
srli(result, result, 1);
}
- add(sp, sp, ASIZE);
+ addi(sp, sp, ASIZE);
j(DONE);
bind(LINEARSTUB);
- sub(t0, needle_len, 16); // small patterns still should be handled by simple algorithm
+ subi(t0, needle_len, 16); // small patterns still should be handled by simple algorithm
bltz(t0, LINEARSEARCH);
mv(result, zr);
RuntimeAddress stub = nullptr;
@@ -1197,7 +1194,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
if (needle_con_cnt == -1) {
Label DOSHORT, FIRST_LOOP, STR2_NEXT, STR1_LOOP, STR1_NEXT;
- sub(t0, needle_len, needle_isL == haystack_isL ? 4 : 2);
+ subi(t0, needle_len, needle_isL == haystack_isL ? 4 : 2);
bltz(t0, DOSHORT);
(this->*needle_load_1chr)(first, Address(needle), noreg);
@@ -1214,13 +1211,13 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
beq(first, ch2, STR1_LOOP);
bind(STR2_NEXT);
- add(hlen_neg, hlen_neg, haystack_chr_size);
+ addi(hlen_neg, hlen_neg, haystack_chr_size);
blez(hlen_neg, FIRST_LOOP);
j(NOMATCH);
bind(STR1_LOOP);
- add(nlen_tmp, nlen_neg, needle_chr_size);
- add(hlen_tmp, hlen_neg, haystack_chr_size);
+ addi(nlen_tmp, nlen_neg, needle_chr_size);
+ addi(hlen_tmp, hlen_neg, haystack_chr_size);
bgez(nlen_tmp, MATCH);
bind(STR1_NEXT);
@@ -1229,14 +1226,14 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
add(ch2, haystack, hlen_tmp);
(this->*haystack_load_1chr)(ch2, Address(ch2), noreg);
bne(ch1, ch2, STR2_NEXT);
- add(nlen_tmp, nlen_tmp, needle_chr_size);
- add(hlen_tmp, hlen_tmp, haystack_chr_size);
+ addi(nlen_tmp, nlen_tmp, needle_chr_size);
+ addi(hlen_tmp, hlen_tmp, haystack_chr_size);
bltz(nlen_tmp, STR1_NEXT);
j(MATCH);
bind(DOSHORT);
if (needle_isL == haystack_isL) {
- sub(t0, needle_len, 2);
+ subi(t0, needle_len, 2);
bltz(t0, DO1);
bgtz(t0, DO3);
}
@@ -1245,7 +1242,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
if (needle_con_cnt == 4) {
Label CH1_LOOP;
(this->*load_4chr)(ch1, Address(needle), noreg);
- sub(result_tmp, haystack_len, 4);
+ subi(result_tmp, haystack_len, 4);
slli(tmp3, result_tmp, haystack_chr_shift); // result as tmp
add(haystack, haystack, tmp3);
neg(hlen_neg, tmp3);
@@ -1274,7 +1271,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
(this->*load_4chr)(ch2, Address(tmp3), noreg);
}
beq(ch1, ch2, MATCH);
- add(hlen_neg, hlen_neg, haystack_chr_size);
+ addi(hlen_neg, hlen_neg, haystack_chr_size);
blez(hlen_neg, CH1_LOOP);
j(NOMATCH);
}
@@ -1285,7 +1282,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
bind(DO2);
(this->*load_2chr)(ch1, Address(needle), noreg);
if (needle_con_cnt == 2) {
- sub(result_tmp, haystack_len, 2);
+ subi(result_tmp, haystack_len, 2);
}
slli(tmp3, result_tmp, haystack_chr_shift);
add(haystack, haystack, tmp3);
@@ -1308,7 +1305,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
(this->*load_2chr)(ch2, Address(tmp3), noreg);
}
beq(ch1, ch2, MATCH);
- add(hlen_neg, hlen_neg, haystack_chr_size);
+ addi(hlen_neg, hlen_neg, haystack_chr_size);
blez(hlen_neg, CH1_LOOP);
j(NOMATCH);
BLOCK_COMMENT("} string_indexof DO2");
@@ -1322,7 +1319,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
(this->*load_2chr)(first, Address(needle), noreg);
(this->*needle_load_1chr)(ch1, Address(needle, 2 * needle_chr_size), noreg);
if (needle_con_cnt == 3) {
- sub(result_tmp, haystack_len, 3);
+ subi(result_tmp, haystack_len, 3);
}
slli(hlen_tmp, result_tmp, haystack_chr_shift);
add(haystack, haystack, hlen_tmp);
@@ -1341,12 +1338,12 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
beq(first, ch2, STR1_LOOP);
bind(STR2_NEXT);
- add(hlen_neg, hlen_neg, haystack_chr_size);
+ addi(hlen_neg, hlen_neg, haystack_chr_size);
blez(hlen_neg, FIRST_LOOP);
j(NOMATCH);
bind(STR1_LOOP);
- add(hlen_tmp, hlen_neg, 2 * haystack_chr_size);
+ addi(hlen_tmp, hlen_neg, 2 * haystack_chr_size);
add(ch2, haystack, hlen_tmp);
(this->*haystack_load_1chr)(ch2, Address(ch2), noreg);
bne(ch1, ch2, STR2_NEXT);
@@ -1360,7 +1357,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
BLOCK_COMMENT("string_indexof DO1 {");
bind(DO1);
(this->*needle_load_1chr)(ch1, Address(needle), noreg);
- sub(result_tmp, haystack_len, 1);
+ subi(result_tmp, haystack_len, 1);
slli(tmp3, result_tmp, haystack_chr_shift);
add(haystack, haystack, tmp3);
neg(hlen_neg, tmp3);
@@ -1369,7 +1366,7 @@ void C2_MacroAssembler::string_indexof_linearscan(Register haystack, Register ne
add(tmp3, haystack, hlen_neg);
(this->*haystack_load_1chr)(ch2, Address(tmp3), noreg);
beq(ch1, ch2, MATCH);
- add(hlen_neg, hlen_neg, haystack_chr_size);
+ addi(hlen_neg, hlen_neg, haystack_chr_size);
blez(hlen_neg, DO1_LOOP);
BLOCK_COMMENT("} string_indexof DO1");
}
@@ -1444,7 +1441,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
ld(tmp2, Address(str2));
mv(t0, STUB_THRESHOLD);
bge(cnt2, t0, STUB);
- sub(cnt2, cnt2, minCharsInWord);
+ subi(cnt2, cnt2, minCharsInWord);
beqz(cnt2, TAIL_CHECK);
// convert cnt2 from characters to bytes
if (!str1_isL) {
@@ -1458,7 +1455,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
ld(tmp2, Address(str2));
mv(t0, STUB_THRESHOLD);
bge(cnt2, t0, STUB);
- addi(cnt2, cnt2, -4);
+ subi(cnt2, cnt2, 4);
add(str1, str1, cnt2);
sub(cnt1, zr, cnt2);
slli(cnt2, cnt2, 1);
@@ -1586,13 +1583,13 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
// while comparing previous
(this->*str1_load_chr)(tmp1, Address(str1), t0);
addi(str1, str1, str1_chr_size);
- addi(cnt2, cnt2, -1);
+ subi(cnt2, cnt2, 1);
beqz(cnt2, SHORT_LAST_INIT);
(this->*str2_load_chr)(cnt1, Address(str2), t0);
addi(str2, str2, str2_chr_size);
j(SHORT_LOOP_START);
bind(SHORT_LOOP);
- addi(cnt2, cnt2, -1);
+ subi(cnt2, cnt2, 1);
beqz(cnt2, SHORT_LAST);
bind(SHORT_LOOP_START);
(this->*str1_load_chr)(tmp2, Address(str1), t0);
@@ -1600,7 +1597,7 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,
(this->*str2_load_chr)(t0, Address(str2), t0);
addi(str2, str2, str2_chr_size);
bne(tmp1, cnt1, SHORT_LOOP_TAIL);
- addi(cnt2, cnt2, -1);
+ subi(cnt2, cnt2, 1);
beqz(cnt2, SHORT_LAST2);
(this->*str1_load_chr)(tmp1, Address(str1), t0);
addi(str1, str1, str1_chr_size);
@@ -1635,7 +1632,7 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
assert(elem_size == 1 || elem_size == 2, "must be char or byte");
assert_different_registers(a1, a2, result, tmp1, tmp2, tmp3, t0);
- int elem_per_word = wordSize/elem_size;
+ int elem_per_word = wordSize / elem_size;
int log_elem_size = exact_log2(elem_size);
int length_offset = arrayOopDesc::length_offset_in_bytes();
int base_offset = arrayOopDesc::base_offset_in_bytes(elem_size == 2 ? T_CHAR : T_BYTE);
@@ -1664,14 +1661,14 @@ void C2_MacroAssembler::arrays_equals(Register a1, Register a2,
la(a1, Address(a1, base_offset));
la(a2, Address(a2, base_offset));
// Check for short strings, i.e. smaller than wordSize.
- addi(cnt1, cnt1, -elem_per_word);
+ subi(cnt1, cnt1, elem_per_word);
bltz(cnt1, SHORT);
// Main 8 byte comparison loop.
bind(NEXT_WORD); {
ld(tmp1, Address(a1));
ld(tmp2, Address(a2));
- addi(cnt1, cnt1, -elem_per_word);
+ subi(cnt1, cnt1, elem_per_word);
addi(a1, a1, wordSize);
addi(a2, a2, wordSize);
bne(tmp1, tmp2, DONE);
@@ -1743,14 +1740,14 @@ void C2_MacroAssembler::string_equals(Register a1, Register a2,
mv(result, false);
// Check for short strings, i.e. smaller than wordSize.
- addi(cnt1, cnt1, -wordSize);
+ subi(cnt1, cnt1, wordSize);
bltz(cnt1, SHORT);
// Main 8 byte comparison loop.
bind(NEXT_WORD); {
ld(tmp1, Address(a1));
ld(tmp2, Address(a2));
- addi(cnt1, cnt1, -wordSize);
+ subi(cnt1, cnt1, wordSize);
addi(a1, a1, wordSize);
addi(a2, a2, wordSize);
bne(tmp1, tmp2, DONE);
@@ -1838,7 +1835,7 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
beqz(cnt, DONE);
- andi(chunks, cnt, ~(stride-1));
+ andi(chunks, cnt, ~(stride - 1));
beqz(chunks, TAIL);
mv(pow31_4, 923521); // [31^^4]
@@ -1847,7 +1844,7 @@ void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register res
slli(chunks_end, chunks, chunks_end_shift);
add(chunks_end, ary, chunks_end);
- andi(cnt, cnt, stride-1); // don't forget about tail!
+ andi(cnt, cnt, stride - 1); // don't forget about tail!
bind(WIDE_LOOP);
mulw(result, result, pow31_4); // 31^^4 * h
@@ -2061,7 +2058,7 @@ void C2_MacroAssembler::minmax_fp(FloatRegister dst, FloatRegister src1, FloatRe
is_double ? fclass_d(t1, src2)
: fclass_s(t1, src2);
orr(t0, t0, t1);
- andi(t0, t0, fclass_mask::nan); // if src1 or src2 is quiet or signaling NaN then return NaN
+ andi(t0, t0, FClassBits::nan); // if src1 or src2 is quiet or signaling NaN then return NaN
beqz(t0, Compare);
is_double ? fadd_d(dst, src1, src2)
: fadd_s(dst, src1, src2);
@@ -2155,7 +2152,7 @@ void C2_MacroAssembler::signum_fp(FloatRegister dst, FloatRegister one, bool is_
: fclass_s(t0, dst);
// check if input is -0, +0, signaling NaN or quiet NaN
- andi(t0, t0, fclass_mask::zero | fclass_mask::nan);
+ andi(t0, t0, FClassBits::zero | FClassBits::nan);
bnez(t0, done);
@@ -2371,7 +2368,7 @@ void C2_MacroAssembler::signum_fp_v(VectorRegister dst, VectorRegister one, Basi
// check if input is -0, +0, signaling NaN or quiet NaN
vfclass_v(v0, dst);
- mv(t0, fclass_mask::zero | fclass_mask::nan);
+ mv(t0, FClassBits::zero | FClassBits::nan);
vand_vx(v0, v0, t0);
vmseq_vi(v0, v0, 0);
diff --git a/src/hotspot/cpu/riscv/c2_init_riscv.cpp b/src/hotspot/cpu/riscv/c2_init_riscv.cpp
index cdbd69807bee1..70a024f7f8afc 100644
--- a/src/hotspot/cpu/riscv/c2_init_riscv.cpp
+++ b/src/hotspot/cpu/riscv/c2_init_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
diff --git a/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp b/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp
index e99183a5b5d91..280b3bd54e5ce 100644
--- a/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp
+++ b/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.inline.hpp"
#include "asm/macroAssembler.hpp"
diff --git a/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp b/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp
index a864d7073dcfb..f541ac117eba0 100644
--- a/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp
+++ b/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp
@@ -33,6 +33,6 @@
public:
void flush_bundle(bool start_new_bundle) {}
- static bool supports_shared_stubs() { return false; }
+ static bool supports_shared_stubs() { return true; }
#endif // CPU_RISCV_CODEBUFFER_RISCV_HPP
diff --git a/src/hotspot/cpu/riscv/compiledIC_riscv.cpp b/src/hotspot/cpu/riscv/compiledIC_riscv.cpp
index 65f3aa263aa02..a86e65ab58086 100644
--- a/src/hotspot/cpu/riscv/compiledIC_riscv.cpp
+++ b/src/hotspot/cpu/riscv/compiledIC_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/cpu/riscv/compressedKlass_riscv.cpp b/src/hotspot/cpu/riscv/compressedKlass_riscv.cpp
index 7e596e0a7e99a..a2e732025d539 100644
--- a/src/hotspot/cpu/riscv/compressedKlass_riscv.cpp
+++ b/src/hotspot/cpu/riscv/compressedKlass_riscv.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "oops/compressedKlass.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -31,7 +30,7 @@ char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size
char* result = nullptr;
- // RiscV loads a 64-bit immediate in up to four separate steps, splitting it into four different sections
+ // RISC-V loads a 64-bit immediate in up to four separate steps, splitting it into four different sections
// (two 32-bit sections, each split into two subsections of 20/12 bits).
//
// 63 ....... 44 43 ... 32 31 ....... 12 11 ... 0
@@ -51,11 +50,6 @@ char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size
// with one instruction (2)
result = reserve_address_space_for_unscaled_encoding(size, aslr);
- // Failing that, attempt to reserve for base=zero shift>0
- if (result == nullptr && optimize_for_zero_base) {
- result = reserve_address_space_for_zerobased_encoding(size, aslr);
- }
-
// Failing that, optimize for case (3) - a base with only bits set between [32-44)
if (result == nullptr) {
const uintptr_t from = nth_bit(32);
diff --git a/src/hotspot/cpu/riscv/downcallLinker_riscv.cpp b/src/hotspot/cpu/riscv/downcallLinker_riscv.cpp
index 97b168a98119e..1edb30a36ea78 100644
--- a/src/hotspot/cpu/riscv/downcallLinker_riscv.cpp
+++ b/src/hotspot/cpu/riscv/downcallLinker_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/cpu/riscv/foreignGlobals_riscv.cpp b/src/hotspot/cpu/riscv/foreignGlobals_riscv.cpp
index 2975b088b0c19..339e205c48afe 100644
--- a/src/hotspot/cpu/riscv/foreignGlobals_riscv.cpp
+++ b/src/hotspot/cpu/riscv/foreignGlobals_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/vmreg.inline.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/jniHandles.inline.hpp"
diff --git a/src/hotspot/cpu/riscv/frame_riscv.cpp b/src/hotspot/cpu/riscv/frame_riscv.cpp
index ecc450bd6b254..8ee6d11dcaf39 100644
--- a/src/hotspot/cpu/riscv/frame_riscv.cpp
+++ b/src/hotspot/cpu/riscv/frame_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
@@ -158,6 +157,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
if (Continuation::is_return_barrier_entry(sender_pc)) {
+ // sender_pc might be invalid so check that the frame
+ // actually belongs to a Continuation.
+ if (!Continuation::is_frame_in_continuation(thread, *this)) {
+ return false;
+ }
// If our sender_pc is the return barrier, then our "real" sender is the continuation entry
frame s = Continuation::continuation_bottom_sender(thread, *this, sender_sp);
sender_sp = s.sp();
diff --git a/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp
index 6a3e4f95b9848..ef5dcdd8074a3 100644
--- a/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp
@@ -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.
* Copyright (c) 2020, 2024, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
@@ -106,7 +105,7 @@ static void generate_queue_test_and_insertion(MacroAssembler* masm, ByteSize ind
__ ld(tmp1, Address(thread, in_bytes(index_offset))); // tmp1 := *(index address)
__ beqz(tmp1, runtime); // jump to runtime if index == 0 (full buffer)
// The buffer is not full, store value into it.
- __ sub(tmp1, tmp1, wordSize); // tmp1 := next index
+ __ subi(tmp1, tmp1, wordSize); // tmp1 := next index
__ sd(tmp1, Address(thread, in_bytes(index_offset))); // *(index address) := next index
__ ld(tmp2, Address(thread, in_bytes(buffer_offset))); // tmp2 := buffer address
__ add(tmp2, tmp2, tmp1);
@@ -490,7 +489,7 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ ld(tmp, queue_index);
__ beqz(tmp, runtime);
- __ sub(tmp, tmp, wordSize);
+ __ subi(tmp, tmp, wordSize);
__ sd(tmp, queue_index);
__ ld(t1, buffer);
__ add(tmp, tmp, t1);
@@ -557,7 +556,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
__ ld(t0, queue_index);
__ beqz(t0, runtime);
- __ sub(t0, t0, wordSize);
+ __ subi(t0, t0, wordSize);
__ sd(t0, queue_index);
// Reuse RA to hold buffer_addr
diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
index d96d405aa2282..c49c8406befec 100644
--- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
@@ -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.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp
index 5373704c078a8..39da77181c674 100644
--- a/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nativeInst.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.cpp
index 2ad44400687f2..df7ff65442ef9 100644
--- a/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.cpp
@@ -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.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
@@ -69,7 +68,7 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
__ beqz(count, L_done); // zero count - nothing to do
// end = start + count << LogBytesPerHeapOop
__ shadd(end, count, start, count, LogBytesPerHeapOop);
- __ sub(end, end, BytesPerHeapOop); // last element address to make inclusive
+ __ subi(end, end, BytesPerHeapOop); // last element address to make inclusive
__ srli(start, start, CardTable::card_shift());
__ srli(end, end, CardTable::card_shift());
@@ -81,7 +80,7 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
__ bind(L_loop);
__ add(tmp, start, count);
__ sb(zr, Address(tmp));
- __ sub(count, count, 1);
+ __ subi(count, count, 1);
__ bgez(count, L_loop);
__ bind(L_done);
}
diff --git a/src/hotspot/cpu/riscv/gc/shared/modRefBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/modRefBarrierSetAssembler_riscv.cpp
index f2b0face0a9d3..6b0871007f488 100644
--- a/src/hotspot/cpu/riscv/gc/shared/modRefBarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shared/modRefBarrierSetAssembler_riscv.cpp
@@ -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.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/riscv/gc/shenandoah/c1/shenandoahBarrierSetC1_riscv.cpp b/src/hotspot/cpu/riscv/gc/shenandoah/c1/shenandoahBarrierSetC1_riscv.cpp
index d15b3aa31f905..2a96bd32cf8d7 100644
--- a/src/hotspot/cpu/riscv/gc/shenandoah/c1/shenandoahBarrierSetC1_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shenandoah/c1/shenandoahBarrierSetC1_riscv.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
index 257d445f01187..97b83d78811a8 100644
--- a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
#include "gc/shenandoah/shenandoahForwarding.hpp"
@@ -143,7 +142,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm,
__ ld(tmp1, index); // tmp := *index_adr
__ beqz(tmp1, runtime); // tmp == 0? If yes, goto runtime
- __ sub(tmp1, tmp1, wordSize); // tmp := tmp - wordSize
+ __ subi(tmp1, tmp1, wordSize); // tmp := tmp - wordSize
__ sd(tmp1, index); // *index_adr := tmp
__ ld(tmp2, buffer);
__ add(tmp1, tmp1, tmp2); // tmp := tmp + *buffer_adr
@@ -562,7 +561,7 @@ void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssemb
// end = start + count << LogBytesPerHeapOop
// last element address to make inclusive
__ shadd(end, count, start, tmp, LogBytesPerHeapOop);
- __ sub(end, end, BytesPerHeapOop);
+ __ subi(end, end, BytesPerHeapOop);
__ srli(start, start, CardTable::card_shift());
__ srli(end, end, CardTable::card_shift());
@@ -575,7 +574,7 @@ void ShenandoahBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssemb
__ bind(L_loop);
__ add(tmp, start, count);
__ sb(zr, Address(tmp));
- __ sub(count, count, 1);
+ __ subi(count, count, 1);
__ bgez(count, L_loop);
__ bind(L_done);
}
@@ -690,7 +689,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss
__ ld(tmp, queue_index);
__ beqz(tmp, runtime);
- __ sub(tmp, tmp, wordSize);
+ __ subi(tmp, tmp, wordSize);
__ sd(tmp, queue_index);
__ ld(t1, buffer);
__ add(tmp, tmp, t1);
diff --git a/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp b/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp
index 715f0d8aff7cb..683d892915f50 100644
--- a/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/z/zAddress_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddress.hpp"
@@ -84,7 +83,7 @@ static size_t probe_valid_max_address_bit() {
munmap(result_addr, page_size);
}
}
- log_info_p(gc, init)("Probing address space for the highest valid bit: " SIZE_FORMAT, max_address_bit);
+ log_info_p(gc, init)("Probing address space for the highest valid bit: %zu", max_address_bit);
return MAX2(max_address_bit, MINIMUM_MAX_ADDRESS_BIT);
#else // LINUX
return DEFAULT_MAX_ADDRESS_BIT;
diff --git a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp
index 0b093838b8b68..09dea62b6d18f 100644
--- a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/vmreg.inline.hpp"
@@ -241,7 +240,7 @@ static void store_barrier_buffer_add(MacroAssembler* masm,
__ beqz(tmp2, slow_path);
// Bump the pointer
- __ sub(tmp2, tmp2, sizeof(ZStoreBarrierEntry));
+ __ subi(tmp2, tmp2, sizeof(ZStoreBarrierEntry));
__ sd(tmp2, Address(tmp1, ZStoreBarrierBuffer::current_offset()));
// Compute the buffer entry address
@@ -848,10 +847,10 @@ void ZBarrierSetAssembler::generate_c1_load_barrier_stub(LIR_Assembler* ce,
// Save x10 unless it is the result or tmp register
// Set up SP to accommdate parameters and maybe x10.
if (ref != x10 && tmp != x10) {
- __ sub(sp, sp, 32);
+ __ subi(sp, sp, 32);
__ sd(x10, Address(sp, 16));
} else {
- __ sub(sp, sp, 16);
+ __ subi(sp, sp, 16);
}
// Setup arguments and call runtime stub
@@ -963,7 +962,7 @@ void ZBarrierSetAssembler::generate_c1_store_barrier_stub(LIR_Assembler* ce,
__ la(stub->new_zpointer()->as_register(), ce->as_Address(stub->ref_addr()->as_address_ptr()));
- __ sub(sp, sp, 16);
+ __ subi(sp, sp, 16);
//Setup arguments and call runtime stub
assert(stub->new_zpointer()->is_valid(), "invariant");
ce->store_parameter(stub->new_zpointer()->as_register(), 0);
diff --git a/src/hotspot/cpu/riscv/globals_riscv.hpp b/src/hotspot/cpu/riscv/globals_riscv.hpp
index 806cca16269ea..a70dedd1ef79b 100644
--- a/src/hotspot/cpu/riscv/globals_riscv.hpp
+++ b/src/hotspot/cpu/riscv/globals_riscv.hpp
@@ -104,6 +104,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
product(bool, UseZbb, false, DIAGNOSTIC, "Use Zbb instructions") \
product(bool, UseZbs, false, DIAGNOSTIC, "Use Zbs instructions") \
product(bool, UseZfh, false, DIAGNOSTIC, "Use Zfh instructions") \
+ product(bool, UseZfhmin, false, DIAGNOSTIC, "Use Zfhmin instructions") \
product(bool, UseZacas, false, EXPERIMENTAL, "Use Zacas instructions") \
product(bool, UseZcb, false, EXPERIMENTAL, "Use Zcb instructions") \
product(bool, UseZic64b, false, EXPERIMENTAL, "Use Zic64b instructions") \
diff --git a/src/hotspot/cpu/riscv/icache_riscv.cpp b/src/hotspot/cpu/riscv/icache_riscv.cpp
index d615dcfb9e9ae..258bc665770fd 100644
--- a/src/hotspot/cpu/riscv/icache_riscv.cpp
+++ b/src/hotspot/cpu/riscv/icache_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2023, Rivos Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "riscv_flush_icache.hpp"
#include "runtime/java.hpp"
diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp
index e17a3765b50ec..c132f9cda7a08 100644
--- a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp
+++ b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
@@ -270,18 +269,18 @@ void InterpreterMacroAssembler::pop_l(Register r) {
}
void InterpreterMacroAssembler::push_ptr(Register r) {
- addi(esp, esp, -wordSize);
+ subi(esp, esp, wordSize);
sd(r, Address(esp, 0));
}
void InterpreterMacroAssembler::push_i(Register r) {
- addi(esp, esp, -wordSize);
+ subi(esp, esp, wordSize);
sext(r, r, 32);
sd(r, Address(esp, 0));
}
void InterpreterMacroAssembler::push_l(Register r) {
- addi(esp, esp, -2 * wordSize);
+ subi(esp, esp, 2 * wordSize);
sd(zr, Address(esp, wordSize));
sd(r, Address(esp));
}
@@ -297,12 +296,12 @@ void InterpreterMacroAssembler::pop_d(FloatRegister r) {
}
void InterpreterMacroAssembler::push_f(FloatRegister r) {
- addi(esp, esp, -wordSize);
+ subi(esp, esp, wordSize);
fsw(r, Address(esp, 0));
}
void InterpreterMacroAssembler::push_d(FloatRegister r) {
- addi(esp, esp, -2 * wordSize);
+ subi(esp, esp, 2 * wordSize);
fsd(r, Address(esp, 0));
}
@@ -544,7 +543,7 @@ void InterpreterMacroAssembler::remove_activation(
// get method access flags
ld(x11, Address(fp, frame::interpreter_frame_method_offset * wordSize));
- ld(x12, Address(x11, Method::access_flags_offset()));
+ load_unsigned_short(x12, Address(x11, Method::access_flags_offset()));
test_bit(t0, x12, exact_log2(JVM_ACC_SYNCHRONIZED));
beqz(t0, unlocked);
@@ -895,7 +894,7 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
assert(ProfileInterpreter, "must be profiling interpreter");
#ifdef ASSERT
Label verify_continue;
- add(sp, sp, -4 * wordSize);
+ subi(sp, sp, 4 * wordSize);
sd(x10, Address(sp, 0));
sd(x11, Address(sp, wordSize));
sd(x12, Address(sp, 2 * wordSize));
@@ -920,7 +919,7 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
ld(x11, Address(sp, wordSize));
ld(x12, Address(sp, 2 * wordSize));
ld(x13, Address(sp, 3 * wordSize));
- add(sp, sp, 4 * wordSize);
+ addi(sp, sp, 4 * wordSize);
#endif // ASSERT
}
@@ -961,7 +960,7 @@ void InterpreterMacroAssembler::increment_mdp_data_at(Register mdp_in,
if (decrement) {
ld(t0, addr);
- addi(t0, t0, -DataLayout::counter_increment);
+ subi(t0, t0, DataLayout::counter_increment);
Label L;
bltz(t0, L); // skip store if counter underflow
sd(t0, addr);
@@ -1028,7 +1027,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in,
void InterpreterMacroAssembler::update_mdp_by_constant(Register mdp_in,
int constant) {
assert(ProfileInterpreter, "must be profiling interpreter");
- addi(mdp_in, mdp_in, (unsigned)constant);
+ add(mdp_in, mdp_in, (unsigned)constant);
sd(mdp_in, Address(fp, frame::interpreter_frame_mdp_offset * wordSize));
}
@@ -1037,7 +1036,7 @@ void InterpreterMacroAssembler::update_mdp_for_ret(Register return_bci) {
assert(ProfileInterpreter, "must be profiling interpreter");
// save/restore across call_VM
- addi(sp, sp, -2 * wordSize);
+ subi(sp, sp, 2 * wordSize);
sd(zr, Address(sp, 0));
sd(return_bci, Address(sp, wordSize));
call_VM(noreg,
@@ -1739,7 +1738,7 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
add(t0, mdp, t0);
ld(t0, Address(t0));
sub(tmp, tmp, t0);
- addi(tmp, tmp, -1);
+ subi(tmp, tmp, 1);
Address arg_addr = argument_address(tmp);
ld(tmp, arg_addr);
@@ -1762,7 +1761,7 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
if (MethodData::profile_return()) {
ld(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())));
- addi(tmp, tmp, -TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
+ sub(tmp, tmp, TypeProfileArgsLimit * TypeStackSlotEntries::per_arg_count());
}
add(t0, mdp, off_to_args);
@@ -1849,7 +1848,7 @@ void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register t
// mdo start + parameters offset + array length - 1
add(mdp, mdp, tmp1);
ld(tmp1, Address(mdp, ArrayData::array_len_offset()));
- add(tmp1, tmp1, - TypeStackSlotEntries::per_arg_count());
+ subi(tmp1, tmp1, TypeStackSlotEntries::per_arg_count());
Label loop;
bind(loop);
@@ -1875,7 +1874,7 @@ void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register t
profile_obj_type(tmp2, arg_type, tmp3);
// go to next parameter
- add(tmp1, tmp1, - TypeStackSlotEntries::per_arg_count());
+ subi(tmp1, tmp1, TypeStackSlotEntries::per_arg_count());
bgez(tmp1, loop);
bind(profile_continue);
@@ -1890,7 +1889,7 @@ void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Registe
ld(cache, Address(xcpool, in_bytes(ConstantPoolCache::invokedynamic_entries_offset())));
// Scale the index to be the entry index * sizeof(ResolvedIndyEntry)
slli(index, index, log2i_exact(sizeof(ResolvedIndyEntry)));
- add(cache, cache, Array::base_offset_in_bytes());
+ addi(cache, cache, Array::base_offset_in_bytes());
add(cache, cache, index);
}
@@ -1906,7 +1905,7 @@ void InterpreterMacroAssembler::load_field_entry(Register cache, Register index,
}
// Get address of field entries array
ld(cache, Address(xcpool, ConstantPoolCache::field_entries_offset()));
- add(cache, cache, Array::base_offset_in_bytes());
+ addi(cache, cache, Array::base_offset_in_bytes());
add(cache, cache, index);
// Prevents stale data from being read after the bytecode is patched to the fast bytecode
membar(MacroAssembler::LoadLoad);
@@ -1932,7 +1931,7 @@ void InterpreterMacroAssembler::load_method_entry(Register cache, Register index
// Get address of field entries array
ld(cache, Address(xcpool, ConstantPoolCache::method_entries_offset()));
- add(cache, cache, Array::base_offset_in_bytes());
+ addi(cache, cache, Array::base_offset_in_bytes());
add(cache, cache, index);
}
diff --git a/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp b/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp
index de34d84fecb00..c8e488d9d6919 100644
--- a/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp
+++ b/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
@@ -138,10 +137,10 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
Register reg = next_gpr();
if (reg == c_rarg1) {
assert(offset() == 0, "argument register 1 can only be (non-null) receiver");
- __ addi(c_rarg1, from(), Interpreter::local_offset_in_bytes(offset()));
+ __ add(c_rarg1, from(), Interpreter::local_offset_in_bytes(offset()));
} else if (reg != noreg) {
// c_rarg2-c_rarg7
- __ addi(x10, from(), Interpreter::local_offset_in_bytes(offset()));
+ __ add(x10, from(), Interpreter::local_offset_in_bytes(offset()));
__ mv(reg, zr); //_num_reg_int_args:c_rarg -> 1:c_rarg2, 2:c_rarg3...
__ ld(temp(), x10);
Label L;
@@ -150,7 +149,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
__ bind(L);
} else {
//to stack
- __ addi(x10, from(), Interpreter::local_offset_in_bytes(offset()));
+ __ add(x10, from(), Interpreter::local_offset_in_bytes(offset()));
__ ld(temp(), x10);
Label L;
__ bnez(temp(), L);
diff --git a/src/hotspot/cpu/riscv/jniFastGetField_riscv.cpp b/src/hotspot/cpu/riscv/jniFastGetField_riscv.cpp
index 648a665fef5aa..b08e520393ab8 100644
--- a/src/hotspot/cpu/riscv/jniFastGetField_riscv.cpp
+++ b/src/hotspot/cpu/riscv/jniFastGetField_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/riscv/jvmciCodeInstaller_riscv.cpp b/src/hotspot/cpu/riscv/jvmciCodeInstaller_riscv.cpp
index 1c06d0b29aa6d..cbe387eed148c 100644
--- a/src/hotspot/cpu/riscv/jvmciCodeInstaller_riscv.cpp
+++ b/src/hotspot/cpu/riscv/jvmciCodeInstaller_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "jvmci/jvmci.hpp"
#include "jvmci/jvmciCodeInstaller.hpp"
diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
index 804407fd80e68..50b9f8616e7ac 100644
--- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2024, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "code/compiledIC.hpp"
@@ -245,7 +244,7 @@ void MacroAssembler::inc_held_monitor_count(Register tmp) {
void MacroAssembler::dec_held_monitor_count(Register tmp) {
Address dst(xthread, JavaThread::held_monitor_count_offset());
ld(tmp, dst);
- addi(tmp, tmp, -1);
+ subi(tmp, tmp, 1);
sd(tmp, dst);
#ifdef ASSERT
Label ok;
@@ -1333,22 +1332,11 @@ void MacroAssembler::cmov_gtu(Register cmp1, Register cmp2, Register dst, Regist
#undef INSN
-
-#define INSN(NAME, CSR) \
- void MacroAssembler::NAME(Register Rd) { \
- csrr(Rd, CSR); \
- }
-
- INSN(rdinstret, CSR_INSTRET);
- INSN(rdcycle, CSR_CYCLE);
- INSN(rdtime, CSR_TIME);
- INSN(frcsr, CSR_FCSR);
- INSN(frrm, CSR_FRM);
- INSN(frflags, CSR_FFLAGS);
-
-#undef INSN
-
void MacroAssembler::csrr(Register Rd, unsigned csr) {
+ // These three are specified in zicntr and are unused.
+ // Before adding use-cases add the appropriate hwprobe and flag.
+ assert(csr != CSR_INSTRET && csr != CSR_CYCLE && csr != CSR_TIME,
+ "Not intended for use without enabling zicntr.");
csrrs(Rd, csr, x0);
}
@@ -1430,7 +1418,7 @@ void MacroAssembler::restore_cpu_control_state_after_jni(Register tmp) {
void MacroAssembler::push_reg(Register Rs)
{
- addi(esp, esp, 0 - wordSize);
+ subi(esp, esp, wordSize);
sd(Rs, Address(esp, 0));
}
@@ -1462,7 +1450,7 @@ int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
int offset = is_even(count) ? 0 : wordSize;
if (count) {
- addi(stack, stack, -count * wordSize - offset);
+ sub(stack, stack, count * wordSize + offset);
}
for (int i = count - 1; i >= 0; i--) {
sd(as_Register(regs[i]), Address(stack, (count - 1 - i) * wordSize + offset));
@@ -1487,7 +1475,7 @@ int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
}
if (count) {
- addi(stack, stack, count * wordSize + offset);
+ add(stack, stack, count * wordSize + offset);
}
assert(words_popped == count, "oops, popped != count");
@@ -1503,7 +1491,7 @@ int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
int push_slots = count + (count & 1);
if (count) {
- addi(stack, stack, -push_slots * wordSize);
+ subi(stack, stack, push_slots * wordSize);
}
for (int i = count - 1; i >= 0; i--) {
@@ -1632,7 +1620,7 @@ void MacroAssembler::vector_update_crc32(Register crc, Register buf, Register le
Label VectorLoop;
Label LastBlock;
- add(tableN16, table3, 1*single_table_size*sizeof(juint), tmp1);
+ add(tableN16, table3, 1 * single_table_size * sizeof(juint), tmp1);
mv(tmp5, 0xff);
if (MaxVectorSize == 16) {
@@ -1651,7 +1639,7 @@ void MacroAssembler::vector_update_crc32(Register crc, Register buf, Register le
srli(blks, len, 6);
slli(t1, blks, 6);
sub(len, len, t1);
- sub(blks, blks, 1);
+ subi(blks, blks, 1);
blez(blks, LastBlock);
bind(VectorLoop);
@@ -1683,7 +1671,7 @@ void MacroAssembler::vector_update_crc32(Register crc, Register buf, Register le
addi(tmp1, tmp1, 1);
}
- sub(blks, blks, 1);
+ subi(blks, blks, 1);
bgtz(blks, VectorLoop);
}
@@ -2046,7 +2034,7 @@ void MacroAssembler::kernel_crc32_vclmul_fold(Register crc, Register buf, Regist
Register vclmul_table = tmp3;
la(vclmul_table, table_addr);
- add(vclmul_table, vclmul_table, table_num*single_table_size*sizeof(juint), tmp1);
+ add(vclmul_table, vclmul_table, table_num * single_table_size * sizeof(juint), tmp1);
la(table0, table_addr);
if (MaxVectorSize == 16) {
@@ -2092,25 +2080,25 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len,
const ExternalAddress table_addr = StubRoutines::crc_table_addr();
la(table0, table_addr);
- add(table1, table0, 1*single_table_size*sizeof(juint), tmp1);
- add(table2, table0, 2*single_table_size*sizeof(juint), tmp1);
- add(table3, table2, 1*single_table_size*sizeof(juint), tmp1);
+ add(table1, table0, 1 * single_table_size * sizeof(juint), tmp1);
+ add(table2, table0, 2 * single_table_size * sizeof(juint), tmp1);
+ add(table3, table2, 1 * single_table_size * sizeof(juint), tmp1);
// Ensure basic 4-byte alignment of input byte buffer
mv(tmp1, 4);
blt(len, tmp1, L_by1_loop);
test_bit(tmp1, buf, 0);
beqz(tmp1, L_skip1);
- subw(len, len, 1);
+ subiw(len, len, 1);
lbu(tmp1, Address(buf));
- add(buf, buf, 1);
+ addi(buf, buf, 1);
update_byte_crc32(crc, tmp1, table0);
bind(L_skip1);
test_bit(tmp1, buf, 1);
beqz(tmp1, L_skip2);
- subw(len, len, 2);
+ subiw(len, len, 2);
lhu(tmp1, Address(buf));
- add(buf, buf, 2);
+ addi(buf, buf, 2);
zext(tmp2, tmp1, 8);
update_byte_crc32(crc, tmp2, table0);
srli(tmp2, tmp1, 8);
@@ -2134,8 +2122,8 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len,
align(CodeEntryAlignment);
// Entry for L_unroll_loop
- add(loop_buf_end, buf, len); // loop_buf_end will be used as endpoint for loop below
- andi(len, len, unroll_words-1); // len = (len % unroll_words)
+ add(loop_buf_end, buf, len); // loop_buf_end will be used as endpoint for loop below
+ andi(len, len, unroll_words - 1); // len = (len % unroll_words)
sub(loop_buf_end, loop_buf_end, len);
bind(L_unroll_loop);
for (int i = 0; i < unroll; i++) {
@@ -2162,17 +2150,17 @@ void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len,
bind(L_by1_loop);
beqz(len, L_exit);
- subw(len, len, 1);
+ subiw(len, len, 1);
lbu(tmp1, Address(buf));
update_byte_crc32(crc, tmp1, table0);
beqz(len, L_exit);
- subw(len, len, 1);
+ subiw(len, len, 1);
lbu(tmp1, Address(buf, 1));
update_byte_crc32(crc, tmp1, table0);
beqz(len, L_exit);
- subw(len, len, 1);
+ subiw(len, len, 1);
lbu(tmp1, Address(buf, 2));
update_byte_crc32(crc, tmp1, table0);
@@ -2238,7 +2226,7 @@ void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
push_reg(RegSet::of(x7) + RegSet::range(x10, x17) + RegSet::range(x28, x31) - exclude, sp);
// Push float registers f0-f7, f10-f17, f28-f31.
- addi(sp, sp, - wordSize * 20);
+ subi(sp, sp, wordSize * 20);
int offset = 0;
for (int i = 0; i < 32; i++) {
if (i <= f7->encoding() || i >= f28->encoding() || (i >= f10->encoding() && i <= f17->encoding())) {
@@ -2264,7 +2252,7 @@ void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes)
push_reg(RegSet::range(x5, x31), sp);
// float registers
- addi(sp, sp, - 32 * wordSize);
+ subi(sp, sp, 32 * wordSize);
for (int i = 0; i < 32; i++) {
fsd(as_FloatRegister(i), Address(sp, i * wordSize));
}
@@ -2605,32 +2593,32 @@ void MacroAssembler::movptr2(Register Rd, uint64_t addr, int32_t &offset, Regist
offset = lower12;
}
-void MacroAssembler::add(Register Rd, Register Rn, int64_t increment, Register temp) {
+void MacroAssembler::add(Register Rd, Register Rn, int64_t increment, Register tmp) {
if (is_simm12(increment)) {
addi(Rd, Rn, increment);
} else {
- assert_different_registers(Rn, temp);
- li(temp, increment);
- add(Rd, Rn, temp);
+ assert_different_registers(Rn, tmp);
+ mv(tmp, increment);
+ add(Rd, Rn, tmp);
}
}
-void MacroAssembler::addw(Register Rd, Register Rn, int32_t increment, Register temp) {
+void MacroAssembler::sub(Register Rd, Register Rn, int64_t decrement, Register tmp) {
+ add(Rd, Rn, -decrement, tmp);
+}
+
+void MacroAssembler::addw(Register Rd, Register Rn, int64_t increment, Register tmp) {
if (is_simm12(increment)) {
addiw(Rd, Rn, increment);
} else {
- assert_different_registers(Rn, temp);
- li(temp, increment);
- addw(Rd, Rn, temp);
+ assert_different_registers(Rn, tmp);
+ mv(tmp, increment);
+ addw(Rd, Rn, tmp);
}
}
-void MacroAssembler::sub(Register Rd, Register Rn, int64_t decrement, Register temp) {
- add(Rd, Rn, -decrement, temp);
-}
-
-void MacroAssembler::subw(Register Rd, Register Rn, int32_t decrement, Register temp) {
- addw(Rd, Rn, -decrement, temp);
+void MacroAssembler::subw(Register Rd, Register Rn, int64_t decrement, Register tmp) {
+ addw(Rd, Rn, -decrement, tmp);
}
void MacroAssembler::andrw(Register Rd, Register Rs1, Register Rs2) {
@@ -2870,7 +2858,25 @@ void MacroAssembler::revb(Register Rd, Register Rs, Register tmp1, Register tmp2
}
// rotate right with shift bits
-void MacroAssembler::ror_imm(Register dst, Register src, uint32_t shift, Register tmp)
+void MacroAssembler::ror(Register dst, Register src, Register shift, Register tmp)
+{
+ if (UseZbb) {
+ rorr(dst, src, shift);
+ return;
+ }
+
+ assert_different_registers(dst, tmp);
+ assert_different_registers(src, tmp);
+
+ mv(tmp, 64);
+ sub(tmp, tmp, shift);
+ sll(tmp, src, tmp);
+ srl(dst, src, shift);
+ orr(dst, dst, tmp);
+}
+
+// rotate right with shift bits
+void MacroAssembler::ror(Register dst, Register src, uint32_t shift, Register tmp)
{
if (UseZbb) {
rori(dst, src, shift);
@@ -2886,7 +2892,7 @@ void MacroAssembler::ror_imm(Register dst, Register src, uint32_t shift, Registe
}
// rotate left with shift bits, 32-bit version
-void MacroAssembler::rolw_imm(Register dst, Register src, uint32_t shift, Register tmp) {
+void MacroAssembler::rolw(Register dst, Register src, uint32_t shift, Register tmp) {
if (UseZbb) {
// no roliw available
roriw(dst, src, 32 - shift);
@@ -2901,16 +2907,6 @@ void MacroAssembler::rolw_imm(Register dst, Register src, uint32_t shift, Regist
orr(dst, dst, tmp);
}
-void MacroAssembler::andi(Register Rd, Register Rn, int64_t imm, Register tmp) {
- if (is_simm12(imm)) {
- and_imm12(Rd, Rn, imm);
- } else {
- assert_different_registers(Rn, tmp);
- mv(tmp, imm);
- andr(Rd, Rn, tmp);
- }
-}
-
void MacroAssembler::orptr(Address adr, RegisterOrConstant src, Register tmp1, Register tmp2) {
ld(tmp1, adr);
if (src.is_register()) {
@@ -4077,12 +4073,10 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
Label* L_failure,
Label* L_slow_path,
Register super_check_offset) {
- assert_different_registers(sub_klass, super_klass, tmp_reg);
- bool must_load_sco = (super_check_offset == noreg);
+ assert_different_registers(sub_klass, super_klass, tmp_reg, super_check_offset);
+ bool must_load_sco = !super_check_offset->is_valid();
if (must_load_sco) {
assert(tmp_reg != noreg, "supply either a temp or a register offset");
- } else {
- assert_different_registers(sub_klass, super_klass, super_check_offset);
}
Label L_fallthrough;
@@ -4118,6 +4112,7 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
add(t0, sub_klass, super_check_offset);
Address super_check_addr(t0);
ld(t0, super_check_addr); // load displayed supertype
+ beq(super_klass, t0, *L_success);
// This check has worked decisively for primary supers.
// Secondary supers are sought in the super_cache ('super_cache_addr').
@@ -4130,7 +4125,6 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass,
// So if it was a primary super, we can just fail immediately.
// Otherwise, it's the slow path for us (no success at this point).
- beq(super_klass, t0, *L_success);
mv(t1, sc_offset);
if (L_failure == &L_fallthrough) {
beq(super_check_offset, t1, *L_slow_path);
@@ -4153,18 +4147,19 @@ void MacroAssembler::repne_scan(Register addr, Register value, Register count,
bind(Lloop);
ld(tmp, addr);
beq(value, tmp, Lexit);
- add(addr, addr, wordSize);
- sub(count, count, 1);
+ addi(addr, addr, wordSize);
+ subi(count, count, 1);
bnez(count, Lloop);
bind(Lexit);
}
-void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
- Register super_klass,
- Register tmp1_reg,
- Register tmp2_reg,
- Label* L_success,
- Label* L_failure) {
+void MacroAssembler::check_klass_subtype_slow_path_linear(Register sub_klass,
+ Register super_klass,
+ Register tmp1_reg,
+ Register tmp2_reg,
+ Label* L_success,
+ Label* L_failure,
+ bool set_cond_codes) {
assert_different_registers(sub_klass, super_klass, tmp1_reg);
if (tmp2_reg != noreg) {
assert_different_registers(sub_klass, super_klass, tmp1_reg, tmp2_reg, t0);
@@ -4222,7 +4217,7 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
// Load the array length.
lwu(x12, Address(x15, Array::length_offset_in_bytes()));
// Skip to start of data.
- add(x15, x15, Array::base_offset_in_bytes());
+ addi(x15, x15, Array::base_offset_in_bytes());
// Set t0 to an obvious invalid value, falling through by default
mv(t0, -1);
@@ -4238,7 +4233,9 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
bne(t1, t0, *L_failure);
// Success. Cache the super we found an proceed in triumph.
- sd(super_klass, super_cache_addr);
+ if (UseSecondarySupersCache) {
+ sd(super_klass, super_cache_addr);
+ }
if (L_success != &L_fallthrough) {
j(*L_success);
@@ -4279,6 +4276,103 @@ void MacroAssembler::population_count(Register dst, Register src,
}
}
+// If Register r is invalid, remove a new register from
+// available_regs, and add new register to regs_to_push.
+Register MacroAssembler::allocate_if_noreg(Register r,
+ RegSetIterator &available_regs,
+ RegSet ®s_to_push) {
+ if (!r->is_valid()) {
+ r = *available_regs++;
+ regs_to_push += r;
+ }
+ return r;
+}
+
+// check_klass_subtype_slow_path_table() looks for super_klass in the
+// hash table belonging to super_klass, branching to L_success or
+// L_failure as appropriate. This is essentially a shim which
+// allocates registers as necessary then calls
+// lookup_secondary_supers_table() to do the work. Any of the tmp
+// regs may be noreg, in which case this logic will chooses some
+// registers push and pop them from the stack.
+void MacroAssembler::check_klass_subtype_slow_path_table(Register sub_klass,
+ Register super_klass,
+ Register tmp1_reg,
+ Register tmp2_reg,
+ Label* L_success,
+ Label* L_failure,
+ bool set_cond_codes) {
+ RegSet tmps = RegSet::of(tmp1_reg, tmp2_reg);
+
+ assert_different_registers(sub_klass, super_klass, tmp1_reg, tmp2_reg);
+
+ Label L_fallthrough;
+ int label_nulls = 0;
+ if (L_success == nullptr) { L_success = &L_fallthrough; label_nulls++; }
+ if (L_failure == nullptr) { L_failure = &L_fallthrough; label_nulls++; }
+ assert(label_nulls <= 1, "at most one null in the batch");
+
+ BLOCK_COMMENT("check_klass_subtype_slow_path");
+
+ RegSet caller_save_regs = RegSet::of(x7) + RegSet::range(x10, x17) + RegSet::range(x28, x31);
+ RegSetIterator available_regs = (caller_save_regs - tmps - sub_klass - super_klass).begin();
+
+ RegSet pushed_regs;
+
+ tmp1_reg = allocate_if_noreg(tmp1_reg, available_regs, pushed_regs);
+ tmp2_reg = allocate_if_noreg(tmp2_reg, available_regs, pushed_regs);
+
+ Register tmp3_reg = noreg, tmp4_reg = noreg, result_reg = noreg;
+
+ tmp3_reg = allocate_if_noreg(tmp3_reg, available_regs, pushed_regs);
+ tmp4_reg = allocate_if_noreg(tmp4_reg, available_regs, pushed_regs);
+ result_reg = allocate_if_noreg(result_reg, available_regs, pushed_regs);
+
+ push_reg(pushed_regs, sp);
+
+ lookup_secondary_supers_table_var(sub_klass,
+ super_klass,
+ result_reg,
+ tmp1_reg, tmp2_reg, tmp3_reg,
+ tmp4_reg, nullptr);
+
+ // Move the result to t1 as we are about to unspill the tmp registers.
+ mv(t1, result_reg);
+
+ // Unspill the tmp. registers:
+ pop_reg(pushed_regs, sp);
+
+ // NB! Callers may assume that, when set_cond_codes is true, this
+ // code sets tmp2_reg to a nonzero value.
+ if (set_cond_codes) {
+ mv(tmp2_reg, 1);
+ }
+
+ bnez(t1, *L_failure);
+
+ if (L_success != &L_fallthrough) {
+ j(*L_success);
+ }
+
+ bind(L_fallthrough);
+}
+
+void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
+ Register super_klass,
+ Register tmp1_reg,
+ Register tmp2_reg,
+ Label* L_success,
+ Label* L_failure,
+ bool set_cond_codes) {
+ if (UseSecondarySupersTable) {
+ check_klass_subtype_slow_path_table
+ (sub_klass, super_klass, tmp1_reg, tmp2_reg, L_success, L_failure, set_cond_codes);
+ } else {
+ check_klass_subtype_slow_path_linear
+ (sub_klass, super_klass, tmp1_reg, tmp2_reg, L_success, L_failure, set_cond_codes);
+ }
+}
+
// Ensure that the inline code and the stub are using the same registers
// as we need to call the stub from inline code when there is a collision
// in the hashed lookup in the secondary supers array.
@@ -4294,17 +4388,16 @@ do {
(r_bitmap == x16 || r_bitmap == noreg), "registers must match riscv.ad"); \
} while(0)
-// Return true: we succeeded in generating this code
-bool MacroAssembler::lookup_secondary_supers_table(Register r_sub_klass,
- Register r_super_klass,
- Register result,
- Register tmp1,
- Register tmp2,
- Register tmp3,
- Register tmp4,
- u1 super_klass_slot,
- bool stub_is_near) {
- assert_different_registers(r_sub_klass, r_super_klass, result, tmp1, tmp2, tmp3, tmp4, t0);
+bool MacroAssembler::lookup_secondary_supers_table_const(Register r_sub_klass,
+ Register r_super_klass,
+ Register result,
+ Register tmp1,
+ Register tmp2,
+ Register tmp3,
+ Register tmp4,
+ u1 super_klass_slot,
+ bool stub_is_near) {
+ assert_different_registers(r_sub_klass, r_super_klass, result, tmp1, tmp2, tmp3, tmp4, t0, t1);
Label L_fallthrough;
@@ -4359,7 +4452,7 @@ bool MacroAssembler::lookup_secondary_supers_table(Register r_sub_klass,
// Linear probe.
if (bit != 0) {
- ror_imm(r_bitmap, r_bitmap, bit);
+ ror(r_bitmap, r_bitmap, bit);
}
// The slot we just inspected is at secondary_supers[r_array_index - 1].
@@ -4379,6 +4472,98 @@ bool MacroAssembler::lookup_secondary_supers_table(Register r_sub_klass,
return true;
}
+// At runtime, return 0 in result if r_super_klass is a superclass of
+// r_sub_klass, otherwise return nonzero. Use this version of
+// lookup_secondary_supers_table() if you don't know ahead of time
+// which superclass will be searched for. Used by interpreter and
+// runtime stubs. It is larger and has somewhat greater latency than
+// the version above, which takes a constant super_klass_slot.
+void MacroAssembler::lookup_secondary_supers_table_var(Register r_sub_klass,
+ Register r_super_klass,
+ Register result,
+ Register tmp1,
+ Register tmp2,
+ Register tmp3,
+ Register tmp4,
+ Label *L_success) {
+ assert_different_registers(r_sub_klass, r_super_klass, result, tmp1, tmp2, tmp3, tmp4, t0, t1);
+
+ Label L_fallthrough;
+
+ BLOCK_COMMENT("lookup_secondary_supers_table {");
+
+ const Register
+ r_array_index = tmp3,
+ r_bitmap = tmp4,
+ slot = t1;
+
+ lbu(slot, Address(r_super_klass, Klass::hash_slot_offset()));
+
+ // Make sure that result is nonzero if the test below misses.
+ mv(result, 1);
+
+ ld(r_bitmap, Address(r_sub_klass, Klass::secondary_supers_bitmap_offset()));
+
+ // First check the bitmap to see if super_klass might be present. If
+ // the bit is zero, we are certain that super_klass is not one of
+ // the secondary supers.
+
+ // This next instruction is equivalent to:
+ // mv(tmp_reg, (u1)(Klass::SECONDARY_SUPERS_TABLE_SIZE - 1));
+ // sub(r_array_index, slot, tmp_reg);
+ xori(r_array_index, slot, (u1)(Klass::SECONDARY_SUPERS_TABLE_SIZE - 1));
+ sll(r_array_index, r_bitmap, r_array_index);
+ test_bit(t0, r_array_index, Klass::SECONDARY_SUPERS_TABLE_SIZE - 1);
+ beqz(t0, L_fallthrough);
+
+ // Get the first array index that can contain super_klass into r_array_index.
+ population_count(r_array_index, r_array_index, tmp1, tmp2);
+
+ // NB! r_array_index is off by 1. It is compensated by keeping r_array_base off by 1 word.
+
+ const Register
+ r_array_base = tmp1,
+ r_array_length = tmp2;
+
+ // The value i in r_array_index is >= 1, so even though r_array_base
+ // points to the length, we don't need to adjust it to point to the data.
+ assert(Array::base_offset_in_bytes() == wordSize, "Adjust this code");
+ assert(Array::length_offset_in_bytes() == 0, "Adjust this code");
+
+ // We will consult the secondary-super array.
+ ld(r_array_base, Address(r_sub_klass, in_bytes(Klass::secondary_supers_offset())));
+
+ shadd(result, r_array_index, r_array_base, result, LogBytesPerWord);
+ ld(result, Address(result));
+ xorr(result, result, r_super_klass);
+ beqz(result, L_success ? *L_success : L_fallthrough); // Found a match
+
+ // Is there another entry to check? Consult the bitmap.
+ ror(r_bitmap, r_bitmap, slot);
+ test_bit(t0, r_bitmap, 1);
+ beqz(t0, L_fallthrough);
+
+ // The slot we just inspected is at secondary_supers[r_array_index - 1].
+ // The next slot to be inspected, by the logic we're about to call,
+ // is secondary_supers[r_array_index]. Bits 0 and 1 in the bitmap
+ // have been checked.
+ lookup_secondary_supers_table_slow_path(r_super_klass, r_array_base, r_array_index,
+ r_bitmap, result, r_array_length, false /*is_stub*/);
+
+ BLOCK_COMMENT("} lookup_secondary_supers_table");
+
+ bind(L_fallthrough);
+
+ if (VerifySecondarySupers) {
+ verify_secondary_supers_table(r_sub_klass, r_super_klass,
+ result, tmp1, tmp2, tmp3);
+ }
+
+ if (L_success) {
+ beqz(result, *L_success);
+ }
+}
+
// Called by code generated by check_klass_subtype_slow_path
// above. This is called when there is a collision in the hashed
// lookup in the secondary supers array.
@@ -4387,15 +4572,18 @@ void MacroAssembler::lookup_secondary_supers_table_slow_path(Register r_super_kl
Register r_array_index,
Register r_bitmap,
Register result,
- Register tmp1) {
- assert_different_registers(r_super_klass, r_array_base, r_array_index, r_bitmap, tmp1, result, t0);
+ Register tmp,
+ bool is_stub) {
+ assert_different_registers(r_super_klass, r_array_base, r_array_index, r_bitmap, tmp, result, t0);
const Register
- r_array_length = tmp1,
+ r_array_length = tmp,
r_sub_klass = noreg; // unused
- LOOKUP_SECONDARY_SUPERS_TABLE_REGISTERS(r_super_klass, r_array_base, r_array_length,
- r_array_index, r_sub_klass, result, r_bitmap);
+ if (is_stub) {
+ LOOKUP_SECONDARY_SUPERS_TABLE_REGISTERS(r_super_klass, r_array_base, r_array_length,
+ r_array_index, r_sub_klass, result, r_bitmap);
+ }
Label L_matched, L_fallthrough, L_bitmap_full;
@@ -4422,8 +4610,10 @@ void MacroAssembler::lookup_secondary_supers_table_slow_path(Register r_super_kl
{ // This is conventional linear probing, but instead of terminating
// when a null entry is found in the table, we maintain a bitmap
// in which a 0 indicates missing entries.
- // The check above guarantees there are 0s in the bitmap, so the loop
- // eventually terminates.
+ // As long as the bitmap is not completely full,
+ // array_length == popcount(bitmap). The array_length check above
+ // guarantees there are 0s in the bitmap, so the loop eventually
+ // terminates.
Label L_loop;
bind(L_loop);
@@ -4440,7 +4630,7 @@ void MacroAssembler::lookup_secondary_supers_table_slow_path(Register r_super_kl
test_bit(t0, r_bitmap, 2); // look-ahead check (Bit 2); result is non-zero
beqz(t0, L_fallthrough);
- ror_imm(r_bitmap, r_bitmap, 1);
+ ror(r_bitmap, r_bitmap, 1);
addi(r_array_index, r_array_index, 1);
j(L_loop);
}
@@ -4475,9 +4665,6 @@ void MacroAssembler::verify_secondary_supers_table(Register r_sub_klass,
r_array_index = noreg, // unused
r_bitmap = noreg; // unused
- LOOKUP_SECONDARY_SUPERS_TABLE_REGISTERS(r_super_klass, r_array_base, r_array_length,
- r_array_index, r_sub_klass, result, r_bitmap);
-
BLOCK_COMMENT("verify_secondary_supers_table {");
// We will consult the secondary-super array.
@@ -4914,11 +5101,11 @@ void MacroAssembler::mul_add(Register out, Register in, Register offset,
blt(len, tmp, L_tail_loop);
bind(L_unroll);
for (int i = 0; i < unroll; i++) {
- sub(in, in, BytesPerInt);
+ subi(in, in, BytesPerInt);
lwu(t0, Address(in, 0));
mul(t1, t0, k);
add(t0, t1, out);
- sub(offset, offset, BytesPerInt);
+ subi(offset, offset, BytesPerInt);
lwu(t1, Address(offset, 0));
add(t0, t0, t1);
sw(t0, Address(offset, 0));
@@ -4929,16 +5116,16 @@ void MacroAssembler::mul_add(Register out, Register in, Register offset,
bind(L_tail_loop);
blez(len, L_end);
- sub(in, in, BytesPerInt);
+ subi(in, in, BytesPerInt);
lwu(t0, Address(in, 0));
mul(t1, t0, k);
add(t0, t1, out);
- sub(offset, offset, BytesPerInt);
+ subi(offset, offset, BytesPerInt);
lwu(t1, Address(offset, 0));
add(t0, t0, t1);
sw(t0, Address(offset, 0));
srli(out, t0, 32);
- subw(len, len, 1);
+ subiw(len, len, 1);
j(L_tail_loop);
bind(L_end);
@@ -5015,13 +5202,13 @@ void MacroAssembler::multiply_32_x_32_loop(Register x, Register xstart, Register
lwu(x_xstart, Address(t0, 0));
bind(L_first_loop);
- subw(idx, idx, 1);
+ subiw(idx, idx, 1);
shadd(t0, idx, y, t0, LogBytesPerInt);
lwu(y_idx, Address(t0, 0));
mul(product, x_xstart, y_idx);
add(product, product, carry);
srli(carry, product, 32);
- subw(kdx, kdx, 1);
+ subiw(kdx, kdx, 1);
shadd(t0, kdx, z, t0, LogBytesPerInt);
sw(product, Address(t0, 0));
bgtz(idx, L_first_loop);
@@ -5049,22 +5236,22 @@ void MacroAssembler::multiply_64_x_64_loop(Register x, Register xstart, Register
Label L_first_loop, L_first_loop_exit;
Label L_one_x, L_one_y, L_multiply;
- subw(xstart, xstart, 1);
+ subiw(xstart, xstart, 1);
bltz(xstart, L_one_x);
shadd(t0, xstart, x, t0, LogBytesPerInt);
ld(x_xstart, Address(t0, 0));
- ror_imm(x_xstart, x_xstart, 32); // convert big-endian to little-endian
+ ror(x_xstart, x_xstart, 32); // convert big-endian to little-endian
bind(L_first_loop);
- subw(idx, idx, 1);
+ subiw(idx, idx, 1);
bltz(idx, L_first_loop_exit);
- subw(idx, idx, 1);
+ subiw(idx, idx, 1);
bltz(idx, L_one_y);
shadd(t0, idx, y, t0, LogBytesPerInt);
ld(y_idx, Address(t0, 0));
- ror_imm(y_idx, y_idx, 32); // convert big-endian to little-endian
+ ror(y_idx, y_idx, 32); // convert big-endian to little-endian
bind(L_multiply);
mulhu(t0, x_xstart, y_idx);
@@ -5072,8 +5259,8 @@ void MacroAssembler::multiply_64_x_64_loop(Register x, Register xstart, Register
cad(product, product, carry, t1);
adc(carry, t0, zr, t1);
- subw(kdx, kdx, 2);
- ror_imm(product, product, 32); // back to big-endian
+ subiw(kdx, kdx, 2);
+ ror(product, product, 32); // back to big-endian
shadd(t0, kdx, z, t0, LogBytesPerInt);
sd(product, Address(t0, 0));
@@ -5134,8 +5321,8 @@ void MacroAssembler::multiply_128_x_128_loop(Register y, Register z,
shadd(tmp6, idx, z, t0, LogBytesPerInt);
- ror_imm(yz_idx1, yz_idx1, 32); // convert big-endian to little-endian
- ror_imm(yz_idx2, yz_idx2, 32);
+ ror(yz_idx1, yz_idx1, 32); // convert big-endian to little-endian
+ ror(yz_idx2, yz_idx2, 32);
ld(t1, Address(tmp6, 0));
ld(t0, Address(tmp6, wordSize));
@@ -5143,8 +5330,8 @@ void MacroAssembler::multiply_128_x_128_loop(Register y, Register z,
mul(tmp3, product_hi, yz_idx1); // yz_idx1 * product_hi -> tmp4:tmp3
mulhu(tmp4, product_hi, yz_idx1);
- ror_imm(t0, t0, 32, tmp); // convert big-endian to little-endian
- ror_imm(t1, t1, 32, tmp);
+ ror(t0, t0, 32, tmp); // convert big-endian to little-endian
+ ror(t1, t1, 32, tmp);
mul(tmp, product_hi, yz_idx2); // yz_idx2 * product_hi -> carry2:tmp
mulhu(carry2, product_hi, yz_idx2);
@@ -5157,8 +5344,8 @@ void MacroAssembler::multiply_128_x_128_loop(Register y, Register z,
cad(tmp4, tmp4, t1, carry2);
adc(carry, carry, zr, carry2);
- ror_imm(tmp3, tmp3, 32); // convert little-endian to big-endian
- ror_imm(tmp4, tmp4, 32);
+ ror(tmp3, tmp3, 32); // convert little-endian to big-endian
+ ror(tmp4, tmp4, 32);
sd(tmp4, Address(tmp6, 0));
sd(tmp3, Address(tmp6, wordSize));
@@ -5170,29 +5357,29 @@ void MacroAssembler::multiply_128_x_128_loop(Register y, Register z,
beqz(idx, L_post_third_loop_done);
Label L_check_1;
- subw(idx, idx, 2);
+ subiw(idx, idx, 2);
bltz(idx, L_check_1);
shadd(t0, idx, y, t0, LogBytesPerInt);
ld(yz_idx1, Address(t0, 0));
- ror_imm(yz_idx1, yz_idx1, 32);
+ ror(yz_idx1, yz_idx1, 32);
mul(tmp3, product_hi, yz_idx1); // yz_idx1 * product_hi -> tmp4:tmp3
mulhu(tmp4, product_hi, yz_idx1);
shadd(t0, idx, z, t0, LogBytesPerInt);
ld(yz_idx2, Address(t0, 0));
- ror_imm(yz_idx2, yz_idx2, 32, tmp);
+ ror(yz_idx2, yz_idx2, 32, tmp);
add2_with_carry(carry, tmp4, tmp3, carry, yz_idx2, tmp);
- ror_imm(tmp3, tmp3, 32, tmp);
+ ror(tmp3, tmp3, 32, tmp);
sd(tmp3, Address(t0, 0));
bind(L_check_1);
andi(idx, idx, 0x1);
- subw(idx, idx, 1);
+ subiw(idx, idx, 1);
bltz(idx, L_post_third_loop_done);
shadd(t0, idx, y, t0, LogBytesPerInt);
lwu(tmp4, Address(t0, 0));
@@ -5252,7 +5439,7 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
Label L_multiply_64_x_64_loop, L_done;
- subw(xstart, xlen, 1);
+ subiw(xstart, xlen, 1);
bltz(xstart, L_done);
const Register jdx = tmp1;
@@ -5271,9 +5458,9 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
bind(L_second_loop_unaligned);
mv(carry, zr);
mv(jdx, ylen);
- subw(xstart, xstart, 1);
+ subiw(xstart, xstart, 1);
bltz(xstart, L_done);
- sub(sp, sp, 2 * wordSize);
+ subi(sp, sp, 2 * wordSize);
sd(z, Address(sp, 0));
sd(zr, Address(sp, wordSize));
shadd(t0, xstart, z, t0, LogBytesPerInt);
@@ -5285,7 +5472,7 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
blez(jdx, L_third_loop_exit);
bind(L_third_loop);
- subw(jdx, jdx, 1);
+ subiw(jdx, jdx, 1);
shadd(t0, jdx, y, t0, LogBytesPerInt);
lwu(t0, Address(t0, 0));
mul(t1, t0, product);
@@ -5313,13 +5500,13 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
beqz(kdx, L_second_loop_aligned);
Label L_carry;
- subw(kdx, kdx, 1);
+ subiw(kdx, kdx, 1);
beqz(kdx, L_carry);
shadd(t0, kdx, z, t0, LogBytesPerInt);
sw(carry, Address(t0, 0));
srli(carry, carry, 32);
- subw(kdx, kdx, 1);
+ subiw(kdx, kdx, 1);
bind(L_carry);
shadd(t0, kdx, z, t0, LogBytesPerInt);
@@ -5344,21 +5531,21 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
mv(carry, zr); // carry = 0;
mv(jdx, ylen); // j = ystart+1
- subw(xstart, xstart, 1); // i = xstart-1;
+ subiw(xstart, xstart, 1); // i = xstart-1;
bltz(xstart, L_done);
- sub(sp, sp, 4 * wordSize);
+ subi(sp, sp, 4 * wordSize);
sd(z, Address(sp, 0));
Label L_last_x;
shadd(t0, xstart, z, t0, LogBytesPerInt);
addi(z, t0, 4);
- subw(xstart, xstart, 1); // i = xstart-1;
+ subiw(xstart, xstart, 1); // i = xstart-1;
bltz(xstart, L_last_x);
shadd(t0, xstart, x, t0, LogBytesPerInt);
ld(product_hi, Address(t0, 0));
- ror_imm(product_hi, product_hi, 32); // convert big-endian to little-endian
+ ror(product_hi, product_hi, 32); // convert big-endian to little-endian
Label L_third_loop_prologue;
bind(L_third_loop_prologue);
@@ -5378,7 +5565,7 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi
shadd(t0, tmp3, z, t0, LogBytesPerInt);
sw(carry, Address(t0, 0));
- subw(tmp3, tmp3, 1);
+ subiw(tmp3, tmp3, 1);
bltz(tmp3, L_done);
srli(carry, carry, 32);
@@ -5536,13 +5723,13 @@ void MacroAssembler::zero_words(Register base, uint64_t cnt) {
Register loop_base = t1;
cnt = cnt - remainder;
mv(cnt_reg, cnt);
- add(loop_base, base, remainder * wordSize);
+ addi(loop_base, base, remainder * wordSize);
bind(loop);
sub(cnt_reg, cnt_reg, unroll);
for (int i = 0; i < unroll; i++) {
sd(zr, Address(loop_base, i * wordSize));
}
- add(loop_base, loop_base, unroll * wordSize);
+ addi(loop_base, loop_base, unroll * wordSize);
bnez(cnt_reg, loop);
}
@@ -5593,12 +5780,12 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value) {
jr(t1);
bind(loop);
- add(base, base, unroll * 8);
+ addi(base, base, unroll * wordSize);
for (int i = -unroll; i < 0; i++) {
sd(value, Address(base, i * 8));
}
bind(entry);
- sub(cnt, cnt, unroll);
+ subi(cnt, cnt, unroll);
bgez(cnt, loop);
bind(fini);
@@ -5637,7 +5824,7 @@ void MacroAssembler::zero_dcache_blocks(Register base, Register cnt, Register tm
bind(loop);
cbo_zero(base);
sub(cnt, cnt, tmp1);
- add(base, base, CacheLineSize);
+ addi(base, base, CacheLineSize);
bge(cnt, tmp1, loop);
}
@@ -5699,7 +5886,7 @@ void MacroAssembler::FLOATCVT##_safe(Register dst, FloatRegister src, Register t
fclass_##FLOATSIG(tmp, src); \
mv(dst, zr); \
/* check if src is NaN */ \
- andi(tmp, tmp, fclass_mask::nan); \
+ andi(tmp, tmp, FClassBits::nan); \
bnez(tmp, done); \
FLOATCVT(dst, src); \
bind(done); \
@@ -5723,7 +5910,7 @@ void MacroAssembler::FLOATTYPE##_compare(Register result, FloatRegister Rs1,
/* Rs1 > Rs2, install 1 */ \
bgtz(result, Ldone); \
feq_##FLOATSIG(result, Rs1, Rs2); \
- addi(result, result, -1); \
+ subi(result, result, 1); \
/* Rs1 = Rs2, install 0 */ \
/* NaN or Rs1 < Rs2, install -1 */ \
bind(Ldone); \
@@ -5734,7 +5921,7 @@ void MacroAssembler::FLOATTYPE##_compare(Register result, FloatRegister Rs1,
/* Rs1 < Rs2, install -1 */ \
bgtz(result, Ldone); \
feq_##FLOATSIG(result, Rs1, Rs2); \
- addi(result, result, -1); \
+ subi(result, result, 1); \
/* Rs1 = Rs2, install 0 */ \
/* NaN or Rs1 > Rs2, install 1 */ \
bind(Ldone); \
@@ -6142,10 +6329,10 @@ void MacroAssembler::test_bit(Register Rd, Register Rs, uint32_t bit_pos) {
}
int64_t imm = (int64_t)(1UL << bit_pos);
if (is_simm12(imm)) {
- and_imm12(Rd, Rs, imm);
+ andi(Rd, Rs, imm);
} else {
srli(Rd, Rs, bit_pos);
- and_imm12(Rd, Rd, 1);
+ andi(Rd, Rd, 1);
}
}
@@ -6198,7 +6385,7 @@ void MacroAssembler::lightweight_lock(Register basic_lock, Register obj, Registe
// After successful lock, push object on lock-stack.
add(t, xthread, top);
sd(obj, Address(t));
- addw(top, top, oopSize);
+ addiw(top, top, oopSize);
sw(top, Address(xthread, JavaThread::lock_stack_top_offset()));
}
@@ -6230,7 +6417,7 @@ void MacroAssembler::lightweight_unlock(Register obj, Register tmp1, Register tm
// Check if obj is top of lock-stack.
lwu(top, Address(xthread, JavaThread::lock_stack_top_offset()));
- subw(top, top, oopSize);
+ subiw(top, top, oopSize);
add(t, xthread, top);
ld(t, Address(t));
bne(obj, t, slow, /* is_far */ true);
@@ -6270,7 +6457,7 @@ void MacroAssembler::lightweight_unlock(Register obj, Register tmp1, Register tm
// Restore lock-stack and handle the unlock in runtime.
DEBUG_ONLY(add(t, xthread, top);)
DEBUG_ONLY(sd(obj, Address(t));)
- addw(top, top, oopSize);
+ addiw(top, top, oopSize);
sw(top, Address(xthread, JavaThread::lock_stack_top_offset()));
j(slow);
diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
index 4cfc1c5525480..014297bcb3227 100644
--- a/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
+++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
@@ -60,14 +60,14 @@ class MacroAssembler: public Assembler {
// Note that SP must be updated to the right place before saving/restoring RA and FP
// because signal based thread suspend/resume could happen asynchronously.
void enter() {
- addi(sp, sp, - 2 * wordSize);
+ subi(sp, sp, 2 * wordSize);
sd(ra, Address(sp, wordSize));
sd(fp, Address(sp));
addi(fp, sp, 2 * wordSize);
}
void leave() {
- addi(sp, fp, - 2 * wordSize);
+ subi(sp, fp, 2 * wordSize);
ld(fp, Address(sp));
ld(ra, Address(sp, wordSize));
addi(sp, sp, 2 * wordSize);
@@ -323,21 +323,55 @@ class MacroAssembler: public Assembler {
Register tmp1_reg,
Register tmp2_reg,
Label* L_success,
- Label* L_failure);
+ Label* L_failure,
+ bool set_cond_codes = false);
+
+ void check_klass_subtype_slow_path_linear(Register sub_klass,
+ Register super_klass,
+ Register tmp1_reg,
+ Register tmp2_reg,
+ Label* L_success,
+ Label* L_failure,
+ bool set_cond_codes = false);
+
+ void check_klass_subtype_slow_path_table(Register sub_klass,
+ Register super_klass,
+ Register tmp1_reg,
+ Register tmp2_reg,
+ Label* L_success,
+ Label* L_failure,
+ bool set_cond_codes = false);
+
+ // If r is valid, return r.
+ // If r is invalid, remove a register r2 from available_regs, add r2
+ // to regs_to_push, then return r2.
+ Register allocate_if_noreg(const Register r,
+ RegSetIterator &available_regs,
+ RegSet ®s_to_push);
+
+ // Secondary subtype checking
+ void lookup_secondary_supers_table_var(Register sub_klass,
+ Register r_super_klass,
+ Register result,
+ Register tmp1,
+ Register tmp2,
+ Register tmp3,
+ Register tmp4,
+ Label *L_success);
void population_count(Register dst, Register src, Register tmp1, Register tmp2);
// As above, but with a constant super_klass.
// The result is in Register result, not the condition codes.
- bool lookup_secondary_supers_table(Register r_sub_klass,
- Register r_super_klass,
- Register result,
- Register tmp1,
- Register tmp2,
- Register tmp3,
- Register tmp4,
- u1 super_klass_slot,
- bool stub_is_near = false);
+ bool lookup_secondary_supers_table_const(Register r_sub_klass,
+ Register r_super_klass,
+ Register result,
+ Register tmp1,
+ Register tmp2,
+ Register tmp3,
+ Register tmp4,
+ u1 super_klass_slot,
+ bool stub_is_near = false);
void verify_secondary_supers_table(Register r_sub_klass,
Register r_super_klass,
@@ -351,7 +385,8 @@ class MacroAssembler: public Assembler {
Register r_array_index,
Register r_bitmap,
Register result,
- Register tmp1);
+ Register tmp,
+ bool is_stub = true);
void check_klass_subtype(Register sub_klass,
Register super_klass,
@@ -591,9 +626,6 @@ class MacroAssembler: public Assembler {
}
// Control and status pseudo instructions
- void rdinstret(Register Rd); // read instruction-retired counter
- void rdcycle(Register Rd); // read cycle counter
- void rdtime(Register Rd); // read time
void csrr(Register Rd, unsigned csr); // read csr
void csrw(unsigned csr, Register Rs); // write csr
void csrs(unsigned csr, Register Rs); // set bits in csr
@@ -601,19 +633,23 @@ class MacroAssembler: public Assembler {
void csrwi(unsigned csr, unsigned imm);
void csrsi(unsigned csr, unsigned imm);
void csrci(unsigned csr, unsigned imm);
- void frcsr(Register Rd); // read float-point csr
- void fscsr(Register Rd, Register Rs); // swap float-point csr
- void fscsr(Register Rs); // write float-point csr
- void frrm(Register Rd); // read float-point rounding mode
- void fsrm(Register Rd, Register Rs); // swap float-point rounding mode
- void fsrm(Register Rs); // write float-point rounding mode
+ void frcsr(Register Rd) { csrr(Rd, CSR_FCSR); }; // read float-point csr
+ void fscsr(Register Rd, Register Rs); // swap float-point csr
+ void fscsr(Register Rs); // write float-point csr
+ void frrm(Register Rd) { csrr(Rd, CSR_FRM); }; // read float-point rounding mode
+ void fsrm(Register Rd, Register Rs); // swap float-point rounding mode
+ void fsrm(Register Rs); // write float-point rounding mode
void fsrmi(Register Rd, unsigned imm);
void fsrmi(unsigned imm);
- void frflags(Register Rd); // read float-point exception flags
- void fsflags(Register Rd, Register Rs); // swap float-point exception flags
- void fsflags(Register Rs); // write float-point exception flags
+ void frflags(Register Rd) { csrr(Rd, CSR_FFLAGS); }; // read float-point exception flags
+ void fsflags(Register Rd, Register Rs); // swap float-point exception flags
+ void fsflags(Register Rs); // write float-point exception flags
void fsflagsi(Register Rd, unsigned imm);
void fsflagsi(unsigned imm);
+ // Requires Zicntr
+ void rdinstret(Register Rd) { csrr(Rd, CSR_INSTRET); }; // read instruction-retired counter
+ void rdcycle(Register Rd) { csrr(Rd, CSR_CYCLE); }; // read cycle counter
+ void rdtime(Register Rd) { csrr(Rd, CSR_TIME); }; // read time
// Restore cpu control state after JNI call
void restore_cpu_control_state_after_jni(Register tmp);
@@ -886,10 +922,20 @@ class MacroAssembler: public Assembler {
public:
// arith
- void add (Register Rd, Register Rn, int64_t increment, Register temp = t0);
- void addw(Register Rd, Register Rn, int32_t increment, Register temp = t0);
- void sub (Register Rd, Register Rn, int64_t decrement, Register temp = t0);
- void subw(Register Rd, Register Rn, int32_t decrement, Register temp = t0);
+ void add (Register Rd, Register Rn, int64_t increment, Register tmp = t0);
+ void sub (Register Rd, Register Rn, int64_t decrement, Register tmp = t0);
+ void addw(Register Rd, Register Rn, int64_t increment, Register tmp = t0);
+ void subw(Register Rd, Register Rn, int64_t decrement, Register tmp = t0);
+
+ void subi(Register Rd, Register Rn, int64_t decrement) {
+ assert(is_simm12(-decrement), "Must be");
+ addi(Rd, Rn, -decrement);
+ }
+
+ void subiw(Register Rd, Register Rn, int64_t decrement) {
+ assert(is_simm12(-decrement), "Must be");
+ addiw(Rd, Rn, -decrement);
+ }
#define INSN(NAME) \
inline void NAME(Register Rd, Register Rs1, Register Rs2) { \
@@ -916,9 +962,10 @@ class MacroAssembler: public Assembler {
void revbw(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2= t1); // reverse bytes in lower word, sign-extend
void revb(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in doubleword
- void ror_imm(Register dst, Register src, uint32_t shift, Register tmp = t0);
- void rolw_imm(Register dst, Register src, uint32_t, Register tmp = t0);
- void andi(Register Rd, Register Rn, int64_t imm, Register tmp = t0);
+ void ror(Register dst, Register src, Register shift, Register tmp = t0);
+ void ror(Register dst, Register src, uint32_t shift, Register tmp = t0);
+ void rolw(Register dst, Register src, uint32_t shift, Register tmp = t0);
+
void orptr(Address adr, RegisterOrConstant src, Register tmp1 = t0, Register tmp2 = t1);
// Load and Store Instructions
diff --git a/src/hotspot/cpu/riscv/methodHandles_riscv.cpp b/src/hotspot/cpu/riscv/methodHandles_riscv.cpp
index 8ed4b93ad4de9..39b6737631dc5 100644
--- a/src/hotspot/cpu/riscv/methodHandles_riscv.cpp
+++ b/src/hotspot/cpu/riscv/methodHandles_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/cpu/riscv/nativeInst_riscv.cpp b/src/hotspot/cpu/riscv/nativeInst_riscv.cpp
index 48a9a84e481bf..6f20d54b222f2 100644
--- a/src/hotspot/cpu/riscv/nativeInst_riscv.cpp
+++ b/src/hotspot/cpu/riscv/nativeInst_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/compiledIC.hpp"
#include "nativeInst_riscv.hpp"
diff --git a/src/hotspot/cpu/riscv/registerMap_riscv.cpp b/src/hotspot/cpu/riscv/registerMap_riscv.cpp
index e59fca777c1de..fa7b108c6ff12 100644
--- a/src/hotspot/cpu/riscv/registerMap_riscv.cpp
+++ b/src/hotspot/cpu/riscv/registerMap_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/registerMap.hpp"
#include "vmreg_riscv.inline.hpp"
diff --git a/src/hotspot/cpu/riscv/register_riscv.cpp b/src/hotspot/cpu/riscv/register_riscv.cpp
index 98aeafbfe9cbe..56a4483a989e6 100644
--- a/src/hotspot/cpu/riscv/register_riscv.cpp
+++ b/src/hotspot/cpu/riscv/register_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_riscv.hpp"
Register::RegisterImpl all_RegisterImpls [Register::number_of_registers + 1];
diff --git a/src/hotspot/cpu/riscv/relocInfo_riscv.cpp b/src/hotspot/cpu/riscv/relocInfo_riscv.cpp
index 18b4302c7e68e..7bee372b0ef80 100644
--- a/src/hotspot/cpu/riscv/relocInfo_riscv.cpp
+++ b/src/hotspot/cpu/riscv/relocInfo_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_riscv.hpp"
diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad
index 7cb42a6b30c3c..6250b88e61ec2 100644
--- a/src/hotspot/cpu/riscv/riscv.ad
+++ b/src/hotspot/cpu/riscv/riscv.ad
@@ -1918,7 +1918,7 @@ bool Matcher::match_rule_supported(int opcode) {
case Op_ConvHF2F:
case Op_ConvF2HF:
- return UseZfh;
+ return UseZfh || UseZfhmin;
}
return true; // Per default match rules are supported.
@@ -2364,7 +2364,7 @@ encode %{
Label miss;
Label done;
__ check_klass_subtype_slow_path(sub_reg, super_reg, temp_reg, result_reg,
- nullptr, &miss);
+ nullptr, &miss, /*set_cond_codes*/ true);
if ($primary) {
__ mv(result_reg, zr);
} else {
@@ -6482,9 +6482,9 @@ instruct addP_reg_imm(iRegPNoSp dst, iRegP src1, immLAdd src2) %{
ins_encode %{
// src2 is imm, so actually call the addi
- __ add(as_Register($dst$$reg),
- as_Register($src1$$reg),
- $src2$$constant);
+ __ addi(as_Register($dst$$reg),
+ as_Register($src1$$reg),
+ $src2$$constant);
%}
ins_pipe(ialu_reg_imm);
@@ -6513,9 +6513,9 @@ instruct addL_reg_imm(iRegLNoSp dst, iRegL src1, immLAdd src2) %{
ins_encode %{
// src2 is imm, so actually call the addi
- __ add(as_Register($dst$$reg),
- as_Register($src1$$reg),
- $src2$$constant);
+ __ addi(as_Register($dst$$reg),
+ as_Register($src1$$reg),
+ $src2$$constant);
%}
ins_pipe(ialu_reg_imm);
@@ -6546,9 +6546,9 @@ instruct subI_reg_imm(iRegINoSp dst, iRegIorL2I src1, immISub src2) %{
ins_encode %{
// src2 is imm, so actually call the addiw
- __ subw(as_Register($dst$$reg),
- as_Register($src1$$reg),
- $src2$$constant);
+ __ subiw(as_Register($dst$$reg),
+ as_Register($src1$$reg),
+ $src2$$constant);
%}
ins_pipe(ialu_reg_imm);
@@ -6577,9 +6577,9 @@ instruct subL_reg_imm(iRegLNoSp dst, iRegL src1, immLSub src2) %{
ins_encode %{
// src2 is imm, so actually call the addi
- __ sub(as_Register($dst$$reg),
- as_Register($src1$$reg),
- $src2$$constant);
+ __ subi(as_Register($dst$$reg),
+ as_Register($src1$$reg),
+ $src2$$constant);
%}
ins_pipe(ialu_reg_imm);
@@ -7348,7 +7348,7 @@ instruct isInfiniteF_reg_reg(iRegINoSp dst, fRegF src)
format %{ "isInfinite $dst, $src" %}
ins_encode %{
__ fclass_s(as_Register($dst$$reg), as_FloatRegister($src$$reg));
- __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::fclass_mask::inf);
+ __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::FClassBits::inf);
__ slt(as_Register($dst$$reg), zr, as_Register($dst$$reg));
%}
@@ -7363,7 +7363,7 @@ instruct isInfiniteD_reg_reg(iRegINoSp dst, fRegD src)
format %{ "isInfinite $dst, $src" %}
ins_encode %{
__ fclass_d(as_Register($dst$$reg), as_FloatRegister($src$$reg));
- __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::fclass_mask::inf);
+ __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::FClassBits::inf);
__ slt(as_Register($dst$$reg), zr, as_Register($dst$$reg));
%}
@@ -7378,7 +7378,7 @@ instruct isFiniteF_reg_reg(iRegINoSp dst, fRegF src)
format %{ "isFinite $dst, $src" %}
ins_encode %{
__ fclass_s(as_Register($dst$$reg), as_FloatRegister($src$$reg));
- __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::fclass_mask::finite);
+ __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::FClassBits::finite);
__ slt(as_Register($dst$$reg), zr, as_Register($dst$$reg));
%}
@@ -7393,7 +7393,7 @@ instruct isFiniteD_reg_reg(iRegINoSp dst, fRegD src)
format %{ "isFinite $dst, $src" %}
ins_encode %{
__ fclass_d(as_Register($dst$$reg), as_FloatRegister($src$$reg));
- __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::fclass_mask::finite);
+ __ andi(as_Register($dst$$reg), as_Register($dst$$reg), Assembler::FClassBits::finite);
__ slt(as_Register($dst$$reg), zr, as_Register($dst$$reg));
%}
@@ -10019,10 +10019,11 @@ instruct CallLeafNoFPDirect(method meth)
instruct partialSubtypeCheck(iRegP_R15 result, iRegP_R14 sub, iRegP_R10 super, iRegP_R12 tmp, rFlagsReg cr)
%{
+ predicate(!UseSecondarySupersTable);
match(Set result (PartialSubtypeCheck sub super));
effect(KILL tmp, KILL cr);
- ins_cost(11 * DEFAULT_COST);
+ ins_cost(20 * DEFAULT_COST);
format %{ "partialSubtypeCheck $result, $sub, $super\t#@partialSubtypeCheck" %}
ins_encode(riscv_enc_partial_subtype_check(sub, super, tmp, result));
@@ -10032,6 +10033,33 @@ instruct partialSubtypeCheck(iRegP_R15 result, iRegP_R14 sub, iRegP_R10 super, i
ins_pipe(pipe_class_memory);
%}
+// Two versions of partialSubtypeCheck, both used when we need to
+// search for a super class in the secondary supers array. The first
+// is used when we don't know _a priori_ the class being searched
+// for. The second, far more common, is used when we do know: this is
+// used for instanceof, checkcast, and any case where C2 can determine
+// it by constant propagation.
+
+instruct partialSubtypeCheckVarSuper(iRegP_R14 sub, iRegP_R10 super, iRegP_R15 result,
+ iRegP_R11 tmpR11, iRegP_R12 tmpR12, iRegP_R13 tmpR13,
+ iRegP_R16 tmpR16, rFlagsReg cr)
+%{
+ predicate(UseSecondarySupersTable);
+ match(Set result (PartialSubtypeCheck sub super));
+ effect(TEMP tmpR11, TEMP tmpR12, TEMP tmpR13, TEMP tmpR16, KILL cr);
+
+ ins_cost(10 * DEFAULT_COST); // slightly larger than the next version
+ format %{ "partialSubtypeCheck $result, $sub, $super" %}
+
+ ins_encode %{
+ __ lookup_secondary_supers_table_var($sub$$Register, $super$$Register, $result$$Register,
+ $tmpR11$$Register, $tmpR12$$Register, $tmpR13$$Register,
+ $tmpR16$$Register, nullptr /*L_success*/);
+ %}
+
+ ins_pipe(pipe_class_memory);
+%}
+
instruct partialSubtypeCheckConstSuper(iRegP_R14 sub, iRegP_R10 super_reg, immP super_con, iRegP_R15 result,
iRegP_R11 tmpR11, iRegP_R12 tmpR12, iRegP_R13 tmpR13, iRegP_R16 tmpR16, rFlagsReg cr)
%{
@@ -10039,16 +10067,16 @@ instruct partialSubtypeCheckConstSuper(iRegP_R14 sub, iRegP_R10 super_reg, immP
match(Set result (PartialSubtypeCheck sub (Binary super_reg super_con)));
effect(TEMP tmpR11, TEMP tmpR12, TEMP tmpR13, TEMP tmpR16, KILL cr);
- ins_cost(7 * DEFAULT_COST); // needs to be less than competing nodes
+ ins_cost(5 * DEFAULT_COST); // needs to be less than competing nodes
format %{ "partialSubtypeCheck $result, $sub, $super_reg, $super_con" %}
ins_encode %{
bool success = false;
u1 super_klass_slot = ((Klass*)$super_con$$constant)->hash_slot();
if (InlineSecondarySupersTest) {
- success = __ lookup_secondary_supers_table($sub$$Register, $super_reg$$Register, $result$$Register,
- $tmpR11$$Register, $tmpR12$$Register, $tmpR13$$Register,
- $tmpR16$$Register, super_klass_slot);
+ success = __ lookup_secondary_supers_table_const($sub$$Register, $super_reg$$Register, $result$$Register,
+ $tmpR11$$Register, $tmpR12$$Register, $tmpR13$$Register,
+ $tmpR16$$Register, super_klass_slot);
} else {
address call = __ reloc_call(RuntimeAddress(StubRoutines::lookup_secondary_supers_table_stub(super_klass_slot)));
success = (call != nullptr);
@@ -10062,22 +10090,6 @@ instruct partialSubtypeCheckConstSuper(iRegP_R14 sub, iRegP_R10 super_reg, immP
ins_pipe(pipe_class_memory);
%}
-instruct partialSubtypeCheckVsZero(iRegP_R15 result, iRegP_R14 sub, iRegP_R10 super, iRegP_R12 tmp,
- immP0 zero, rFlagsReg cr)
-%{
- match(Set cr (CmpP (PartialSubtypeCheck sub super) zero));
- effect(KILL tmp, KILL result);
-
- ins_cost(11 * DEFAULT_COST);
- format %{ "partialSubtypeCheck $result, $sub, $super == 0\t#@partialSubtypeCheckVsZero" %}
-
- ins_encode(riscv_enc_partial_subtype_check(sub, super, tmp, result));
-
- opcode(0x0); // Don't zero result reg on hit
-
- ins_pipe(pipe_class_memory);
-%}
-
instruct string_compareU(iRegP_R11 str1, iRegI_R12 cnt1, iRegP_R13 str2, iRegI_R14 cnt2,
iRegI_R10 result, iRegP_R28 tmp1, iRegL_R29 tmp2, iRegL_R30 tmp3, rFlagsReg cr)
%{
diff --git a/src/hotspot/cpu/riscv/riscv_b.ad b/src/hotspot/cpu/riscv/riscv_b.ad
index 535c0fd534ddf..990d9eab87c7b 100644
--- a/src/hotspot/cpu/riscv/riscv_b.ad
+++ b/src/hotspot/cpu/riscv/riscv_b.ad
@@ -60,7 +60,7 @@ instruct rorI_reg_b(iRegINoSp dst, iRegI src, iRegI shift) %{
format %{ "rorw $dst, $src, $shift\t#@rorI_reg_b" %}
ins_cost(ALU_COST);
ins_encode %{
- __ rorw(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
+ __ rorrw(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
%}
ins_pipe(ialu_reg_reg);
%}
@@ -72,7 +72,7 @@ instruct rorL_reg_b(iRegLNoSp dst, iRegL src, iRegI shift) %{
format %{ "ror $dst, $src, $shift\t#@rorL_reg_b" %}
ins_cost(ALU_COST);
ins_encode %{
- __ ror(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
+ __ rorr(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
%}
ins_pipe(ialu_reg_reg);
%}
@@ -84,7 +84,7 @@ instruct rolI_reg_b(iRegINoSp dst, iRegI src, iRegI shift) %{
format %{ "rolw $dst, $src, $shift\t#@rolI_reg_b" %}
ins_cost(ALU_COST);
ins_encode %{
- __ rolw(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
+ __ rolrw(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
%}
ins_pipe(ialu_reg_reg);
%}
@@ -96,7 +96,7 @@ instruct rolL_reg_b(iRegLNoSp dst, iRegL src, iRegI shift) %{
format %{ "rol $dst, $src, $shift\t#@rolL_reg_b" %}
ins_cost(ALU_COST);
ins_encode %{
- __ rol(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
+ __ rolr(as_Register($dst$$reg), as_Register($src$$reg), as_Register($shift$$reg));
%}
ins_pipe(ialu_reg_reg);
%}
diff --git a/src/hotspot/cpu/riscv/runtime_riscv.cpp b/src/hotspot/cpu/riscv/runtime_riscv.cpp
index 441bd1f241f28..a0879b68053d6 100644
--- a/src/hotspot/cpu/riscv/runtime_riscv.cpp
+++ b/src/hotspot/cpu/riscv/runtime_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
@@ -73,7 +72,7 @@ void OptoRuntime::generate_uncommon_trap_blob() {
// Push self-frame. We get here with a return address in RA
// and sp should be 16 byte aligned
// push fp and retaddr by hand
- __ addi(sp, sp, -2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ sd(ra, Address(sp, wordSize));
__ sd(fp, Address(sp, 0));
// we don't expect an arg reg save area
@@ -140,7 +139,7 @@ void OptoRuntime::generate_uncommon_trap_blob() {
__ lwu(x12, Address(x14,
Deoptimization::UnrollBlock::
size_of_deoptimized_frame_offset()));
- __ sub(x12, x12, 2 * wordSize);
+ __ subi(x12, x12, 2 * wordSize);
__ add(sp, sp, x12);
__ ld(fp, Address(sp, 0));
__ ld(ra, Address(sp, wordSize));
@@ -188,7 +187,7 @@ void OptoRuntime::generate_uncommon_trap_blob() {
Label loop;
__ bind(loop);
__ ld(x11, Address(x15, 0)); // Load frame size
- __ sub(x11, x11, 2 * wordSize); // We'll push pc and fp by hand
+ __ subi(x11, x11, 2 * wordSize); // We'll push pc and fp by hand
__ ld(ra, Address(x12, 0)); // Save return address
__ enter(); // and old fp & set new fp
__ sub(sp, sp, x11); // Prolog
@@ -196,9 +195,9 @@ void OptoRuntime::generate_uncommon_trap_blob() {
// This value is corrected by layout_activation_impl
__ sd(zr, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
__ mv(sender_sp, sp); // Pass sender_sp to next frame
- __ add(x15, x15, wordSize); // Bump array pointer (sizes)
- __ add(x12, x12, wordSize); // Bump array pointer (pcs)
- __ subw(x13, x13, 1); // Decrement counter
+ __ addi(x15, x15, wordSize); // Bump array pointer (sizes)
+ __ addi(x12, x12, wordSize); // Bump array pointer (pcs)
+ __ subiw(x13, x13, 1); // Decrement counter
__ bgtz(x13, loop);
__ ld(ra, Address(x12, 0)); // save final return address
// Re-push self-frame
@@ -292,7 +291,7 @@ void OptoRuntime::generate_exception_blob() {
// push fp and retaddr by hand
// Exception pc is 'return address' for stack walker
- __ addi(sp, sp, -2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ sd(ra, Address(sp, wordSize));
__ sd(fp, Address(sp));
// there are no callee save registers and we don't expect an
@@ -346,7 +345,7 @@ void OptoRuntime::generate_exception_blob() {
// and we dont' expect an arg reg save area
__ ld(fp, Address(sp));
__ ld(x13, Address(sp, wordSize));
- __ addi(sp, sp , 2 * wordSize);
+ __ addi(sp, sp, 2 * wordSize);
// x10: exception handler
@@ -378,5 +377,3 @@ void OptoRuntime::generate_exception_blob() {
_exception_blob = ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
}
#endif // COMPILER2
-
-
diff --git a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
index 9af1b6a9bb128..49e630bbfdf91 100644
--- a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
+++ b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
@@ -641,7 +640,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;
{ // Bypass the barrier for non-static methods
- __ lwu(t0, Address(xmethod, Method::access_flags_offset()));
+ __ load_unsigned_short(t0, Address(xmethod, Method::access_flags_offset()));
__ test_bit(t1, t0, exact_log2(JVM_ACC_STATIC));
__ beqz(t1, L_skip_barrier); // non-static
}
@@ -802,7 +801,7 @@ static void save_args(MacroAssembler *masm, int arg_count, int first_arg, VMRegP
if (args[i].first()->is_Register()) {
x = x + args[i].first()->as_Register();
} else if (args[i].first()->is_FloatRegister()) {
- __ addi(sp, sp, -2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ fsd(args[i].first()->as_FloatRegister(), Address(sp, 0));
}
}
@@ -824,7 +823,7 @@ static void restore_args(MacroAssembler *masm, int arg_count, int first_arg, VMR
;
} else if (args[i].first()->is_FloatRegister()) {
__ fld(args[i].first()->as_FloatRegister(), Address(sp, 0));
- __ add(sp, sp, 2 * wordSize);
+ __ addi(sp, sp, 2 * wordSize);
}
}
}
@@ -1715,7 +1714,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// NOTE: the oopMark is in swap_reg % 10 as the result of cmpxchg
__ sub(swap_reg, swap_reg, sp);
- __ andi(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
+ __ mv(t0, 3 - (int)os::vm_page_size());
+ __ andr(swap_reg, swap_reg, t0);
// Save the test result, for recursive case, the result is zero
__ sd(swap_reg, Address(lock_reg, mark_word_offset));
@@ -2336,7 +2336,7 @@ void SharedRuntime::generate_deopt_blob() {
// Pop deoptimized frame
__ lwu(x12, Address(x15, Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset()));
- __ sub(x12, x12, 2 * wordSize);
+ __ subi(x12, x12, 2 * wordSize);
__ add(sp, sp, x12);
__ ld(fp, Address(sp, 0));
__ ld(ra, Address(sp, wordSize));
@@ -2379,7 +2379,7 @@ void SharedRuntime::generate_deopt_blob() {
__ bind(loop);
__ ld(x9, Address(x14, 0)); // Load frame size
__ addi(x14, x14, wordSize);
- __ sub(x9, x9, 2 * wordSize); // We'll push pc and fp by hand
+ __ subi(x9, x9, 2 * wordSize); // We'll push pc and fp by hand
__ ld(ra, Address(x12, 0)); // Load pc
__ addi(x12, x12, wordSize);
__ enter(); // Save old & set new fp
@@ -2388,7 +2388,7 @@ void SharedRuntime::generate_deopt_blob() {
__ sd(zr, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
__ sd(sender_sp, Address(fp, frame::interpreter_frame_sender_sp_offset * wordSize)); // Make it walkable
__ mv(sender_sp, sp); // Pass sender_sp to next frame
- __ addi(x13, x13, -1); // Decrement counter
+ __ subi(x13, x13, 1); // Decrement counter
__ bnez(x13, loop);
// Re-push self-frame
@@ -2566,7 +2566,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
#endif
// Adjust return pc forward to step over the safepoint poll instruction
- __ add(x18, x18, NativeInstruction::instruction_size);
+ __ addi(x18, x18, NativeInstruction::instruction_size);
__ sd(x18, Address(fp, frame::return_addr_offset * wordSize));
}
@@ -2736,7 +2736,7 @@ RuntimeStub* SharedRuntime::generate_throw_exception(SharedStubId id, address ru
assert(is_even(framesize / 2), "sp not 16-byte aligned");
// ra and fp are already in place
- __ addi(sp, fp, 0 - ((unsigned)framesize << LogBytesPerInt)); // prolog
+ __ subi(sp, fp, (unsigned)framesize << LogBytesPerInt); // prolog
int frame_complete = __ pc() - start;
diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
index 0b619923b06b1..afd1f691f34fa 100644
--- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
+++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/oopMap.hpp"
@@ -341,7 +340,7 @@ class StubGenerator: public StubCodeGenerator {
address loop = __ pc();
__ ld(t0, Address(c_rarg5, 0));
__ addi(c_rarg5, c_rarg5, wordSize);
- __ addi(c_rarg6, c_rarg6, -1);
+ __ subi(c_rarg6, c_rarg6, 1);
__ push_reg(t0);
__ bgtz(c_rarg6, loop);
@@ -623,7 +622,7 @@ class StubGenerator: public StubCodeGenerator {
__ la(c_rarg2, ExternalAddress((address) StubRoutines::verify_oop_count_addr()));
__ ld(c_rarg3, Address(c_rarg2));
- __ add(c_rarg3, c_rarg3, 1);
+ __ addi(c_rarg3, c_rarg3, 1);
__ sd(c_rarg3, Address(c_rarg2));
// object is in x10
@@ -698,8 +697,8 @@ class StubGenerator: public StubCodeGenerator {
for (int i = 0; i < MacroAssembler::zero_words_block_size; i++) {
__ sd(zr, Address(base, i * wordSize));
}
- __ add(base, base, MacroAssembler::zero_words_block_size * wordSize);
- __ sub(cnt, cnt, MacroAssembler::zero_words_block_size);
+ __ addi(base, base, MacroAssembler::zero_words_block_size * wordSize);
+ __ subi(cnt, cnt, MacroAssembler::zero_words_block_size);
__ bge(cnt, tmp1, loop);
__ bind(done);
}
@@ -779,7 +778,7 @@ class StubGenerator: public StubCodeGenerator {
__ ld(tmp_reg7, Address(s, 8 * unit));
__ addi(s, s, 8 * unit);
- __ sub(count, count, 16);
+ __ subi(count, count, 16);
__ bltz(count, drain);
__ bind(again);
@@ -805,7 +804,7 @@ class StubGenerator: public StubCodeGenerator {
__ addi(s, s, 8 * unit);
__ addi(d, d, 8 * unit);
- __ sub(count, count, 8);
+ __ subi(count, count, 8);
__ bgez(count, again);
// Drain
@@ -959,9 +958,9 @@ class StubGenerator: public StubCodeGenerator {
}
if (is_aligned) {
- __ addi(t0, cnt, -32);
+ __ subi(t0, cnt, 32);
__ bgez(t0, copy32_loop);
- __ addi(t0, cnt, -8);
+ __ subi(t0, cnt, 8);
__ bgez(t0, copy8_loop, is_far);
__ j(copy_small);
} else {
@@ -985,7 +984,7 @@ class StubGenerator: public StubCodeGenerator {
__ addi(src, src, step);
__ addi(dst, dst, step);
}
- __ addi(cnt, cnt, -granularity);
+ __ subi(cnt, cnt, granularity);
__ beqz(cnt, done, is_far);
__ j(same_aligned);
@@ -996,8 +995,8 @@ class StubGenerator: public StubCodeGenerator {
__ bind(copy32_loop);
if (is_backwards) {
- __ addi(src, src, -wordSize * 4);
- __ addi(dst, dst, -wordSize * 4);
+ __ subi(src, src, wordSize * 4);
+ __ subi(dst, dst, wordSize * 4);
}
// we first load 32 bytes, then write it, so the direction here doesn't matter
bs_asm->copy_load_at(_masm, decorators, type, 8, tmp3, Address(src), gct1);
@@ -1014,19 +1013,19 @@ class StubGenerator: public StubCodeGenerator {
__ addi(src, src, wordSize * 4);
__ addi(dst, dst, wordSize * 4);
}
- __ addi(t0, cnt, -(32 + wordSize * 4));
- __ addi(cnt, cnt, -wordSize * 4);
+ __ subi(t0, cnt, 32 + wordSize * 4);
+ __ subi(cnt, cnt, wordSize * 4);
__ bgez(t0, copy32_loop); // cnt >= 32, do next loop
__ beqz(cnt, done); // if that's all - done
- __ addi(t0, cnt, -8); // if not - copy the reminder
+ __ subi(t0, cnt, 8); // if not - copy the reminder
__ bltz(t0, copy_small); // cnt < 8, go to copy_small, else fall through to copy8_loop
__ bind(copy8_loop);
if (is_backwards) {
- __ addi(src, src, -wordSize);
- __ addi(dst, dst, -wordSize);
+ __ subi(src, src, wordSize);
+ __ subi(dst, dst, wordSize);
}
bs_asm->copy_load_at(_masm, decorators, type, 8, tmp3, Address(src), gct1);
bs_asm->copy_store_at(_masm, decorators, type, 8, Address(dst), tmp3, gct1, gct2, gct3);
@@ -1035,8 +1034,8 @@ class StubGenerator: public StubCodeGenerator {
__ addi(src, src, wordSize);
__ addi(dst, dst, wordSize);
}
- __ addi(t0, cnt, -(8 + wordSize));
- __ addi(cnt, cnt, -wordSize);
+ __ subi(t0, cnt, 8 + wordSize);
+ __ subi(cnt, cnt, wordSize);
__ bgez(t0, copy8_loop); // cnt >= 8, do next loop
__ beqz(cnt, done); // if that's all - done
@@ -1054,7 +1053,7 @@ class StubGenerator: public StubCodeGenerator {
__ addi(src, src, step);
__ addi(dst, dst, step);
}
- __ addi(cnt, cnt, -granularity);
+ __ subi(cnt, cnt, granularity);
__ bgtz(cnt, copy_small);
__ bind(done);
@@ -1454,6 +1453,9 @@ class StubGenerator: public StubCodeGenerator {
void generate_type_check(Register sub_klass,
Register super_check_offset,
Register super_klass,
+ Register result,
+ Register tmp1,
+ Register tmp2,
Label& L_success) {
assert_different_registers(sub_klass, super_check_offset, super_klass);
@@ -1462,7 +1464,7 @@ class StubGenerator: public StubCodeGenerator {
Label L_miss;
__ check_klass_subtype_fast_path(sub_klass, super_klass, noreg, &L_success, &L_miss, nullptr, super_check_offset);
- __ check_klass_subtype_slow_path(sub_klass, super_klass, noreg, noreg, &L_success, nullptr);
+ __ check_klass_subtype_slow_path(sub_klass, super_klass, tmp1, tmp2, &L_success, nullptr);
// Fall through on failure!
__ BIND(L_miss);
@@ -1578,8 +1580,8 @@ class StubGenerator: public StubCodeGenerator {
bs->copy_store_at(_masm, decorators, T_OBJECT, element_size,
Address(to, 0), copied_oop,
gct1, gct2, gct3);
- __ add(to, to, UseCompressedOops ? 4 : 8);
- __ sub(count, count, 1);
+ __ addi(to, to, UseCompressedOops ? 4 : 8);
+ __ subi(count, count, 1);
__ beqz(count, L_do_card_marks);
// ======== loop entry is here ========
@@ -1587,11 +1589,22 @@ class StubGenerator: public StubCodeGenerator {
bs->copy_load_at(_masm, decorators, T_OBJECT, element_size,
copied_oop, Address(from, 0),
gct1);
- __ add(from, from, UseCompressedOops ? 4 : 8);
+ __ addi(from, from, UseCompressedOops ? 4 : 8);
__ beqz(copied_oop, L_store_element);
__ load_klass(r9_klass, copied_oop);// query the object klass
- generate_type_check(r9_klass, ckoff, ckval, L_store_element);
+
+ BLOCK_COMMENT("type_check:");
+ generate_type_check(r9_klass, /*sub_klass*/
+ ckoff, /*super_check_offset*/
+ ckval, /*super_klass*/
+ x10, /*result*/
+ gct1, /*tmp1*/
+ gct2, /*tmp2*/
+ L_store_element);
+
+ // Fall through on failure!
+
// ======== end loop ========
// It was a real error; we must depend on the caller to finish the job.
@@ -1600,7 +1613,7 @@ class StubGenerator: public StubCodeGenerator {
// their number to the caller.
__ sub(count, count_save, count); // K = partially copied oop count
- __ xori(count, count, -1); // report (-1^K) to caller
+ __ xori(count, count, -1); // report (-1^K) to caller
__ beqz(count, L_done_pop);
__ BIND(L_do_card_marks);
@@ -1929,9 +1942,9 @@ class StubGenerator: public StubCodeGenerator {
t1, L_failed);
__ shadd(from, src_pos, src, t0, LogBytesPerHeapOop);
- __ add(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
+ __ addi(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
__ shadd(to, dst_pos, dst, t0, LogBytesPerHeapOop);
- __ add(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
+ __ addi(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
__ sext(count, scratch_length, 32); // length
__ BIND(L_plain_copy);
__ j(RuntimeAddress(oop_copy_entry));
@@ -1952,9 +1965,9 @@ class StubGenerator: public StubCodeGenerator {
// Marshal the base address arguments now, freeing registers.
__ shadd(from, src_pos, src, t0, LogBytesPerHeapOop);
- __ add(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
+ __ addi(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
__ shadd(to, dst_pos, dst, t0, LogBytesPerHeapOop);
- __ add(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
+ __ addi(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
__ sext(count, length, 32); // length (reloaded)
const Register sco_temp = c_rarg3; // this register is free now
assert_different_registers(from, to, count, sco_temp,
@@ -1965,7 +1978,7 @@ class StubGenerator: public StubCodeGenerator {
__ lwu(sco_temp, Address(dst_klass, sco_offset));
// Smashes t0, t1
- generate_type_check(scratch_src_klass, sco_temp, dst_klass, L_plain_copy);
+ generate_type_check(scratch_src_klass, sco_temp, dst_klass, noreg, noreg, noreg, L_plain_copy);
// Fetch destination element klass from the ObjArrayKlass header.
int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
@@ -2068,7 +2081,7 @@ class StubGenerator: public StubCodeGenerator {
__ beqz(t0, L_skip_align1);
__ sb(value, Address(to, 0));
__ addi(to, to, 1);
- __ addiw(count, count, -1);
+ __ subiw(count, count, 1);
__ bind(L_skip_align1);
// Fallthrough
case T_SHORT:
@@ -2077,7 +2090,7 @@ class StubGenerator: public StubCodeGenerator {
__ beqz(t0, L_skip_align2);
__ sh(value, Address(to, 0));
__ addi(to, to, 2);
- __ addiw(count, count, -(2 >> shift));
+ __ subiw(count, count, 2 >> shift);
__ bind(L_skip_align2);
// Fallthrough
case T_INT:
@@ -2086,7 +2099,7 @@ class StubGenerator: public StubCodeGenerator {
__ beqz(t0, L_skip_align4);
__ sw(value, Address(to, 0));
__ addi(to, to, 4);
- __ addiw(count, count, -(4 >> shift));
+ __ subiw(count, count, 4 >> shift);
__ bind(L_skip_align4);
break;
default: ShouldNotReachHere();
@@ -2500,7 +2513,7 @@ class StubGenerator: public StubCodeGenerator {
__ mv(isLU ? tmp1 : tmp2, tmp3);
__ addi(str1, str1, isLU ? wordSize / 2 : wordSize);
__ addi(str2, str2, isLU ? wordSize : wordSize / 2);
- __ sub(cnt2, cnt2, wordSize / 2); // Already loaded 4 symbols
+ __ subi(cnt2, cnt2, wordSize / 2); // Already loaded 4 symbols
__ xorr(tmp3, tmp1, tmp2);
__ bnez(tmp3, CALCULATE_DIFFERENCE);
@@ -2523,10 +2536,10 @@ class StubGenerator: public StubCodeGenerator {
__ addi(cnt2, cnt2, -wordSize / 2);
// we are now 8-bytes aligned on strL
- __ sub(cnt2, cnt2, wordSize * 2);
+ __ subi(cnt2, cnt2, wordSize * 2);
__ bltz(cnt2, TAIL);
__ bind(SMALL_LOOP); // smaller loop
- __ sub(cnt2, cnt2, wordSize * 2);
+ __ subi(cnt2, cnt2, wordSize * 2);
compare_string_8_x_LU(tmpL, tmpU, strL, strU, CALCULATE_DIFFERENCE);
compare_string_8_x_LU(tmpL, tmpU, strL, strU, CALCULATE_DIFFERENCE);
__ bgez(cnt2, SMALL_LOOP);
@@ -2540,11 +2553,11 @@ class StubGenerator: public StubCodeGenerator {
__ bltz(t0, LOAD_LAST);
// remaining characters are greater than or equals to 8, we can do one compare_string_8_x_LU
compare_string_8_x_LU(tmpL, tmpU, strL, strU, CALCULATE_DIFFERENCE);
- __ addi(cnt2, cnt2, -wordSize);
+ __ subi(cnt2, cnt2, wordSize);
__ beqz(cnt2, DONE); // no character left
__ bind(LOAD_LAST); // cnt2 = 1..7 characters left
- __ addi(cnt2, cnt2, -wordSize); // cnt2 is now an offset in strL which points to last 8 bytes
+ __ subi(cnt2, cnt2, wordSize); // cnt2 is now an offset in strL which points to last 8 bytes
__ slli(t0, cnt2, 1); // t0 is now an offset in strU which points to last 16 bytes
__ add(strL, strL, cnt2); // Address of last 8 bytes in Latin1 string
__ add(strU, strU, t0); // Address of last 16 bytes in UTF-16 string
@@ -2610,9 +2623,9 @@ class StubGenerator: public StubCodeGenerator {
__ set_last_Java_frame(sp, fp, ra);
__ enter();
- __ add(t1, sp, wordSize);
+ __ addi(t1, sp, wordSize);
- __ sub(sp, sp, 4 * wordSize);
+ __ subi(sp, sp, 4 * wordSize);
__ push_call_clobbered_registers();
@@ -2665,22 +2678,22 @@ class StubGenerator: public StubCodeGenerator {
// cnt1/cnt2 contains amount of characters to compare. cnt1 can be re-used
// update cnt2 counter with already loaded 8 bytes
- __ sub(cnt2, cnt2, wordSize / (isLL ? 1 : 2));
+ __ subi(cnt2, cnt2, wordSize / (isLL ? 1 : 2));
// update pointers, because of previous read
- __ add(str1, str1, wordSize);
- __ add(str2, str2, wordSize);
+ __ addi(str1, str1, wordSize);
+ __ addi(str2, str2, wordSize);
// less than 16 bytes left?
- __ sub(cnt2, cnt2, isLL ? 16 : 8);
+ __ subi(cnt2, cnt2, isLL ? 16 : 8);
__ push_reg(spilled_regs, sp);
__ bltz(cnt2, TAIL);
__ bind(SMALL_LOOP);
compare_string_16_bytes_same(DIFF, DIFF2);
- __ sub(cnt2, cnt2, isLL ? 16 : 8);
+ __ subi(cnt2, cnt2, isLL ? 16 : 8);
__ bgez(cnt2, SMALL_LOOP);
__ bind(TAIL);
__ addi(cnt2, cnt2, isLL ? 16 : 8);
__ beqz(cnt2, LAST_CHECK_AND_LENGTH_DIFF);
- __ sub(cnt2, cnt2, isLL ? 8 : 4);
+ __ subi(cnt2, cnt2, isLL ? 8 : 4);
__ blez(cnt2, CHECK_LAST);
__ xorr(tmp4, tmp1, tmp2);
__ bnez(tmp4, DIFF);
@@ -2688,7 +2701,7 @@ class StubGenerator: public StubCodeGenerator {
__ addi(str1, str1, 8);
__ ld(tmp2, Address(str2));
__ addi(str2, str2, 8);
- __ sub(cnt2, cnt2, isLL ? 8 : 4);
+ __ subi(cnt2, cnt2, isLL ? 8 : 4);
__ bind(CHECK_LAST);
if (!isLL) {
__ add(cnt2, cnt2, cnt2); // now in bytes
@@ -2801,7 +2814,7 @@ class StubGenerator: public StubCodeGenerator {
if (needle_isL != haystack_isL) {
__ mv(tmp, ch1);
}
- __ sub(haystack_len, haystack_len, wordSize / haystack_chr_size - 1);
+ __ subi(haystack_len, haystack_len, wordSize / haystack_chr_size - 1);
__ blez(haystack_len, L_SMALL);
if (needle_isL != haystack_isL) {
@@ -2817,9 +2830,9 @@ class StubGenerator: public StubCodeGenerator {
// search first char of needle, if success, goto L_HAS_ZERO;
__ bnez(match_mask, L_HAS_ZERO);
- __ sub(haystack_len, haystack_len, wordSize / haystack_chr_size);
- __ add(result, result, wordSize / haystack_chr_size);
- __ add(haystack, haystack, wordSize);
+ __ subi(haystack_len, haystack_len, wordSize / haystack_chr_size);
+ __ addi(result, result, wordSize / haystack_chr_size);
+ __ addi(haystack, haystack, wordSize);
__ bltz(haystack_len, L_POST_LOOP);
__ bind(L_LOOP);
@@ -2828,9 +2841,9 @@ class StubGenerator: public StubCodeGenerator {
__ bnez(match_mask, L_HAS_ZERO);
__ bind(L_LOOP_PROCEED);
- __ sub(haystack_len, haystack_len, wordSize / haystack_chr_size);
- __ add(haystack, haystack, wordSize);
- __ add(result, result, wordSize / haystack_chr_size);
+ __ subi(haystack_len, haystack_len, wordSize / haystack_chr_size);
+ __ addi(haystack, haystack, wordSize);
+ __ addi(result, result, wordSize / haystack_chr_size);
__ bgez(haystack_len, L_LOOP);
__ bind(L_POST_LOOP);
@@ -2879,7 +2892,7 @@ class StubGenerator: public StubCodeGenerator {
__ shadd(ch2, trailing_zeros, haystack, ch2, haystack_chr_shift);
needle_isL ? __ lbu(first, Address(first)) : __ lhu(first, Address(first));
haystack_isL ? __ lbu(ch2, Address(ch2)) : __ lhu(ch2, Address(ch2));
- __ add(trailing_zeros, trailing_zeros, 1);
+ __ addi(trailing_zeros, trailing_zeros, 1);
__ bge(trailing_zeros, needle_len, L_SMALL_CMP_LOOP_LAST_CMP);
__ beq(first, ch2, L_SMALL_CMP_LOOP);
@@ -2888,8 +2901,8 @@ class StubGenerator: public StubCodeGenerator {
// count bits of trailing zero chars
__ ctzc_bits(trailing_zeros, match_mask, haystack_isL, tmp, ch2);
__ addi(trailing_zeros, trailing_zeros, haystack_isL ? 7 : 15);
- __ add(result, result, 1);
- __ add(haystack, haystack, haystack_chr_size);
+ __ addi(result, result, 1);
+ __ addi(haystack, haystack, haystack_chr_size);
__ j(L_SMALL_HAS_ZERO_LOOP);
__ align(OptoLoopAlignment);
@@ -2910,7 +2923,7 @@ class StubGenerator: public StubCodeGenerator {
__ addi(trailing_zeros, trailing_zeros, haystack_isL ? 7 : 15);
__ slli(needle_len, needle_len, BitsPerByte * wordSize / 2);
__ orr(haystack_len, haystack_len, needle_len); // restore needle_len(32bits)
- __ sub(result, result, 1); // array index from 0, so result -= 1
+ __ subi(result, result, 1); // array index from 0, so result -= 1
__ bind(L_HAS_ZERO_LOOP);
__ mv(needle_len, wordSize / haystack_chr_size);
@@ -2918,7 +2931,7 @@ class StubGenerator: public StubCodeGenerator {
__ bge(needle_len, ch2, L_CMP_LOOP_LAST_CMP2);
// load next 8 bytes from haystack, and increase result index
__ compute_index(haystack, trailing_zeros, match_mask, result, ch2, tmp, haystack_isL);
- __ add(result, result, 1);
+ __ addi(result, result, 1);
__ mv(trailing_zeros, wordSize / haystack_chr_size);
__ bne(ch1, ch2, L_CMP_LOOP_NOMATCH);
@@ -2928,7 +2941,7 @@ class StubGenerator: public StubCodeGenerator {
needle_isL ? __ lbu(needle_len, Address(needle_len)) : __ lhu(needle_len, Address(needle_len));
__ shadd(ch2, trailing_zeros, haystack, ch2, haystack_chr_shift);
haystack_isL ? __ lbu(ch2, Address(ch2)) : __ lhu(ch2, Address(ch2));
- __ add(trailing_zeros, trailing_zeros, 1); // next char index
+ __ addi(trailing_zeros, trailing_zeros, 1); // next char index
__ srli(tmp, haystack_len, BitsPerByte * wordSize / 2);
__ bge(trailing_zeros, tmp, L_CMP_LOOP_LAST_CMP);
__ beq(needle_len, ch2, L_CMP_LOOP);
@@ -2938,7 +2951,7 @@ class StubGenerator: public StubCodeGenerator {
// count bits of trailing zero chars
__ ctzc_bits(trailing_zeros, match_mask, haystack_isL, needle_len, ch2);
__ addi(trailing_zeros, trailing_zeros, haystack_isL ? 7 : 15);
- __ add(haystack, haystack, haystack_chr_size);
+ __ addi(haystack, haystack, haystack_chr_size);
__ j(L_HAS_ZERO_LOOP);
__ align(OptoLoopAlignment);
@@ -2949,7 +2962,7 @@ class StubGenerator: public StubCodeGenerator {
__ align(OptoLoopAlignment);
__ bind(L_CMP_LOOP_LAST_CMP2);
__ compute_index(haystack, trailing_zeros, match_mask, result, ch2, tmp, haystack_isL);
- __ add(result, result, 1);
+ __ addi(result, result, 1);
__ bne(ch1, ch2, L_CMP_LOOP_NOMATCH);
__ j(DONE);
@@ -3006,9 +3019,9 @@ class StubGenerator: public StubCodeGenerator {
Label L_success;
__ enter();
- __ lookup_secondary_supers_table(r_sub_klass, r_super_klass, result,
- r_array_base, r_array_length, r_array_index,
- r_bitmap, super_klass_index, /*stub_is_near*/true);
+ __ lookup_secondary_supers_table_const(r_sub_klass, r_super_klass, result,
+ r_array_base, r_array_length, r_array_index,
+ r_bitmap, super_klass_index, /*stub_is_near*/ true);
__ leave();
__ ret();
@@ -3310,7 +3323,7 @@ class StubGenerator: public StubCodeGenerator {
(this->*block)();
bind(odd);
(this->*block)();
- addi(count, count, -2);
+ subi(count, count, 2);
bgtz(count, loop);
bind(end);
}
@@ -3326,7 +3339,7 @@ class StubGenerator: public StubCodeGenerator {
(this->*block)(d, s, tmp);
bind(odd);
(this->*block)(d, s, tmp);
- addi(count, count, -2);
+ subi(count, count, 2);
bgtz(count, loop);
bind(end);
}
@@ -3378,7 +3391,7 @@ class StubGenerator: public StubCodeGenerator {
mul(Rlo_ab, Ra, Rb);
addi(Pa, Pa, wordSize);
ld(Ra, Address(Pa));
- addi(Pb, Pb, -wordSize);
+ subi(Pb, Pb, wordSize);
ld(Rb, Address(Pb));
acc(Rhi_mn, Rlo_mn, tmp0, tmp1, tmp2); // The pending m*n from the
// previous iteration.
@@ -3389,7 +3402,7 @@ class StubGenerator: public StubCodeGenerator {
mul(Rlo_mn, Rm, Rn);
addi(Pm, Pm, wordSize);
ld(Rm, Address(Pm));
- addi(Pn, Pn, -wordSize);
+ subi(Pn, Pn, wordSize);
ld(Rn, Address(Pn));
acc(Rhi_ab, Rlo_ab, tmp0, tmp1, tmp2);
}
@@ -3433,7 +3446,7 @@ class StubGenerator: public StubCodeGenerator {
//
// mul(Rlo_mn, Rm, Rn);
// cad(zr, tmp0, Rlo_mn);
- addi(t0, tmp0, -1);
+ subi(t0, tmp0, 1);
sltu(t0, t0, tmp0); // Set carry iff tmp0 is nonzero
cadc(tmp0, tmp1, Rhi_mn, t0);
adc(tmp1, tmp2, zr, t0);
@@ -3462,13 +3475,13 @@ class StubGenerator: public StubCodeGenerator {
// Rb = *--Pb;
// Rm = *++Pm;
// Rn = *--Pn;
- add(Pa, Pa, wordSize);
+ addi(Pa, Pa, wordSize);
ld(Ra, Address(Pa));
- add(Pb, Pb, -wordSize);
+ subi(Pb, Pb, wordSize);
ld(Rb, Address(Pb));
- add(Pm, Pm, wordSize);
+ addi(Pm, Pm, wordSize);
ld(Rm, Address(Pm));
- add(Pn, Pn, -wordSize);
+ subi(Pn, Pn, wordSize);
ld(Rn, Address(Pn));
mv(Rhi_mn, zr);
@@ -3523,15 +3536,15 @@ class StubGenerator: public StubCodeGenerator {
slli(Rn, i, LogBytesPerWord); // Rn as temp register
add(Rn, Pm_base, Rn);
sd(Rm, Address(Rn));
- add(i, i, 1);
+ addi(i, i, 1);
slli(Rn, i, LogBytesPerWord);
add(Rm, Pm_base, Rn);
ld(Rm, Address(Rm));
add(Rn, Pn_base, Rn);
ld(Rn, Address(Rn));
- sub(cnt, cnt, 1);
+ subi(cnt, cnt, 1);
} bnez(cnt, loop);
- addi(tmp0, tmp0, -1);
+ subi(tmp0, tmp0, 1);
add(tmp0, tmp0, t0);
} bnez(tmp0, again);
} bind(post);
@@ -3554,9 +3567,9 @@ class StubGenerator: public StubCodeGenerator {
}
// [63...0] -> [31...0][63...32]
void reverse1(Register d, Register s, Register tmp) {
- addi(s, s, -wordSize);
+ subi(s, s, wordSize);
ld(tmp, Address(s));
- ror_imm(tmp, tmp, 32, t0);
+ ror(tmp, tmp, 32, t0);
sd(tmp, Address(d));
addi(d, d, wordSize);
}
@@ -3591,7 +3604,7 @@ class StubGenerator: public StubCodeGenerator {
mul(Rlo_mn, Rm, Rn);
addi(Pm, Pm, wordSize);
ld(Rm, Address(Pm));
- addi(Pn, Pn, -wordSize);
+ subi(Pn, Pn, wordSize);
ld(Rn, Address(Pn));
}
@@ -3626,7 +3639,7 @@ class StubGenerator: public StubCodeGenerator {
//
// mul(Rlo_mn, Rm, Rn);
// cad(zr, tmp, Rlo_mn);
- addi(t0, tmp0, -1);
+ subi(t0, tmp0, 1);
sltu(t0, t0, tmp0); // Set carry iff tmp0 is nonzero
cadc(tmp0, tmp1, Rhi_mn, t0);
adc(tmp1, tmp2, zr, t0);
@@ -3732,7 +3745,7 @@ class StubGenerator: public StubCodeGenerator {
} block_comment(" } // j");
post1();
- addw(Ri, Ri, 1);
+ addiw(Ri, Ri, 1);
blt(Ri, Rlen, loop);
bind(end);
block_comment("} // i");
@@ -3750,12 +3763,12 @@ class StubGenerator: public StubCodeGenerator {
block_comment(" for (j = len*2-i-1; j; j--) {"); {
slliw(Rj, Rlen, 1);
subw(Rj, Rj, Ri);
- subw(Rj, Rj, 1);
+ subiw(Rj, Rj, 1);
unroll_2(Rj, &MontgomeryMultiplyGenerator::step);
} block_comment(" } // j");
post2(Ri, Rlen);
- addw(Ri, Ri, 1);
+ addiw(Ri, Ri, 1);
slli(t0, Rlen, 1);
blt(Ri, t0, loop);
bind(end);
@@ -3866,7 +3879,7 @@ class StubGenerator: public StubCodeGenerator {
block_comment(" for (j = (2*len-i-1)/2; j; j--) {"); {
slli(Rj, Rlen, 1);
sub(Rj, Rj, Ri);
- sub(Rj, Rj, 1);
+ subi(Rj, Rj, 1);
srliw(Rj, Rj, 1);
unroll_2(Rj, &MontgomeryMultiplyGenerator::step_squaring);
} block_comment(" } // j");
@@ -3928,7 +3941,7 @@ class StubGenerator: public StubCodeGenerator {
if (return_barrier) {
// preserve possible return value from a method returning to the return barrier
- __ sub(sp, sp, 2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ fsd(f10, Address(sp, 0 * wordSize));
__ sd(x10, Address(sp, 1 * wordSize));
}
@@ -3941,7 +3954,7 @@ class StubGenerator: public StubCodeGenerator {
// restore return value (no safepoint in the call to thaw, so even an oop return value should be OK)
__ ld(x10, Address(sp, 1 * wordSize));
__ fld(f10, Address(sp, 0 * wordSize));
- __ add(sp, sp, 2 * wordSize);
+ __ addi(sp, sp, 2 * wordSize);
}
#ifndef PRODUCT
@@ -3966,7 +3979,7 @@ class StubGenerator: public StubCodeGenerator {
if (return_barrier) {
// save original return value -- again
- __ sub(sp, sp, 2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ fsd(f10, Address(sp, 0 * wordSize));
__ sd(x10, Address(sp, 1 * wordSize));
}
@@ -3981,14 +3994,14 @@ class StubGenerator: public StubCodeGenerator {
// restore return value (no safepoint in the call to thaw, so even an oop return value should be OK)
__ ld(x10, Address(sp, 1 * wordSize));
__ fld(f10, Address(sp, 0 * wordSize));
- __ add(sp, sp, 2 * wordSize);
+ __ addi(sp, sp, 2 * wordSize);
} else {
__ mv(x10, zr); // return 0 (success) from doYield
}
// we're now on the yield frame (which is in an address above us b/c sp has been pushed down)
__ mv(fp, t1);
- __ sub(sp, t1, 2 * wordSize); // now pointing to fp spill
+ __ subi(sp, t1, 2 * wordSize); // now pointing to fp spill
if (return_barrier_exception) {
__ ld(c_rarg1, Address(fp, -1 * wordSize)); // return address
@@ -4445,7 +4458,7 @@ class StubGenerator: public StubCodeGenerator {
if (multi_block) {
int total_adds = vset_sew == Assembler::e32 ? 240 : 608;
__ addi(consts, consts, -total_adds);
- __ add(ofs, ofs, vset_sew == Assembler::e32 ? 64 : 128);
+ __ addi(ofs, ofs, vset_sew == Assembler::e32 ? 64 : 128);
__ ble(ofs, limit, multi_block_loop);
__ mv(c_rarg0, ofs); // return ofs
}
@@ -4523,7 +4536,7 @@ class StubGenerator: public StubCodeGenerator {
__ addw(a, a, value);
// a = Integer.rotateLeft(a, s) + b;
- __ rolw_imm(a, a, s);
+ __ rolw(a, a, s);
__ addw(a, a, b);
}
@@ -4939,7 +4952,7 @@ class StubGenerator: public StubCodeGenerator {
chacha20_quarter_round(work_vrs[2], work_vrs[7], work_vrs[8], work_vrs[13], tmp_vr);
chacha20_quarter_round(work_vrs[3], work_vrs[4], work_vrs[9], work_vrs[14], tmp_vr);
- __ sub(loop, loop, 1);
+ __ subi(loop, loop, 1);
__ bnez(loop, L_Rounds);
}
@@ -5028,7 +5041,7 @@ class StubGenerator: public StubCodeGenerator {
__ xorr(cur_w, cur_w, t1);
__ xorr(cur_w, cur_w, t0);
- __ rolw_imm(cur_w, cur_w, 1, t0);
+ __ rolw(cur_w, cur_w, 1, t0);
// copy the cur_w value to ws[8].
// now, valid w't values are at:
@@ -5048,7 +5061,7 @@ class StubGenerator: public StubCodeGenerator {
__ xorr(cur_w, ws[(idx-16)/2], ws[(idx-14)/2]);
__ xorr(cur_w, cur_w, t0);
- __ rolw_imm(cur_w, cur_w, 1, t0);
+ __ rolw(cur_w, cur_w, 1, t0);
// copy the cur_w value to ws[8]
__ zext(cur_w, cur_w, 32);
@@ -5113,7 +5126,7 @@ class StubGenerator: public StubCodeGenerator {
Register tmp3 = e;
__ add(tmp2, cur_k, tmp2);
__ add(tmp3, tmp3, tmp2);
- __ rolw_imm(tmp2, a, 5, t0);
+ __ rolw(tmp2, a, 5, t0);
sha1_f(tmp, b, c, d, round);
@@ -5128,7 +5141,7 @@ class StubGenerator: public StubCodeGenerator {
__ mv(e, d);
__ mv(d, c);
- __ rolw_imm(c, b, 30);
+ __ rolw(c, b, 30);
__ mv(b, a);
__ mv(a, tmp2);
}
@@ -5519,7 +5532,7 @@ class StubGenerator: public StubCodeGenerator {
__ sb(byte2, Address(dst, 2));
__ sb(combined24Bits, Address(dst, 3));
- __ sub(length, length, 3);
+ __ subi(length, length, 3);
__ addi(dst, dst, 4);
// loop back
__ bnez(length, ScalarLoop);
@@ -5796,7 +5809,7 @@ class StubGenerator: public StubCodeGenerator {
__ sb(byte1, Address(dst, 1));
__ sb(combined32Bits, Address(dst, 2));
- __ sub(length, length, 4);
+ __ subi(length, length, 4);
__ addi(dst, dst, 3);
// loop back
__ bnez(length, ScalarLoop);
@@ -5979,23 +5992,23 @@ class StubGenerator: public StubCodeGenerator {
__ beqz(len, L_combine);
// Jumping to L_by1_loop
- __ sub(len, len, step_1);
+ __ subi(len, len, step_1);
__ j(L_by1_loop);
__ bind(L_nmax);
__ sub(len, len, nmax);
- __ sub(count, nmax, 16);
+ __ subi(count, nmax, 16);
__ bltz(len, L_by16);
// Align L_nmax loop by 64
__ bind(L_nmax_loop_entry);
- __ sub(count, count, 32);
+ __ subi(count, count, 32);
__ bind(L_nmax_loop);
adler32_process_bytes(buff, s1, s2, vtable_64, vzero,
vbytes, vs1acc, vs2acc, temp0, temp1, temp2, temp3,
vtemp1, vtemp2, step_64, Assembler::m4);
- __ sub(count, count, step_64);
+ __ subi(count, count, step_64);
__ bgtz(count, L_nmax_loop);
// There are three iterations left to do
@@ -6012,7 +6025,7 @@ class StubGenerator: public StubCodeGenerator {
__ remuw(s2, s2, base);
__ sub(len, len, nmax);
- __ sub(count, nmax, 16);
+ __ subi(count, nmax, 16);
__ bgez(len, L_nmax_loop_entry);
__ bind(L_by16);
@@ -6026,7 +6039,7 @@ class StubGenerator: public StubCodeGenerator {
adler32_process_bytes(buff, s1, s2, vtable_64, vzero,
vbytes, vs1acc, vs2acc, temp0, temp1, temp2, temp3,
vtemp1, vtemp2, step_64, Assembler::m4);
- __ sub(len, len, step_64);
+ __ subi(len, len, step_64);
// By now the temp3 should still be 64
__ bge(len, temp3, L_by16_loop_unroll);
@@ -6034,11 +6047,11 @@ class StubGenerator: public StubCodeGenerator {
adler32_process_bytes(buff, s1, s2, vtable_16, vzero,
vbytes, vs1acc, vs2acc, temp0, temp1, temp2, temp3,
vtemp1, vtemp2, step_16, Assembler::m1);
- __ sub(len, len, step_16);
+ __ subi(len, len, step_16);
__ bgez(len, L_by16_loop);
__ bind(L_by1);
- __ add(len, len, 15);
+ __ addi(len, len, 15);
__ bltz(len, L_do_mod);
__ bind(L_by1_loop);
@@ -6046,7 +6059,7 @@ class StubGenerator: public StubCodeGenerator {
__ addi(buff, buff, step_1);
__ add(s1, temp0, s1);
__ add(s2, s2, s1);
- __ sub(len, len, step_1);
+ __ subi(len, len, step_1);
__ bgez(len, L_by1_loop);
__ bind(L_do_mod);
@@ -6228,7 +6241,7 @@ static const int64_t right_3_bits = right_n_bits(3);
// U_2:U_1:U_0: += (U_2 >> 2) * 5
poly1305_reduce(U_2, U_1, U_0, t1, t2);
- __ sub(length, length, BLOCK_LENGTH);
+ __ subi(length, length, BLOCK_LENGTH);
__ addi(input_start, input_start, BLOCK_LENGTH);
__ mv(t1, BLOCK_LENGTH);
__ bge(length, t1, LOOP);
diff --git a/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp b/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp
index 66a3ac3a994d5..ae2e81f509e10 100644
--- a/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp
+++ b/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
index bc67de54c4bc6..79de9becbaedc 100644
--- a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
+++ b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "compiler/disassembler.hpp"
@@ -85,8 +84,8 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
// c_rarg3: first stack arg - wordSize
// adjust sp
- __ addi(sp, c_rarg3, -18 * wordSize);
- __ addi(sp, sp, -2 * wordSize);
+ __ subi(sp, c_rarg3, 18 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ sd(ra, Address(sp, 0));
__ call_VM(noreg,
@@ -189,7 +188,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dsin());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_cos :
@@ -202,7 +201,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dcos());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_tan :
@@ -215,7 +214,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dtan());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_log :
@@ -228,7 +227,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_log10 :
@@ -241,7 +240,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog10());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_exp :
@@ -254,7 +253,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dexp());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_pow :
@@ -268,7 +267,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
} else {
fn = CAST_FROM_FN_PTR(address, StubRoutines::dpow());
}
- __ call(fn);
+ __ rt_call(fn);
__ mv(ra, x9);
break;
case Interpreter::java_lang_math_fmaD :
@@ -714,14 +713,14 @@ void TemplateInterpreterGenerator::lock_method() {
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
#ifdef ASSERT
- __ lwu(x10, access_flags);
+ __ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method doesn't need synchronization", false);
#endif // ASSERT
// get synchronization object
{
Label done;
- __ lwu(x10, access_flags);
+ __ load_unsigned_short(x10, access_flags);
__ andi(t0, x10, JVM_ACC_STATIC);
// get receiver (assume this is frequent case)
__ ld(x10, Address(xlocals, Interpreter::local_offset_in_bytes(0)));
@@ -742,8 +741,8 @@ void TemplateInterpreterGenerator::lock_method() {
// add space for monitor & lock
__ check_extended_sp();
- __ add(sp, sp, - entry_size); // add space for a monitor entry
- __ add(esp, esp, - entry_size);
+ __ sub(sp, sp, entry_size); // add space for a monitor entry
+ __ sub(esp, esp, entry_size);
__ sub(t0, sp, fp);
__ srai(t0, t0, Interpreter::logStackElementSize);
__ sd(t0, Address(fp, frame::interpreter_frame_extended_sp_offset * wordSize));
@@ -768,17 +767,17 @@ void TemplateInterpreterGenerator::lock_method() {
void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
// initialize fixed part of activation frame
if (native_call) {
- __ add(esp, sp, - 14 * wordSize);
+ __ subi(esp, sp, 14 * wordSize);
__ mv(xbcp, zr);
- __ add(sp, sp, - 14 * wordSize);
+ __ subi(sp, sp, 14 * wordSize);
// add 2 zero-initialized slots for native calls
__ sd(zr, Address(sp, 13 * wordSize));
__ sd(zr, Address(sp, 12 * wordSize));
} else {
- __ add(esp, sp, - 12 * wordSize);
+ __ subi(esp, sp, 12 * wordSize);
__ ld(t0, Address(xmethod, Method::const_offset())); // get ConstMethod
__ add(xbcp, t0, in_bytes(ConstMethod::codes_offset())); // get codebase
- __ add(sp, sp, - 12 * wordSize);
+ __ subi(sp, sp, 12 * wordSize);
}
__ sd(xbcp, Address(sp, wordSize));
__ mv(t0, frame::interpreter_frame_initial_sp_offset);
@@ -833,7 +832,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
} else {
// Make sure there is room for the exception oop pushed in case method throws
// an exception (see TemplateInterpreterGenerator::generate_throw_exception())
- __ sub(t0, sp, 2 * wordSize);
+ __ subi(t0, sp, 2 * wordSize);
__ sub(t1, t0, fp);
__ srai(t1, t1, Interpreter::logStackElementSize);
__ sd(t1, Address(sp, 5 * wordSize));
@@ -1018,7 +1017,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// compute beginning of parameters (xlocals)
__ shadd(xlocals, x12, esp, xlocals, 3);
- __ addi(xlocals, xlocals, -wordSize);
+ __ subi(xlocals, xlocals, wordSize);
// Pull SP back to minimum size: this avoids holes in the stack
__ andi(sp, esp, -16);
@@ -1028,7 +1027,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// make sure method is native & not abstract
#ifdef ASSERT
- __ lwu(x10, access_flags);
+ __ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_NATIVE, "tried to execute non-native method as native", false);
__ verify_access_flags(x10, JVM_ACC_ABSTRACT, "tried to execute abstract method in interpreter");
#endif
@@ -1066,7 +1065,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
} else {
// no synchronization necessary
#ifdef ASSERT
- __ lwu(x10, access_flags);
+ __ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method needs synchronization");
#endif
}
@@ -1130,7 +1129,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// pass mirror handle if static call
{
Label L;
- __ lwu(t, Address(xmethod, Method::access_flags_offset()));
+ __ load_unsigned_short(t, Address(xmethod, Method::access_flags_offset()));
__ test_bit(t0, t, exact_log2(JVM_ACC_STATIC));
__ beqz(t0, L);
// get mirror
@@ -1175,7 +1174,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
{
Label L;
__ lwu(t, Address(xthread, JavaThread::thread_state_offset()));
- __ addi(t0, zr, (u1)_thread_in_Java);
+ __ mv(t0, (u1)_thread_in_Java);
__ beq(t, t0, L);
__ stop("Wrong thread state in native stub");
__ bind(L);
@@ -1202,7 +1201,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
__ restore_cpu_control_state_after_jni(t0);
// make room for the pushes we're about to do
- __ sub(t0, esp, 4 * wordSize);
+ __ subi(t0, esp, 4 * wordSize);
__ andi(sp, t0, -16);
// NOTE: The order of these pushes is known to frame::interpreter_frame_result
@@ -1308,7 +1307,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
{
Label no_reguard;
__ lwu(t0, Address(xthread, in_bytes(JavaThread::stack_guard_state_offset())));
- __ addi(t1, zr, (u1)StackOverflow::stack_guard_yellow_reserved_disabled);
+ __ mv(t1, (u1)StackOverflow::stack_guard_yellow_reserved_disabled);
__ bne(t0, t1, no_reguard);
__ push_call_clobbered_registers();
@@ -1346,7 +1345,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// do unlocking if necessary
{
Label L;
- __ lwu(t, Address(xmethod, Method::access_flags_offset()));
+ __ load_unsigned_short(t, Address(xmethod, Method::access_flags_offset()));
__ test_bit(t0, t, exact_log2(JVM_ACC_SYNCHRONIZED));
__ beqz(t0, L);
// the code below should be shared with interpreter macro
@@ -1440,7 +1439,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// compute beginning of parameters (xlocals)
__ shadd(xlocals, x12, esp, t1, 3);
- __ add(xlocals, xlocals, -wordSize);
+ __ subi(xlocals, xlocals, wordSize);
// Make room for additional locals
__ slli(t1, x13, 3);
@@ -1458,8 +1457,8 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
__ blez(x13, exit); // do nothing if x13 <= 0
__ bind(loop);
__ sd(zr, Address(t0));
- __ add(t0, t0, wordSize);
- __ add(x13, x13, -1); // until everything initialized
+ __ addi(t0, t0, wordSize);
+ __ subi(x13, x13, 1); // until everything initialized
__ bnez(x13, loop);
__ bind(exit);
}
@@ -1472,7 +1471,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// make sure method is not native & not abstract
#ifdef ASSERT
- __ lwu(x10, access_flags);
+ __ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_NATIVE, "tried to execute native method as non-native");
__ verify_access_flags(x10, JVM_ACC_ABSTRACT, "tried to execute abstract method in interpreter");
#endif
@@ -1519,7 +1518,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
} else {
// no synchronization necessary
#ifdef ASSERT
- __ lwu(x10, access_flags);
+ __ load_unsigned_short(x10, access_flags);
__ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method needs synchronization");
#endif
}
@@ -1650,7 +1649,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
__ slli(x10, x10, Interpreter::logStackElementSize);
__ restore_locals();
__ sub(xlocals, xlocals, x10);
- __ add(xlocals, xlocals, wordSize);
+ __ addi(xlocals, xlocals, wordSize);
// Save these arguments
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address,
Deoptimization::
@@ -1745,7 +1744,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
// sp: expression stack of caller
// fp: fp of caller
// FIXME: There's no point saving ra here because VM calls don't trash it
- __ sub(sp, sp, 2 * wordSize);
+ __ subi(sp, sp, 2 * wordSize);
__ sd(x10, Address(sp, 0)); // save exception
__ sd(ra, Address(sp, wordSize)); // save return address
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address,
@@ -1754,7 +1753,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
__ mv(x11, x10); // save exception handler
__ ld(x10, Address(sp, 0)); // restore exception
__ ld(ra, Address(sp, wordSize)); // restore return address
- __ add(sp, sp, 2 * wordSize);
+ __ addi(sp, sp, 2 * wordSize);
// We might be returning to a deopt handler that expects x13 to
// contain the exception pc
__ mv(x13, ra);
diff --git a/src/hotspot/cpu/riscv/templateTable_riscv.cpp b/src/hotspot/cpu/riscv/templateTable_riscv.cpp
index e51604569f688..cb4ded3c330b6 100644
--- a/src/hotspot/cpu/riscv/templateTable_riscv.cpp
+++ b/src/hotspot/cpu/riscv/templateTable_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/disassembler.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
@@ -197,7 +196,7 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
Label L_fast_patch;
// if a breakpoint is present we can't rewrite the stream directly
__ load_unsigned_byte(temp_reg, at_bcp(0));
- __ addi(temp_reg, temp_reg, -Bytecodes::_breakpoint); // temp_reg is temporary register.
+ __ subi(temp_reg, temp_reg, Bytecodes::_breakpoint); // temp_reg is temporary register.
__ bnez(temp_reg, L_fast_patch);
// Let breakpoint table handling rewrite to quicker bytecode
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), xmethod, xbcp, bc_reg);
@@ -209,7 +208,7 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg,
Label L_okay;
__ load_unsigned_byte(temp_reg, at_bcp(0));
__ beq(temp_reg, bc_reg, L_okay);
- __ addi(temp_reg, temp_reg, -(int) Bytecodes::java_code(bc));
+ __ subi(temp_reg, temp_reg, (int)Bytecodes::java_code(bc));
__ beqz(temp_reg, L_okay);
__ stop("patching the wrong bytecode");
__ bind(L_okay);
@@ -737,7 +736,7 @@ void TemplateTable::iaload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2);
__ shadd(x10, x11, x10, t0, 2);
__ access_load_at(T_INT, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
__ sext(x10, x10, 32);
@@ -750,7 +749,7 @@ void TemplateTable::laload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3);
__ shadd(x10, x11, x10, t0, 3);
__ access_load_at(T_LONG, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -762,7 +761,7 @@ void TemplateTable::faload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2);
__ shadd(x10, x11, x10, t0, 2);
__ access_load_at(T_FLOAT, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -774,7 +773,7 @@ void TemplateTable::daload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3);
__ shadd(x10, x11, x10, t0, 3);
__ access_load_at(T_DOUBLE, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -786,7 +785,7 @@ void TemplateTable::aaload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
__ shadd(x10, x11, x10, t0, LogBytesPerHeapOop);
do_oop_load(_masm, Address(x10), x10, IS_ARRAY);
}
@@ -798,7 +797,7 @@ void TemplateTable::baload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0);
__ shadd(x10, x11, x10, t0, 0);
__ access_load_at(T_BYTE, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -810,7 +809,7 @@ void TemplateTable::caload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
__ shadd(x10, x11, x10, t0, 1);
__ access_load_at(T_CHAR, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -826,7 +825,7 @@ void TemplateTable::fast_icaload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11, kills t0
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1); // addi, max imm is 2^11
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1); // addi, max imm is 2^11
__ shadd(x10, x11, x10, t0, 1);
__ access_load_at(T_CHAR, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -838,7 +837,7 @@ void TemplateTable::saload() {
// x10: array
// x11: index
index_check(x10, x11); // leaves index in x11, kills t0
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_SHORT) >> 1);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_SHORT) >> 1);
__ shadd(x10, x11, x10, t0, 1);
__ access_load_at(T_SHORT, IN_HEAP | IS_ARRAY, x10, Address(x10), noreg, noreg);
}
@@ -1017,7 +1016,7 @@ void TemplateTable::iastore() {
// x11: index
// x13: array
index_check(x13, x11); // prefer index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2);
__ shadd(t0, x11, x13, t0, 2);
__ access_store_at(T_INT, IN_HEAP | IS_ARRAY, Address(t0, 0), x10, noreg, noreg, noreg);
}
@@ -1030,7 +1029,7 @@ void TemplateTable::lastore() {
// x11: index
// x13: array
index_check(x13, x11); // prefer index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3);
__ shadd(t0, x11, x13, t0, 3);
__ access_store_at(T_LONG, IN_HEAP | IS_ARRAY, Address(t0, 0), x10, noreg, noreg, noreg);
}
@@ -1043,7 +1042,7 @@ void TemplateTable::fastore() {
// x11: index
// x13: array
index_check(x13, x11); // prefer index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2);
__ shadd(t0, x11, x13, t0, 2);
__ access_store_at(T_FLOAT, IN_HEAP | IS_ARRAY, Address(t0, 0), noreg /* ftos */, noreg, noreg, noreg);
}
@@ -1056,7 +1055,7 @@ void TemplateTable::dastore() {
// x11: index
// x13: array
index_check(x13, x11); // prefer index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3);
__ shadd(t0, x11, x13, t0, 3);
__ access_store_at(T_DOUBLE, IN_HEAP | IS_ARRAY, Address(t0, 0), noreg /* dtos */, noreg, noreg, noreg);
}
@@ -1070,7 +1069,7 @@ void TemplateTable::aastore() {
__ ld(x13, at_tos_p2()); // array
index_check(x13, x12); // kills x11
- __ add(x14, x12, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
+ __ addi(x14, x12, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
__ shadd(x14, x14, x13, x14, LogBytesPerHeapOop);
Address element_address(x14, 0);
@@ -1112,7 +1111,7 @@ void TemplateTable::aastore() {
// Pop stack arguments
__ bind(done);
- __ add(esp, esp, 3 * Interpreter::stackElementSize);
+ __ addi(esp, esp, 3 * Interpreter::stackElementSize);
}
void TemplateTable::bastore() {
@@ -1134,7 +1133,7 @@ void TemplateTable::bastore() {
__ andi(x10, x10, 1); // if it is a T_BOOLEAN array, mask the stored value to 0/1
__ bind(L_skip);
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0);
__ add(x11, x13, x11);
__ access_store_at(T_BYTE, IN_HEAP | IS_ARRAY, Address(x11, 0), x10, noreg, noreg, noreg);
@@ -1148,7 +1147,7 @@ void TemplateTable::castore() {
// x11: index
// x13: array
index_check(x13, x11); // prefer index in x11
- __ add(x11, x11, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
+ __ addi(x11, x11, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1);
__ shadd(t0, x11, x13, t0, 1);
__ access_store_at(T_CHAR, IN_HEAP | IS_ARRAY, Address(t0, 0), x10, noreg, noreg, noreg);
}
@@ -1883,7 +1882,7 @@ void TemplateTable::ret() {
__ profile_ret(x11, x12);
__ ld(xbcp, Address(xmethod, Method::const_offset()));
__ add(xbcp, xbcp, x11);
- __ addi(xbcp, xbcp, in_bytes(ConstMethod::codes_offset()));
+ __ add(xbcp, xbcp, in_bytes(ConstMethod::codes_offset()));
__ dispatch_next(vtos, 0, /*generate_poll*/true);
}
@@ -1958,7 +1957,7 @@ void TemplateTable::fast_linearswitch() {
__ lw(t0, Address(t0, 2 * BytesPerInt));
__ beq(x10, t0, found);
__ bind(loop_entry);
- __ addi(x11, x11, -1);
+ __ subi(x11, x11, 1);
__ bgez(x11, loop);
// default case
__ profile_switch_default(x10);
@@ -2544,7 +2543,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notByte);
- __ sub(t0, tos_state, (u1)ztos);
+ __ subi(t0, tos_state, (u1)ztos);
__ bnez(t0, notBool);
// ztos (same code as btos)
@@ -2558,7 +2557,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notBool);
- __ sub(t0, tos_state, (u1)atos);
+ __ subi(t0, tos_state, (u1)atos);
__ bnez(t0, notObj);
// atos
do_oop_load(_masm, field, x10, IN_HEAP);
@@ -2569,7 +2568,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notObj);
- __ sub(t0, tos_state, (u1)itos);
+ __ subi(t0, tos_state, (u1)itos);
__ bnez(t0, notInt);
// itos
__ access_load_at(T_INT, IN_HEAP, x10, field, noreg, noreg);
@@ -2582,7 +2581,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notInt);
- __ sub(t0, tos_state, (u1)ctos);
+ __ subi(t0, tos_state, (u1)ctos);
__ bnez(t0, notChar);
// ctos
__ access_load_at(T_CHAR, IN_HEAP, x10, field, noreg, noreg);
@@ -2594,7 +2593,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notChar);
- __ sub(t0, tos_state, (u1)stos);
+ __ subi(t0, tos_state, (u1)stos);
__ bnez(t0, notShort);
// stos
__ access_load_at(T_SHORT, IN_HEAP, x10, field, noreg, noreg);
@@ -2606,7 +2605,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notShort);
- __ sub(t0, tos_state, (u1)ltos);
+ __ subi(t0, tos_state, (u1)ltos);
__ bnez(t0, notLong);
// ltos
__ access_load_at(T_LONG, IN_HEAP, x10, field, noreg, noreg);
@@ -2618,7 +2617,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ j(Done);
__ bind(notLong);
- __ sub(t0, tos_state, (u1)ftos);
+ __ subi(t0, tos_state, (u1)ftos);
__ bnez(t0, notFloat);
// ftos
__ access_load_at(T_FLOAT, IN_HEAP, noreg /* ftos */, field, noreg, noreg);
@@ -2631,7 +2630,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteContr
__ bind(notFloat);
#ifdef ASSERT
- __ sub(t0, tos_state, (u1)dtos);
+ __ subi(t0, tos_state, (u1)dtos);
__ bnez(t0, notDouble);
#endif
// dtos
@@ -2696,9 +2695,9 @@ void TemplateTable::jvmti_post_field_mod(Register cache, Register index, bool is
__ load_unsigned_byte(c_rarg3, Address(c_rarg2, in_bytes(ResolvedFieldEntry::type_offset())));
Label nope2, done, ok;
__ ld(c_rarg1, at_tos_p1()); // initially assume a one word jvalue
- __ sub(t0, c_rarg3, ltos);
+ __ subi(t0, c_rarg3, (u1)ltos);
__ beqz(t0, ok);
- __ sub(t0, c_rarg3, dtos);
+ __ subi(t0, c_rarg3, (u1)dtos);
__ bnez(t0, nope2);
__ bind(ok);
__ ld(c_rarg1, at_tos_p2()); // ltos (two word jvalue);
@@ -2772,7 +2771,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notByte);
- __ sub(t0, tos_state, (u1)ztos);
+ __ subi(t0, tos_state, (u1)ztos);
__ bnez(t0, notBool);
// ztos
@@ -2792,7 +2791,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notBool);
- __ sub(t0, tos_state, (u1)atos);
+ __ subi(t0, tos_state, (u1)atos);
__ bnez(t0, notObj);
// atos
@@ -2813,7 +2812,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notObj);
- __ sub(t0, tos_state, (u1)itos);
+ __ subi(t0, tos_state, (u1)itos);
__ bnez(t0, notInt);
// itos
@@ -2833,7 +2832,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notInt);
- __ sub(t0, tos_state, (u1)ctos);
+ __ subi(t0, tos_state, (u1)ctos);
__ bnez(t0, notChar);
// ctos
@@ -2853,7 +2852,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notChar);
- __ sub(t0, tos_state, (u1)stos);
+ __ subi(t0, tos_state, (u1)stos);
__ bnez(t0, notShort);
// stos
@@ -2873,7 +2872,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notShort);
- __ sub(t0, tos_state, (u1)ltos);
+ __ subi(t0, tos_state, (u1)ltos);
__ bnez(t0, notLong);
// ltos
@@ -2893,7 +2892,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
}
__ bind(notLong);
- __ sub(t0, tos_state, (u1)ftos);
+ __ subi(t0, tos_state, (u1)ftos);
__ bnez(t0, notFloat);
// ftos
@@ -2914,7 +2913,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
__ bind(notFloat);
#ifdef ASSERT
- __ sub(t0, tos_state, (u1)dtos);
+ __ subi(t0, tos_state, (u1)dtos);
__ bnez(t0, notDouble);
#endif
@@ -3207,7 +3206,7 @@ void TemplateTable::fast_xaccess(TosState state) {
__ bind(notVolatile);
}
- __ sub(xbcp, xbcp, 1);
+ __ subi(xbcp, xbcp, 1);
}
//-----------------------------------------------------------------------------
@@ -3521,7 +3520,7 @@ void TemplateTable::_new() {
__ la(t0, Address(t0, tags_offset));
__ lbu(t0, t0);
__ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore);
- __ sub(t1, t0, (u1)JVM_CONSTANT_Class);
+ __ subi(t1, t0, (u1)JVM_CONSTANT_Class);
__ bnez(t1, slow_case);
// get InstanceKlass
@@ -3558,9 +3557,9 @@ void TemplateTable::_new() {
// zero, go directly to the header initialization.
if (UseCompactObjectHeaders) {
assert(is_aligned(oopDesc::base_offset_in_bytes(), BytesPerLong), "oop base offset must be 8-byte-aligned");
- __ sub(x13, x13, oopDesc::base_offset_in_bytes());
+ __ subi(x13, x13, oopDesc::base_offset_in_bytes());
} else {
- __ sub(x13, x13, sizeof(oopDesc));
+ __ subi(x13, x13, sizeof(oopDesc));
}
__ beqz(x13, initialize_header);
@@ -3568,15 +3567,15 @@ void TemplateTable::_new() {
{
if (UseCompactObjectHeaders) {
assert(is_aligned(oopDesc::base_offset_in_bytes(), BytesPerLong), "oop base offset must be 8-byte-aligned");
- __ add(x12, x10, oopDesc::base_offset_in_bytes());
+ __ addi(x12, x10, oopDesc::base_offset_in_bytes());
} else {
- __ add(x12, x10, sizeof(oopDesc));
+ __ addi(x12, x10, sizeof(oopDesc));
}
Label loop;
__ bind(loop);
__ sd(zr, Address(x12));
- __ add(x12, x12, BytesPerLong);
- __ sub(x13, x13, BytesPerLong);
+ __ addi(x12, x12, BytesPerLong);
+ __ subi(x13, x13, BytesPerLong);
__ bnez(x13, loop);
}
@@ -3649,11 +3648,11 @@ void TemplateTable::checkcast() {
__ get_cpool_and_tags(x12, x13); // x12=cpool, x13=tags array
__ get_unsigned_2_byte_index_at_bcp(x9, 1); // x9=index
// See if bytecode has already been quicked
- __ add(t0, x13, Array::base_offset_in_bytes());
+ __ addi(t0, x13, Array::base_offset_in_bytes());
__ add(x11, t0, x9);
__ lbu(x11, x11);
__ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore);
- __ sub(t0, x11, (u1)JVM_CONSTANT_Class);
+ __ subi(t0, x11, (u1)JVM_CONSTANT_Class);
__ beqz(t0, quicked);
__ push(atos); // save receiver for result, and for GC
@@ -3704,11 +3703,11 @@ void TemplateTable::instanceof() {
__ get_cpool_and_tags(x12, x13); // x12=cpool, x13=tags array
__ get_unsigned_2_byte_index_at_bcp(x9, 1); // x9=index
// See if bytecode has already been quicked
- __ add(t0, x13, Array::base_offset_in_bytes());
+ __ addi(t0, x13, Array::base_offset_in_bytes());
__ add(x11, t0, x9);
__ lbu(x11, x11);
__ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore);
- __ sub(t0, x11, (u1)JVM_CONSTANT_Class);
+ __ subi(t0, x11, (u1)JVM_CONSTANT_Class);
__ beqz(t0, quicked);
__ push(atos); // save receiver for result, and for GC
@@ -3884,7 +3883,7 @@ void TemplateTable::monitorenter() {
__ ld(c_rarg2, Address(c_rarg3, entry_size)); // load expression stack
// word from old location
__ sd(c_rarg2, Address(c_rarg3, 0)); // and store it at new location
- __ add(c_rarg3, c_rarg3, wordSize); // advance to next word
+ __ addi(c_rarg3, c_rarg3, wordSize); // advance to next word
__ bind(entry);
__ bne(c_rarg3, c_rarg1, loop); // check if bottom reached.if not at bottom
// then copy next word
@@ -3979,7 +3978,7 @@ void TemplateTable::multianewarray() {
// last dim is on top of stack; we want address of first one:
// first_addr = last_addr + (ndims - 1) * wordSize
__ shadd(c_rarg1, x10, esp, c_rarg1, 3);
- __ sub(c_rarg1, c_rarg1, wordSize);
+ __ subi(c_rarg1, c_rarg1, wordSize);
call_VM(x10,
CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray),
c_rarg1);
diff --git a/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp b/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp
index 8fb0530d98fa1..fa6fe60b71e3d 100644
--- a/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp
+++ b/src/hotspot/cpu/riscv/upcallLinker_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.hpp"
#include "logging/logStream.hpp"
diff --git a/src/hotspot/cpu/riscv/vm_version_riscv.cpp b/src/hotspot/cpu/riscv/vm_version_riscv.cpp
index a30ae45160611..5d7ed4bda601c 100644
--- a/src/hotspot/cpu/riscv/vm_version_riscv.cpp
+++ b/src/hotspot/cpu/riscv/vm_version_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2023, Rivos Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/cpu/riscv/vm_version_riscv.hpp b/src/hotspot/cpu/riscv/vm_version_riscv.hpp
index 59b41892fef0c..5f51970edf111 100644
--- a/src/hotspot/cpu/riscv/vm_version_riscv.hpp
+++ b/src/hotspot/cpu/riscv/vm_version_riscv.hpp
@@ -115,6 +115,7 @@ class VM_Version : public Abstract_VM_Version {
// Zbs Single-bit instructions
//
// Zfh Half-Precision Floating-Point instructions
+ // Zfhmin Minimal Half-Precision Floating-Point instructions
//
// Zicond Conditional operations
//
@@ -157,7 +158,9 @@ class VM_Version : public Abstract_VM_Version {
decl(ext_Zbs , "Zbs" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \
decl(ext_Zcb , "Zcb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZcb)) \
decl(ext_Zfh , "Zfh" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfh)) \
+ decl(ext_Zfhmin , "Zfhmin" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZfhmin)) \
decl(ext_Zicsr , "Zicsr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
+ decl(ext_Zicntr , "Zicntr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
decl(ext_Zifencei , "Zifencei" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \
decl(ext_Zic64b , "Zic64b" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZic64b)) \
decl(ext_Ztso , "Ztso" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZtso)) \
@@ -223,6 +226,7 @@ class VM_Version : public Abstract_VM_Version {
RV_ENABLE_EXTENSION(UseZbb) \
RV_ENABLE_EXTENSION(UseZbs) \
RV_ENABLE_EXTENSION(UseZcb) \
+ RV_ENABLE_EXTENSION(UseZfhmin) \
RV_ENABLE_EXTENSION(UseZic64b) \
RV_ENABLE_EXTENSION(UseZicbom) \
RV_ENABLE_EXTENSION(UseZicbop) \
diff --git a/src/hotspot/cpu/riscv/vmreg_riscv.cpp b/src/hotspot/cpu/riscv/vmreg_riscv.cpp
index ce11df57f84f3..dfc55062344ee 100644
--- a/src/hotspot/cpu/riscv/vmreg_riscv.cpp
+++ b/src/hotspot/cpu/riscv/vmreg_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
#include "vmreg_riscv.inline.hpp"
diff --git a/src/hotspot/cpu/riscv/vtableStubs_riscv.cpp b/src/hotspot/cpu/riscv/vtableStubs_riscv.cpp
index 573c5d901fcfd..d889141c74437 100644
--- a/src/hotspot/cpu/riscv/vtableStubs_riscv.cpp
+++ b/src/hotspot/cpu/riscv/vtableStubs_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/s390/abstractInterpreter_s390.cpp b/src/hotspot/cpu/s390/abstractInterpreter_s390.cpp
index c24c2b56bf7a9..bddac3953a1e4 100644
--- a/src/hotspot/cpu/s390/abstractInterpreter_s390.cpp
+++ b/src/hotspot/cpu/s390/abstractInterpreter_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/constMethod.hpp"
#include "oops/klass.inline.hpp"
diff --git a/src/hotspot/cpu/s390/assembler_s390.cpp b/src/hotspot/cpu/s390/assembler_s390.cpp
index 63cc7e28d5919..9a8ba8f296336 100644
--- a/src/hotspot/cpu/s390/assembler_s390.cpp
+++ b/src/hotspot/cpu/s390/assembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "compiler/disassembler.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/cpu/s390/assembler_s390.hpp b/src/hotspot/cpu/s390/assembler_s390.hpp
index 1ba90b69d1748..c0cee5bd55537 100644
--- a/src/hotspot/cpu/s390/assembler_s390.hpp
+++ b/src/hotspot/cpu/s390/assembler_s390.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -140,7 +140,7 @@ class RelAddr {
return 0; // Yet unknown branch destination.
} else {
guarantee(is_in_range_of_RelAddr(target, pc, shortForm),
- "target not within reach at " INTPTR_FORMAT ", distance = " INTX_FORMAT, p2i(pc), (target - pc) );
+ "target not within reach at " INTPTR_FORMAT ", distance = %zd", p2i(pc), (target - pc) );
return (int)((target - pc)>>1);
}
}
diff --git a/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp b/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp
index e01e4458e38d3..c858a4b8cb14b 100644
--- a/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/s390/c1_FrameMap_s390.cpp b/src/hotspot/cpu/s390/c1_FrameMap_s390.cpp
index 802d794c4e061..9fa6da8341ff8 100644
--- a/src/hotspot/cpu/s390/c1_FrameMap_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_FrameMap_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp
index bb0494dc4785a..48bd5c3afdee2 100644
--- a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_LIRAssembler.hpp"
diff --git a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp
index c12f883ab58e2..bce2f142aef8c 100644
--- a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_Instruction.hpp"
diff --git a/src/hotspot/cpu/s390/c1_LIR_s390.cpp b/src/hotspot/cpu/s390/c1_LIR_s390.cpp
index 4788a398de8ab..3d36390a5ce52 100644
--- a/src/hotspot/cpu/s390/c1_LIR_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_LIR_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
diff --git a/src/hotspot/cpu/s390/c1_LinearScan_s390.cpp b/src/hotspot/cpu/s390/c1_LinearScan_s390.cpp
index f48496f34d3ee..a5edd65ada845 100644
--- a/src/hotspot/cpu/s390/c1_LinearScan_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_LinearScan_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LinearScan.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp
index bc269f9353ceb..5691a2055b3a2 100644
--- a/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
diff --git a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp
index 0ada76ccef780..34b21ff3d15ca 100644
--- a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp
+++ b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp
index faa24bc880796..485efec6b9b68 100644
--- a/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/c2_MacroAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "opto/c2_MacroAssembler.hpp"
diff --git a/src/hotspot/cpu/s390/c2_init_s390.cpp b/src/hotspot/cpu/s390/c2_init_s390.cpp
index d2fa9f07f7897..ad18c71ee2f8b 100644
--- a/src/hotspot/cpu/s390/c2_init_s390.cpp
+++ b/src/hotspot/cpu/s390/c2_init_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
diff --git a/src/hotspot/cpu/s390/compiledIC_s390.cpp b/src/hotspot/cpu/s390/compiledIC_s390.cpp
index 7891e85b9115e..8501a0cb346a1 100644
--- a/src/hotspot/cpu/s390/compiledIC_s390.cpp
+++ b/src/hotspot/cpu/s390/compiledIC_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/cpu/s390/compressedKlass_s390.cpp b/src/hotspot/cpu/s390/compressedKlass_s390.cpp
index 868df0f02d7cb..06077b48f99a1 100644
--- a/src/hotspot/cpu/s390/compressedKlass_s390.cpp
+++ b/src/hotspot/cpu/s390/compressedKlass_s390.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "oops/compressedKlass.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/cpu/s390/downcallLinker_s390.cpp b/src/hotspot/cpu/s390/downcallLinker_s390.cpp
index 85ddc5bf18548..ad375fb20ce82 100644
--- a/src/hotspot/cpu/s390/downcallLinker_s390.cpp
+++ b/src/hotspot/cpu/s390/downcallLinker_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp
index b716b9126f2c8..1ad0570bad8ab 100644
--- a/src/hotspot/cpu/s390/foreignGlobals_s390.cpp
+++ b/src/hotspot/cpu/s390/foreignGlobals_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -22,7 +22,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/vmreg.inline.hpp"
#include "runtime/jniHandles.hpp"
diff --git a/src/hotspot/cpu/s390/frame_s390.cpp b/src/hotspot/cpu/s390/frame_s390.cpp
index f461aa67b08f2..01ed22c7d8620 100644
--- a/src/hotspot/cpu/s390/frame_s390.cpp
+++ b/src/hotspot/cpu/s390/frame_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp
index 544c82d34a769..2054c3db36c50 100644
--- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "registerSaver_s390.hpp"
#include "gc/g1/g1CardTable.hpp"
diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp
index 550bc9ba10938..d6fe10ac9c232 100644
--- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp
index a912cfcaf8253..85dcc0a4e73f3 100644
--- a/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp
+++ b/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/nativeInst.hpp"
diff --git a/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp
index 760f77951fa03..f8f1fe839d232 100644
--- a/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
diff --git a/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp
index f44a72c27abc1..4d37ae2e4ce5f 100644
--- a/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp
@@ -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.
* Copyright (c) 2018, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
#include "runtime/jniHandles.hpp"
diff --git a/src/hotspot/cpu/s390/interp_masm_s390.cpp b/src/hotspot/cpu/s390/interp_masm_s390.cpp
index 5e80817aaba7b..cb335e407347b 100644
--- a/src/hotspot/cpu/s390/interp_masm_s390.cpp
+++ b/src/hotspot/cpu/s390/interp_masm_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -25,7 +25,6 @@
// Major contributions by AHa, AS, JL, ML.
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
@@ -780,7 +779,7 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
get_method(R_method);
verify_oop(Z_tos, state);
push(state); // Save tos/result.
- testbit(method2_(R_method, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
+ testbit_ushort(method2_(R_method, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
z_bfalse(unlocked);
// Don't unlock anything if the _do_not_unlock_if_synchronized flag
diff --git a/src/hotspot/cpu/s390/interpreterRT_s390.cpp b/src/hotspot/cpu/s390/interpreterRT_s390.cpp
index 0f3c18144e9cb..dd5bdc071fc57 100644
--- a/src/hotspot/cpu/s390/interpreterRT_s390.cpp
+++ b/src/hotspot/cpu/s390/interpreterRT_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
diff --git a/src/hotspot/cpu/s390/jniFastGetField_s390.cpp b/src/hotspot/cpu/s390/jniFastGetField_s390.cpp
index 01b0bd528a8aa..f1c8095caa668 100644
--- a/src/hotspot/cpu/s390/jniFastGetField_s390.cpp
+++ b/src/hotspot/cpu/s390/jniFastGetField_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp
index a069d6ceafbf0..83a5c61bfc6c1 100644
--- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* Copyright 2024 IBM Corporation. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
@@ -1015,6 +1014,18 @@ void MacroAssembler::load_and_test_long(Register dst, const Address &a) {
z_ltg(dst, a);
}
+// Test a bit in memory for 2 byte datatype.
+void MacroAssembler::testbit_ushort(const Address &a, unsigned int bit) {
+ assert(a.index() == noreg, "no index reg allowed in testbit");
+ if (bit <= 7) {
+ z_tm(a.disp() + 1, a.base(), 1 << bit);
+ } else if (bit <= 15) {
+ z_tm(a.disp() + 0, a.base(), 1 << (bit - 8));
+ } else {
+ ShouldNotReachHere();
+ }
+}
+
// Test a bit in memory.
void MacroAssembler::testbit(const Address &a, unsigned int bit) {
assert(a.index() == noreg, "no index reg allowed in testbit");
diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.hpp
index 159688128189a..d45f1321e0f28 100644
--- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* Copyright (c) 2024 IBM Corporation. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -199,6 +199,7 @@ class MacroAssembler: public Assembler {
// Test a bit in memory. Result is reflected in CC.
void testbit(const Address &a, unsigned int bit);
+ void testbit_ushort(const Address &a, unsigned int bit);
// Test a bit in a register. Result is reflected in CC.
void testbit(Register r, unsigned int bitPos);
diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.inline.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.inline.hpp
index d81562d9e9af0..72724fb66d110 100644
--- a/src/hotspot/cpu/s390/macroAssembler_s390.inline.hpp
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -75,7 +75,7 @@ inline void MacroAssembler::load_address(Register d, const Address &a) {
} else if (Displacement::is_validDisp(a.disp())) {
z_lay(d, a.disp(), a.indexOrR0(), a.baseOrR0());
} else {
- guarantee(false, "displacement = " SIZE_FORMAT_X ", out of range for LA/LAY", a.disp());
+ guarantee(false, "displacement = 0x%zx, out of range for LA/LAY", a.disp());
}
}
diff --git a/src/hotspot/cpu/s390/methodHandles_s390.cpp b/src/hotspot/cpu/s390/methodHandles_s390.cpp
index b2071e28478ea..e3de6d911be06 100644
--- a/src/hotspot/cpu/s390/methodHandles_s390.cpp
+++ b/src/hotspot/cpu/s390/methodHandles_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/cpu/s390/nativeInst_s390.cpp b/src/hotspot/cpu/s390/nativeInst_s390.cpp
index 6a6a774dfde58..9990c225a8986 100644
--- a/src/hotspot/cpu/s390/nativeInst_s390.cpp
+++ b/src/hotspot/cpu/s390/nativeInst_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -25,7 +25,6 @@
// Major contributions by JL, LS
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_s390.hpp"
diff --git a/src/hotspot/cpu/s390/register_s390.cpp b/src/hotspot/cpu/s390/register_s390.cpp
index 7292da43e5e0e..912984c5873dc 100644
--- a/src/hotspot/cpu/s390/register_s390.cpp
+++ b/src/hotspot/cpu/s390/register_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_s390.hpp"
const char* Register::name() const {
diff --git a/src/hotspot/cpu/s390/relocInfo_s390.cpp b/src/hotspot/cpu/s390/relocInfo_s390.cpp
index 8afd80df6cee6..fdaf00e2bc34a 100644
--- a/src/hotspot/cpu/s390/relocInfo_s390.cpp
+++ b/src/hotspot/cpu/s390/relocInfo_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_s390.hpp"
diff --git a/src/hotspot/cpu/s390/runtime_s390.cpp b/src/hotspot/cpu/s390/runtime_s390.cpp
index 18f40e87876c7..dfaf73b9a7c24 100644
--- a/src/hotspot/cpu/s390/runtime_s390.cpp
+++ b/src/hotspot/cpu/s390/runtime_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/macroAssembler.inline.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp
index 2396a2a71059f..9716a5d71b3e6 100644
--- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp
+++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/debugInfoRec.hpp"
#include "code/vtableStubs.hpp"
@@ -2395,7 +2394,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
Label L_skip_barrier;
{ // Bypass the barrier for non-static methods
- __ testbit(Address(Z_method, Method::access_flags_offset()), JVM_ACC_STATIC_BIT);
+ __ testbit_ushort(Address(Z_method, Method::access_flags_offset()), JVM_ACC_STATIC_BIT);
__ z_bfalse(L_skip_barrier); // non-static
}
diff --git a/src/hotspot/cpu/s390/stubGenerator_s390.cpp b/src/hotspot/cpu/s390/stubGenerator_s390.cpp
index 0ff7dcbeed2f7..9e82d42e077b4 100644
--- a/src/hotspot/cpu/s390/stubGenerator_s390.cpp
+++ b/src/hotspot/cpu/s390/stubGenerator_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "registerSaver_s390.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/s390/stubRoutines_s390.cpp b/src/hotspot/cpu/s390/stubRoutines_s390.cpp
index 2a60f71557c71..815cffd3f72a6 100644
--- a/src/hotspot/cpu/s390/stubRoutines_s390.cpp
+++ b/src/hotspot/cpu/s390/stubRoutines_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
diff --git a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp
index 1c4089d5beb07..c40be5edec754 100644
--- a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp
+++ b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "compiler/disassembler.hpp"
@@ -164,7 +163,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
// Therefore add 3 to address that byte within "_flags".
// Reload method. VM call above may have destroyed register contents
__ get_method(method);
- __ testbit(method2_(method, access_flags), JVM_ACC_STATIC_BIT);
+ __ testbit_ushort(method2_(method, access_flags), JVM_ACC_STATIC_BIT);
method = noreg; // end of life
__ z_btrue(isStatic);
@@ -883,7 +882,7 @@ void TemplateInterpreterGenerator::lock_method(void) {
address reentry = nullptr;
{
Label L;
- __ testbit(method2_(method, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
+ __ testbit_ushort(method2_(method, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
__ z_btrue(L);
reentry = __ stop_chain_static(reentry, "method doesn't need synchronization");
__ bind(L);
@@ -897,7 +896,7 @@ void TemplateInterpreterGenerator::lock_method(void) {
Label done;
Label static_method;
- __ testbit(method2_(method, access_flags), JVM_ACC_STATIC_BIT);
+ __ testbit_ushort(method2_(method, access_flags), JVM_ACC_STATIC_BIT);
__ z_btrue(static_method);
// non-static method: Load receiver obj from stack.
@@ -1349,15 +1348,17 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Make sure method is native and not abstract.
#ifdef ASSERT
+ // _access_flags must be a 16 bit value.
+ assert(sizeof(AccessFlags) == 2, "testbit_ushort will fail");
address reentry = nullptr;
{ Label L;
- __ testbit(method_(access_flags), JVM_ACC_NATIVE_BIT);
+ __ testbit_ushort(method_(access_flags), JVM_ACC_NATIVE_BIT);
__ z_btrue(L);
reentry = __ stop_chain_static(reentry, "tried to execute non-native method as native");
__ bind(L);
}
{ Label L;
- __ testbit(method_(access_flags), JVM_ACC_ABSTRACT_BIT);
+ __ testbit_ushort(method_(access_flags), JVM_ACC_ABSTRACT_BIT);
__ z_bfalse(L);
reentry = __ stop_chain_static(reentry, "tried to execute abstract method as non-abstract");
__ bind(L);
@@ -1403,7 +1404,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
#ifdef ASSERT
{ Label L;
__ get_method(Z_R1_scratch);
- __ testbit(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
+ __ testbit_ushort(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
__ z_bfalse(L);
reentry = __ stop_chain_static(reentry, "method needs synchronization");
__ bind(L);
@@ -1461,7 +1462,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Pass mirror handle if static call.
{
Label method_is_not_static;
- __ testbit(method2_(Rmethod, access_flags), JVM_ACC_STATIC_BIT);
+ __ testbit_ushort(method2_(Rmethod, access_flags), JVM_ACC_STATIC_BIT);
__ z_bfalse(method_is_not_static);
// Load mirror from interpreter frame.
__ z_lg(Z_R1, _z_ijava_state_neg(mirror), Z_fp);
@@ -1719,13 +1720,13 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
address reentry = nullptr;
{ Label L;
- __ testbit(method_(access_flags), JVM_ACC_NATIVE_BIT);
+ __ testbit_ushort(method_(access_flags), JVM_ACC_NATIVE_BIT);
__ z_bfalse(L);
reentry = __ stop_chain_static(reentry, "tried to execute native method as non-native");
__ bind(L);
}
{ Label L;
- __ testbit(method_(access_flags), JVM_ACC_ABSTRACT_BIT);
+ __ testbit_ushort(method_(access_flags), JVM_ACC_ABSTRACT_BIT);
__ z_bfalse(L);
reentry = __ stop_chain_static(reentry, "tried to execute abstract method as non-abstract");
__ bind(L);
@@ -1775,7 +1776,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
{ Label L;
__ get_method(Z_R1_scratch);
- __ testbit(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
+ __ testbit_ushort(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
__ z_bfalse(L);
reentry = __ stop_chain_static(reentry, "method needs synchronization");
__ bind(L);
diff --git a/src/hotspot/cpu/s390/templateTable_s390.cpp b/src/hotspot/cpu/s390/templateTable_s390.cpp
index 3cb1aba810df4..e6c0c7781a3ba 100644
--- a/src/hotspot/cpu/s390/templateTable_s390.cpp
+++ b/src/hotspot/cpu/s390/templateTable_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/disassembler.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/s390/upcallLinker_s390.cpp b/src/hotspot/cpu/s390/upcallLinker_s390.cpp
index 8baad40a519a4..ab8bf7718123d 100644
--- a/src/hotspot/cpu/s390/upcallLinker_s390.cpp
+++ b/src/hotspot/cpu/s390/upcallLinker_s390.cpp
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "logging/logStream.hpp"
diff --git a/src/hotspot/cpu/s390/vm_version_s390.cpp b/src/hotspot/cpu/s390/vm_version_s390.cpp
index f7f21c4c5ac04..157b945e6e1a4 100644
--- a/src/hotspot/cpu/s390/vm_version_s390.cpp
+++ b/src/hotspot/cpu/s390/vm_version_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "compiler/disassembler.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/s390/vmreg_s390.cpp b/src/hotspot/cpu/s390/vmreg_s390.cpp
index d4d230eeb0466..0587cebb19987 100644
--- a/src/hotspot/cpu/s390/vmreg_s390.cpp
+++ b/src/hotspot/cpu/s390/vmreg_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/s390/vtableStubs_s390.cpp b/src/hotspot/cpu/s390/vtableStubs_s390.cpp
index d3af7fefcf133..f60d91183da6b 100644
--- a/src/hotspot/cpu/s390/vtableStubs_s390.cpp
+++ b/src/hotspot/cpu/s390/vtableStubs_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp b/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp
index fef137257b020..68ac5b6ca9a97 100644
--- a/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp
+++ b/src/hotspot/cpu/x86/abstractInterpreter_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethod.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/klass.inline.hpp"
diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp
index c2fcbcea71e24..828d8cfda91eb 100644
--- a/src/hotspot/cpu/x86/assembler_x86.cpp
+++ b/src/hotspot/cpu/x86/assembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
diff --git a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp
index 71ca9351f86c9..71d2898f45c7f 100644
--- a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIRAssembler.hpp"
diff --git a/src/hotspot/cpu/x86/c1_FpuStackSim_x86.cpp b/src/hotspot/cpu/x86/c1_FpuStackSim_x86.cpp
index 3ec182a350b8d..878c94c99da40 100644
--- a/src/hotspot/cpu/x86/c1_FpuStackSim_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_FpuStackSim_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FpuStackSim.hpp"
#include "c1/c1_FrameMap.hpp"
#include "utilities/growableArray.hpp"
diff --git a/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp b/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp
index 4153c37729bfc..cff2be393bc9e 100644
--- a/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_FrameMap_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
index ff6d18e48e1a8..de1fa1a9cc635 100644
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "c1/c1_CodeStubs.hpp"
@@ -2393,21 +2392,13 @@ void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr tmp, LIR_
switch(code) {
case lir_abs :
{
-#ifdef _LP64
- if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
- assert(tmp->is_valid(), "need temporary");
- __ vpandn(dest->as_xmm_double_reg(), tmp->as_xmm_double_reg(), value->as_xmm_double_reg(), 2);
- } else
-#endif
- {
- if (dest->as_xmm_double_reg() != value->as_xmm_double_reg()) {
- __ movdbl(dest->as_xmm_double_reg(), value->as_xmm_double_reg());
- }
- assert(!tmp->is_valid(), "do not need temporary");
- __ andpd(dest->as_xmm_double_reg(),
- ExternalAddress((address)double_signmask_pool),
- rscratch1);
+ if (dest->as_xmm_double_reg() != value->as_xmm_double_reg()) {
+ __ movdbl(dest->as_xmm_double_reg(), value->as_xmm_double_reg());
}
+ assert(!tmp->is_valid(), "do not need temporary");
+ __ andpd(dest->as_xmm_double_reg(),
+ ExternalAddress((address)double_signmask_pool),
+ rscratch1);
}
break;
@@ -3798,41 +3789,21 @@ void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest, LIR_Opr tmp) {
#endif // _LP64
} else if (dest->is_single_xmm()) {
-#ifdef _LP64
- if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
- assert(tmp->is_valid(), "need temporary");
- assert_different_registers(left->as_xmm_float_reg(), tmp->as_xmm_float_reg());
- __ vpxor(dest->as_xmm_float_reg(), tmp->as_xmm_float_reg(), left->as_xmm_float_reg(), 2);
- }
- else
-#endif
- {
- assert(!tmp->is_valid(), "do not need temporary");
- if (left->as_xmm_float_reg() != dest->as_xmm_float_reg()) {
- __ movflt(dest->as_xmm_float_reg(), left->as_xmm_float_reg());
- }
- __ xorps(dest->as_xmm_float_reg(),
- ExternalAddress((address)float_signflip_pool),
- rscratch1);
+ assert(!tmp->is_valid(), "do not need temporary");
+ if (left->as_xmm_float_reg() != dest->as_xmm_float_reg()) {
+ __ movflt(dest->as_xmm_float_reg(), left->as_xmm_float_reg());
}
+ __ xorps(dest->as_xmm_float_reg(),
+ ExternalAddress((address)float_signflip_pool),
+ rscratch1);
} else if (dest->is_double_xmm()) {
-#ifdef _LP64
- if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
- assert(tmp->is_valid(), "need temporary");
- assert_different_registers(left->as_xmm_double_reg(), tmp->as_xmm_double_reg());
- __ vpxor(dest->as_xmm_double_reg(), tmp->as_xmm_double_reg(), left->as_xmm_double_reg(), 2);
- }
- else
-#endif
- {
- assert(!tmp->is_valid(), "do not need temporary");
- if (left->as_xmm_double_reg() != dest->as_xmm_double_reg()) {
- __ movdbl(dest->as_xmm_double_reg(), left->as_xmm_double_reg());
- }
- __ xorpd(dest->as_xmm_double_reg(),
- ExternalAddress((address)double_signflip_pool),
- rscratch1);
+ assert(!tmp->is_valid(), "do not need temporary");
+ if (left->as_xmm_double_reg() != dest->as_xmm_double_reg()) {
+ __ movdbl(dest->as_xmm_double_reg(), left->as_xmm_double_reg());
}
+ __ xorpd(dest->as_xmm_double_reg(),
+ ExternalAddress((address)double_signflip_pool),
+ rscratch1);
#ifndef _LP64
} else if (left->is_single_fpu() || left->is_double_fpu()) {
assert(left->fpu() == 0, "arg must be on TOS");
diff --git a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp
index 36e2021138f2e..262683323ab09 100644
--- a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_Instruction.hpp"
@@ -344,20 +343,7 @@ void LIRGenerator::do_NegateOp(NegateOp* x) {
value.load_item();
LIR_Opr reg = rlock(x);
- LIR_Opr tmp = LIR_OprFact::illegalOpr;
-#ifdef _LP64
- if (UseAVX > 2 && !VM_Version::supports_avx512vl()) {
- if (x->type()->tag() == doubleTag) {
- tmp = new_register(T_DOUBLE);
- __ move(LIR_OprFact::doubleConst(-0.0), tmp);
- }
- else if (x->type()->tag() == floatTag) {
- tmp = new_register(T_FLOAT);
- __ move(LIR_OprFact::floatConst(-0.0), tmp);
- }
- }
-#endif
- __ negate(value.result(), reg, tmp);
+ __ negate(value.result(), reg);
set_result(x, round_item(reg));
}
@@ -830,16 +816,8 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
LIR_Opr calc_result = rlock_result(x);
LIR_Opr tmp = LIR_OprFact::illegalOpr;
-#ifdef _LP64
- if (UseAVX > 2 && (!VM_Version::supports_avx512vl()) &&
- (x->id() == vmIntrinsics::_dabs)) {
- tmp = new_register(T_DOUBLE);
- __ move(LIR_OprFact::doubleConst(-0.0), tmp);
- }
-#endif
if (x->id() == vmIntrinsics::_floatToFloat16) {
tmp = new_register(T_FLOAT);
- __ move(LIR_OprFact::floatConst(-0.0), tmp);
}
switch(x->id()) {
diff --git a/src/hotspot/cpu/x86/c1_LIR_x86.cpp b/src/hotspot/cpu/x86/c1_LIR_x86.cpp
index 6bdbfd1824caa..adcc53c44ce14 100644
--- a/src/hotspot/cpu/x86/c1_LIR_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_LIR_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
diff --git a/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp b/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp
index 917031faf8962..7c4da998db895 100644
--- a/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_LinearScan.hpp"
#include "utilities/bitMap.inline.hpp"
@@ -635,6 +634,23 @@ void FpuStackAllocator::handle_op1(LIR_Op1* op1) {
break;
}
+ case lir_abs:
+ case lir_sqrt:
+ case lir_neg: {
+ assert(in->is_fpu_register(), "must be");
+ assert(res->is_fpu_register(), "must be");
+ assert(in->is_last_use(), "old value gets destroyed");
+
+ insert_free_if_dead(res, in);
+ insert_exchange(in);
+ do_rename(in, res);
+
+ new_in = to_fpu_stack_top(res);
+ new_res = new_in;
+
+ break;
+ }
+
default: {
assert(!in->is_float_kind() && !res->is_float_kind(), "missed a fpu-operation");
}
@@ -756,26 +772,6 @@ void FpuStackAllocator::handle_op2(LIR_Op2* op2) {
break;
}
- case lir_abs:
- case lir_sqrt:
- case lir_neg: {
- // Right argument appears to be unused
- assert(right->is_illegal(), "must be");
- assert(left->is_fpu_register(), "must be");
- assert(res->is_fpu_register(), "must be");
- assert(left->is_last_use(), "old value gets destroyed");
-
- insert_free_if_dead(res, left);
- insert_exchange(left);
- do_rename(left, res);
-
- new_left = to_fpu_stack_top(res);
- new_res = new_left;
-
- op2->set_fpu_stack_size(sim()->stack_size());
- break;
- }
-
default: {
assert(false, "missed a fpu-operation");
}
diff --git a/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp b/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp
index 50cdd14154c42..e40de213e7a8b 100644
--- a/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp
+++ b/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -66,35 +66,7 @@ inline bool LinearScan::is_caller_save(int assigned_reg) {
inline void LinearScan::pd_add_temps(LIR_Op* op) {
- switch (op->code()) {
- case lir_tan: {
- // The slow path for these functions may need to save and
- // restore all live registers but we don't want to save and
- // restore everything all the time, so mark the xmms as being
- // killed. If the slow path were explicit or we could propagate
- // live register masks down to the assembly we could do better
- // but we don't have any easy way to do that right now. We
- // could also consider not killing all xmm registers if we
- // assume that slow paths are uncommon but it's not clear that
- // would be a good idea.
- if (UseSSE > 0) {
-#ifdef ASSERT
- if (TraceLinearScanLevel >= 2) {
- tty->print_cr("killing XMMs for trig");
- }
-#endif
- int num_caller_save_xmm_regs = FrameMap::get_num_caller_save_xmms();
- int op_id = op->id();
- for (int xmm = 0; xmm < num_caller_save_xmm_regs; xmm++) {
- LIR_Opr opr = FrameMap::caller_save_xmm_reg_at(xmm);
- add_temp(reg_num(opr), op_id, noUse, T_ILLEGAL);
- }
- }
- break;
- }
- default:
- break;
- }
+ // No special case behaviours yet
}
diff --git a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp
index f53a25ed3e646..e3c8792decd2b 100644
--- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
index 5cc8ffd9befe4..caa9344e04dde 100644
--- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
+++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
index 44f897529e7ce..83ecdee52199b 100644
--- a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/c2_MacroAssembler.hpp"
#include "opto/c2_CodeStubs.hpp"
#include "runtime/objectMonitor.hpp"
diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp
index 50ed4750d47fd..87583ddabd5e9 100644
--- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/x86/c2_init_x86.cpp b/src/hotspot/cpu/x86/c2_init_x86.cpp
index ee8937230b7b4..b286c3a34f2f1 100644
--- a/src/hotspot/cpu/x86/c2_init_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_init_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
#include "opto/optoreg.hpp"
diff --git a/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp b/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp
index f726a831c9f15..909554cdf764d 100644
--- a/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "c2_intelJccErratum_x86.hpp"
#include "opto/compile.hpp"
diff --git a/src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp b/src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp
index 2837a85800f47..7dadb15ef91a8 100644
--- a/src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp
+++ b/src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
#include "oops/arrayOop.hpp"
diff --git a/src/hotspot/cpu/x86/codeBuffer_x86.cpp b/src/hotspot/cpu/x86/codeBuffer_x86.cpp
index 3c406ed1b198e..75cc9b9896bb0 100644
--- a/src/hotspot/cpu/x86/codeBuffer_x86.cpp
+++ b/src/hotspot/cpu/x86/codeBuffer_x86.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.inline.hpp"
#include "asm/macroAssembler.hpp"
diff --git a/src/hotspot/cpu/x86/compiledIC_x86.cpp b/src/hotspot/cpu/x86/compiledIC_x86.cpp
index 51563d35d5dfd..53ad9aeec9162 100644
--- a/src/hotspot/cpu/x86/compiledIC_x86.cpp
+++ b/src/hotspot/cpu/x86/compiledIC_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/x86/compressedKlass_x86.cpp b/src/hotspot/cpu/x86/compressedKlass_x86.cpp
index 5b5a405bcef86..8a06a7ba3d503 100644
--- a/src/hotspot/cpu/x86/compressedKlass_x86.cpp
+++ b/src/hotspot/cpu/x86/compressedKlass_x86.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -23,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#ifdef _LP64
#include "oops/compressedKlass.hpp"
diff --git a/src/hotspot/cpu/x86/downcallLinker_x86_32.cpp b/src/hotspot/cpu/x86/downcallLinker_x86_32.cpp
index 4e549552e96da..3c7d93fc79e91 100644
--- a/src/hotspot/cpu/x86/downcallLinker_x86_32.cpp
+++ b/src/hotspot/cpu/x86/downcallLinker_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "prims/downcallLinker.hpp"
RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature,
diff --git a/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp b/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp
index 00cc69651f15f..7f531ca56b143 100644
--- a/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp
+++ b/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/codeBlob.hpp"
#include "logging/logStream.hpp"
diff --git a/src/hotspot/cpu/x86/foreignGlobals_x86_32.cpp b/src/hotspot/cpu/x86/foreignGlobals_x86_32.cpp
index c62021c32637c..18aa454e61cbf 100644
--- a/src/hotspot/cpu/x86/foreignGlobals_x86_32.cpp
+++ b/src/hotspot/cpu/x86/foreignGlobals_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/vmreg.hpp"
#include "prims/foreignGlobals.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/x86/foreignGlobals_x86_64.cpp b/src/hotspot/cpu/x86/foreignGlobals_x86_64.cpp
index 658ff6fecddb9..cc5627f6ffd82 100644
--- a/src/hotspot/cpu/x86/foreignGlobals_x86_64.cpp
+++ b/src/hotspot/cpu/x86/foreignGlobals_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "runtime/jniHandles.inline.hpp"
#include "oops/typeArrayOop.inline.hpp"
diff --git a/src/hotspot/cpu/x86/frame_x86.cpp b/src/hotspot/cpu/x86/frame_x86.cpp
index 4e28dc125341a..a5700134f60c7 100644
--- a/src/hotspot/cpu/x86/frame_x86.cpp
+++ b/src/hotspot/cpu/x86/frame_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
@@ -154,6 +153,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
if (Continuation::is_return_barrier_entry(sender_pc)) {
+ // sender_pc might be invalid so check that the frame
+ // actually belongs to a Continuation.
+ if (!Continuation::is_frame_in_continuation(thread, *this)) {
+ return false;
+ }
// If our sender_pc is the return barrier, then our "real" sender is the continuation entry
frame s = Continuation::continuation_bottom_sender(thread, *this, sender_sp);
sender_sp = s.sp();
diff --git a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
index 5af36d84e6ed8..4aa02c4d6278b 100644
--- a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp
index cd0e43b68bf9e..50dea42d5a300 100644
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp b/src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp
index dfd9d59016f0a..e99774cbc401a 100644
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nativeInst.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
diff --git a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp
index b04ab35862a3e..7954ce38d03ef 100644
--- a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
diff --git a/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp
index 618095bdfa634..76066409a7caa 100644
--- a/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/modRefBarrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp
index eb6da25d1bc7a..063f4c2cc5ddf 100644
--- a/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp
index a452850b1e814..75ab8fca05152 100644
--- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
#include "gc/shenandoah/shenandoahForwarding.hpp"
diff --git a/src/hotspot/cpu/x86/gc/z/zAddress_x86.cpp b/src/hotspot/cpu/x86/gc/z/zAddress_x86.cpp
index ed177f37e0d45..3667a52050c7a 100644
--- a/src/hotspot/cpu/x86/gc/z/zAddress_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/z/zAddress_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zGlobals.hpp"
diff --git a/src/hotspot/cpu/x86/gc/z/zAddress_x86.inline.hpp b/src/hotspot/cpu/x86/gc/z/zAddress_x86.inline.hpp
index e0be06395946a..d0816aee74f76 100644
--- a/src/hotspot/cpu/x86/gc/z/zAddress_x86.inline.hpp
+++ b/src/hotspot/cpu/x86/gc/z/zAddress_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -32,7 +32,7 @@ inline uintptr_t ZPointer::remap_bits(uintptr_t colored) {
inline constexpr int ZPointer::load_shift_lookup(uintptr_t value) {
const size_t index = load_shift_lookup_index(value);
- assert(index == 0 || is_power_of_2(index), "Incorrect load shift: " SIZE_FORMAT, index);
+ assert(index == 0 || is_power_of_2(index), "Incorrect load shift: %zu", index);
return ZPointerLoadShiftTable[index];
}
diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
index 1bc8e5c45443b..f7b1e25cf3b5d 100644
--- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/vmreg.inline.hpp"
diff --git a/src/hotspot/cpu/x86/icache_x86.cpp b/src/hotspot/cpu/x86/icache_x86.cpp
index b9ec2f6d18649..45679332ecaca 100644
--- a/src/hotspot/cpu/x86/icache_x86.cpp
+++ b/src/hotspot/cpu/x86/icache_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "runtime/icache.hpp"
diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp
index 3a3f01a640983..44087663a34b5 100644
--- a/src/hotspot/cpu/x86/interp_masm_x86.cpp
+++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compiler_globals.hpp"
#include "interp_masm_x86.hpp"
#include "interpreter/interpreter.hpp"
@@ -1030,7 +1029,7 @@ void InterpreterMacroAssembler::remove_activation(
// get method access flags
movptr(rcx, Address(rbp, frame::interpreter_frame_method_offset * wordSize));
- movl(rcx, Address(rcx, Method::access_flags_offset()));
+ load_unsigned_short(rcx, Address(rcx, Method::access_flags_offset()));
testl(rcx, JVM_ACC_SYNCHRONIZED);
jcc(Assembler::zero, unlocked);
diff --git a/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp b/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp
index 4f463b1d77140..14f11596924a5 100644
--- a/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp
+++ b/src/hotspot/cpu/x86/interpreterRT_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp b/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp
index c37287635bab9..8909df5b3f081 100644
--- a/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp
+++ b/src/hotspot/cpu/x86/interpreterRT_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp b/src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp
index 123362894122c..eee82a5c6820e 100644
--- a/src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp
+++ b/src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jniFastGetField.hpp"
diff --git a/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp b/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp
index e94b7d12b0b3c..09ba4537854fa 100644
--- a/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp
+++ b/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/codeBlob.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp
index 8eff2590bfcea..9e6a4789dc2cd 100644
--- a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp
+++ b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "compiler/disassembler.hpp"
#include "oops/compressedKlass.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp
index a798dea08cc79..0830b6b098387 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "code/compiledIC.hpp"
@@ -1194,7 +1193,11 @@ void MacroAssembler::andpd(XMMRegister dst, AddressLiteral src, Register rscratc
assert((UseAVX > 0) || (((intptr_t)src.target() & 15) == 0), "SSE mode requires address alignment 16 bytes");
assert(rscratch != noreg || always_reachable(src), "missing");
- if (reachable(src)) {
+ if (UseAVX > 2 &&
+ (!VM_Version::supports_avx512dq() || !VM_Version::supports_avx512vl()) &&
+ (dst->encoding() >= 16)) {
+ vpand(dst, dst, src, AVX_512bit, rscratch);
+ } else if (reachable(src)) {
Assembler::andpd(dst, as_Address(src));
} else {
lea(rscratch, src);
@@ -3332,7 +3335,12 @@ void MacroAssembler::xorpd(XMMRegister dst, AddressLiteral src, Register rscratc
// Used in sign-bit flipping with aligned address.
assert((UseAVX > 0) || (((intptr_t)src.target() & 15) == 0), "SSE mode requires address alignment 16 bytes");
- if (reachable(src)) {
+
+ if (UseAVX > 2 &&
+ (!VM_Version::supports_avx512dq() || !VM_Version::supports_avx512vl()) &&
+ (dst->encoding() >= 16)) {
+ vpxor(dst, dst, src, Assembler::AVX_512bit, rscratch);
+ } else if (reachable(src)) {
Assembler::xorpd(dst, as_Address(src));
} else {
lea(rscratch, src);
@@ -3341,16 +3349,19 @@ void MacroAssembler::xorpd(XMMRegister dst, AddressLiteral src, Register rscratc
}
void MacroAssembler::xorpd(XMMRegister dst, XMMRegister src) {
- if (UseAVX > 2 && !VM_Version::supports_avx512dq() && (dst->encoding() == src->encoding())) {
+ if (UseAVX > 2 &&
+ (!VM_Version::supports_avx512dq() || !VM_Version::supports_avx512vl()) &&
+ ((dst->encoding() >= 16) || (src->encoding() >= 16))) {
Assembler::vpxor(dst, dst, src, Assembler::AVX_512bit);
- }
- else {
+ } else {
Assembler::xorpd(dst, src);
}
}
void MacroAssembler::xorps(XMMRegister dst, XMMRegister src) {
- if (UseAVX > 2 && !VM_Version::supports_avx512dq() && (dst->encoding() == src->encoding())) {
+ if (UseAVX > 2 &&
+ (!VM_Version::supports_avx512dq() || !VM_Version::supports_avx512vl()) &&
+ ((dst->encoding() >= 16) || (src->encoding() >= 16))) {
Assembler::vpxor(dst, dst, src, Assembler::AVX_512bit);
} else {
Assembler::xorps(dst, src);
@@ -3362,7 +3373,12 @@ void MacroAssembler::xorps(XMMRegister dst, AddressLiteral src, Register rscratc
// Used in sign-bit flipping with aligned address.
assert((UseAVX > 0) || (((intptr_t)src.target() & 15) == 0), "SSE mode requires address alignment 16 bytes");
- if (reachable(src)) {
+
+ if (UseAVX > 2 &&
+ (!VM_Version::supports_avx512dq() || !VM_Version::supports_avx512vl()) &&
+ (dst->encoding() >= 16)) {
+ vpxor(dst, dst, src, Assembler::AVX_512bit, rscratch);
+ } else if (reachable(src)) {
Assembler::xorps(dst, as_Address(src));
} else {
lea(rscratch, src);
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_constants.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_constants.cpp
index e177c7d94624b..6fdda4c2f7130 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_constants.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_constants.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
ATTRIBUTE_ALIGNED(16) static const juint _ONES[] = {
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_cos.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_cos.cpp
index ce71bb50d8232..dce16756a6651 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_cos.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_cos.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_exp.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_exp.cpp
index a490510b959d3..2e6c1a617bb85 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_exp.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_exp.cpp
@@ -25,7 +25,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_log.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_log.cpp
index 515717e2179ca..abaabef674105 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_log.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_log.cpp
@@ -25,7 +25,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_log10.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_log10.cpp
index fa8c3b4623518..1fc5f49cf7503 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_log10.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_log10.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_pow.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_pow.cpp
index 7afad2fcc73b2..2d8a8ef91ac4f 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_pow.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_pow.cpp
@@ -25,7 +25,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_sin.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_sin.cpp
index 492d596f84b46..cd593ba335648 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_sin.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_sin.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_32_tan.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_32_tan.cpp
index f2bc1efb483f9..4e8be8a1f1dc7 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_32_tan.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_32_tan.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp
index 09d379a4296d4..9d48838ab6e1b 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp
@@ -43,7 +43,6 @@
* Software.
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp
index e7d728c2e9672..5fd6db868cc8b 100644
--- a/src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp
+++ b/src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/x86/methodHandles_x86.cpp b/src/hotspot/cpu/x86/methodHandles_x86.cpp
index fd738b7333e4f..0d95af133fa81 100644
--- a/src/hotspot/cpu/x86/methodHandles_x86.cpp
+++ b/src/hotspot/cpu/x86/methodHandles_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/vmClasses.hpp"
#include "compiler/disassembler.hpp"
diff --git a/src/hotspot/cpu/x86/nativeInst_x86.cpp b/src/hotspot/cpu/x86/nativeInst_x86.cpp
index d5021c29ed6b0..4ee741077dc06 100644
--- a/src/hotspot/cpu/x86/nativeInst_x86.cpp
+++ b/src/hotspot/cpu/x86/nativeInst_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/compiledIC.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/cpu/x86/peephole_x86_64.cpp b/src/hotspot/cpu/x86/peephole_x86_64.cpp
index 92a29490edaf8..2197055d1ecc0 100644
--- a/src/hotspot/cpu/x86/peephole_x86_64.cpp
+++ b/src/hotspot/cpu/x86/peephole_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
diff --git a/src/hotspot/cpu/x86/rdtsc_x86.cpp b/src/hotspot/cpu/x86/rdtsc_x86.cpp
index 8a927dd15e4e4..aac336019508d 100644
--- a/src/hotspot/cpu/x86/rdtsc_x86.cpp
+++ b/src/hotspot/cpu/x86/rdtsc_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "rdtsc_x86.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/x86/registerMap_x86.cpp b/src/hotspot/cpu/x86/registerMap_x86.cpp
index 34713ec4d38c9..295a8c0eb896b 100644
--- a/src/hotspot/cpu/x86/registerMap_x86.cpp
+++ b/src/hotspot/cpu/x86/registerMap_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/registerMap.hpp"
#include "vmreg_x86.inline.hpp"
diff --git a/src/hotspot/cpu/x86/register_x86.cpp b/src/hotspot/cpu/x86/register_x86.cpp
index dc5aba3c17801..e60834293445b 100644
--- a/src/hotspot/cpu/x86/register_x86.cpp
+++ b/src/hotspot/cpu/x86/register_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_x86.hpp"
diff --git a/src/hotspot/cpu/x86/relocInfo_x86.cpp b/src/hotspot/cpu/x86/relocInfo_x86.cpp
index 2df98c4311b2c..a447c5aca9d92 100644
--- a/src/hotspot/cpu/x86/relocInfo_x86.cpp
+++ b/src/hotspot/cpu/x86/relocInfo_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/relocInfo.hpp"
#include "memory/universe.hpp"
diff --git a/src/hotspot/cpu/x86/runtime_x86_32.cpp b/src/hotspot/cpu/x86/runtime_x86_32.cpp
index 9bd4239d665f3..bcba609387132 100644
--- a/src/hotspot/cpu/x86/runtime_x86_32.cpp
+++ b/src/hotspot/cpu/x86/runtime_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
diff --git a/src/hotspot/cpu/x86/runtime_x86_64.cpp b/src/hotspot/cpu/x86/runtime_x86_64.cpp
index 45f863b697b6b..d7d8fc1895b38 100644
--- a/src/hotspot/cpu/x86/runtime_x86_64.cpp
+++ b/src/hotspot/cpu/x86/runtime_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef COMPILER2
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86.cpp
index ebdd47f3a3f87..0a277a4eb69f6 100644
--- a/src/hotspot/cpu/x86/sharedRuntime_x86.cpp
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/sharedRuntime.hpp"
diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
index a6a662b3d1e0c..8e5e54f244cf9 100644
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
index ab7cbb9437453..bbe62db33f00e 100644
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#ifndef _WINDOWS
#include "alloca.h"
#endif
@@ -1099,7 +1098,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
{ // Bypass the barrier for non-static methods
Register flags = rscratch1;
- __ movl(flags, Address(method, Method::access_flags_offset()));
+ __ load_unsigned_short(flags, Address(method, Method::access_flags_offset()));
__ testl(flags, JVM_ACC_STATIC);
__ jcc(Assembler::zero, L_skip_barrier); // non-static
}
@@ -3020,7 +3019,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
// Allocate space for the code. Setup code generation tools.
const char* name = SharedRuntime::stub_name(id);
- CodeBuffer buffer(name, 2348, 1024);
+ CodeBuffer buffer(name, 2548, 1024);
MacroAssembler* masm = new MacroAssembler(&buffer);
address start = __ pc();
@@ -3086,11 +3085,11 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
Label bail;
#endif
if (!cause_return) {
- Label no_prefix, not_special;
+ Label no_prefix, not_special, check_rex_prefix;
// If our stashed return pc was modified by the runtime we avoid touching it
__ cmpptr(rbx, Address(rbp, wordSize));
- __ jccb(Assembler::notEqual, no_adjust);
+ __ jcc(Assembler::notEqual, no_adjust);
// Skip over the poll instruction.
// See NativeInstruction::is_safepoint_poll()
@@ -3113,9 +3112,29 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
// 41 85 04 24 test %eax,(%r12)
// 85 45 00 test %eax,0x0(%rbp)
// 41 85 45 00 test %eax,0x0(%r13)
-
+ //
+ // Notes:
+ // Format of legacy MAP0 test instruction:-
+ // [REX/REX2] [OPCODE] [ModRM] [SIB] [DISP] [IMM32]
+ // o For safepoint polling instruction "test %eax,(%rax)", encoding of first register
+ // operand and base register of memory operand is b/w [0-8), hence we do not require
+ // additional REX prefix where REX.B bit stores MSB bit of register encoding, which
+ // is why two bytes encoding is sufficient here.
+ // o For safepoint polling instruction like "test %eax,(%r8)", register encoding of BASE
+ // register of memory operand is 1000, thus we need additional REX prefix in this case,
+ // there by adding additional byte to instruction encoding.
+ // o In case BASE register is one of the 32 extended GPR registers available only on targets
+ // supporting Intel APX extension, then we need to emit two bytes REX2 prefix to hold
+ // most significant two bits of 5 bit register encoding.
+
+ if (VM_Version::supports_apx_f()) {
+ __ cmpb(Address(rbx, 0), Assembler::REX2);
+ __ jccb(Assembler::notEqual, check_rex_prefix);
+ __ addptr(rbx, 2);
+ __ bind(check_rex_prefix);
+ }
__ cmpb(Address(rbx, 0), NativeTstRegMem::instruction_rex_b_prefix);
- __ jcc(Assembler::notEqual, no_prefix);
+ __ jccb(Assembler::notEqual, no_prefix);
__ addptr(rbx, 1);
__ bind(no_prefix);
#ifdef ASSERT
@@ -3128,7 +3147,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(SharedStubId id, address cal
__ andptr(rcx, 0x07); // looking for 0x04 .. 0x05
__ subptr(rcx, 4); // looking for 0x00 .. 0x01
__ cmpptr(rcx, 1);
- __ jcc(Assembler::above, not_special);
+ __ jccb(Assembler::above, not_special);
__ addptr(rbx, 1);
__ bind(not_special);
#ifdef ASSERT
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
index de13772dcfb0d..d0e611e18d5ce 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/oopMap.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
index 3979237619c92..38a8eb6981f5c 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/vmIntrinsics.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp
index 84f5cc80b0d3a..287fd005c2c95 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp
index f14d368c376e1..b6dc046d172a4 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp
index c72c32e796d2d..ad2638dd25620 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp
index 47354f4fc7cf7..9175dea0a5b4d 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_constants.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_constants.cpp
index a5b8de75d0fd4..93fa7e650db6a 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_constants.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_constants.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "stubGenerator_x86_64.hpp"
// Constants for libm trigonometric stubs
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_cos.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_cos.cpp
index 315f705768980..ec6a98ae7b10d 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_cos.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_cos.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_exp.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_exp.cpp
index f716e2a7282d9..335906806ff8f 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_exp.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_exp.cpp
@@ -25,7 +25,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_fmod.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_fmod.cpp
index 26b5b594424d2..3bb0b4f6b1f47 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_fmod.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_fmod.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp
index 5a9b084841376..7ed1b76394684 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_ghash.cpp
@@ -23,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
#include "macroAssembler_x86.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_log.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_log.cpp
index c9d339680c44c..1b6c9fdcd37e5 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_log.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_log.cpp
@@ -25,7 +25,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_poly1305.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_poly1305.cpp
index 6d3da2e6c759f..6f952a603321a 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_poly1305.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_poly1305.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp
index 4e909afbacc70..1732d251c98a4 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_pow.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_pow.cpp
index 2e9ea125abcb4..4afcea596e88b 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_pow.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_pow.cpp
@@ -25,7 +25,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_sha3.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_sha3.cpp
index 49c39226708e3..50c200dbff221 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_sha3.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_sha3.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/stubRoutines.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_sin.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_sin.cpp
index 1f07229034dd4..61caf5066fc31 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_sin.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_sin.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_tan.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_tan.cpp
index 58165aa6f9866..11889f627a95d 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_tan.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_tan.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp
index 92ac78e15cba9..b105fd1088970 100644
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_tanh.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.cpp b/src/hotspot/cpu/x86/stubRoutines_x86.cpp
index bc1cbdbba26b5..9db3a89d29c51 100644
--- a/src/hotspot/cpu/x86/stubRoutines_x86.cpp
+++ b/src/hotspot/cpu/x86/stubRoutines_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp b/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp
index 7916a3b36305a..64e367b4c40fa 100644
--- a/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp
+++ b/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp
index f37d6698d39fc..ef3097ebd24cf 100644
--- a/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp
+++ b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
index 823b965a09b51..548243cba838d 100644
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.hpp"
#include "compiler/compiler_globals.hpp"
@@ -596,7 +595,7 @@ void TemplateInterpreterGenerator::lock_method() {
#ifdef ASSERT
{
Label L;
- __ movl(rax, access_flags);
+ __ load_unsigned_short(rax, access_flags);
__ testl(rax, JVM_ACC_SYNCHRONIZED);
__ jcc(Assembler::notZero, L);
__ stop("method doesn't need synchronization");
@@ -607,7 +606,7 @@ void TemplateInterpreterGenerator::lock_method() {
// get synchronization object
{
Label done;
- __ movl(rax, access_flags);
+ __ load_unsigned_short(rax, access_flags);
__ testl(rax, JVM_ACC_STATIC);
// get receiver (assume this is frequent case)
__ movptr(rax, Address(rlocals, Interpreter::local_offset_in_bytes(0)));
@@ -855,7 +854,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// make sure method is native & not abstract
#ifdef ASSERT
- __ movl(rax, access_flags);
+ __ load_unsigned_short(rax, access_flags);
{
Label L;
__ testl(rax, JVM_ACC_NATIVE);
@@ -909,7 +908,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
#ifdef ASSERT
{
Label L;
- __ movl(rax, access_flags);
+ __ load_unsigned_short(rax, access_flags);
__ testl(rax, JVM_ACC_SYNCHRONIZED);
__ jcc(Assembler::zero, L);
__ stop("method needs synchronization");
@@ -999,7 +998,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// pass mirror handle if static call
{
Label L;
- __ movl(t, Address(method, Method::access_flags_offset()));
+ __ load_unsigned_short(t, Address(method, Method::access_flags_offset()));
__ testl(t, JVM_ACC_STATIC);
__ jcc(Assembler::zero, L);
// get mirror
@@ -1280,7 +1279,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// do unlocking if necessary
{
Label L;
- __ movl(t, Address(method, Method::access_flags_offset()));
+ __ load_unsigned_short(t, Address(method, Method::access_flags_offset()));
__ testl(t, JVM_ACC_SYNCHRONIZED);
__ jcc(Assembler::zero, L);
// the code below should be shared with interpreter macro
@@ -1432,7 +1431,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
// make sure method is not native & not abstract
#ifdef ASSERT
- __ movl(rax, access_flags);
+ __ load_unsigned_short(rax, access_flags);
{
Label L;
__ testl(rax, JVM_ACC_NATIVE);
@@ -1489,7 +1488,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
#ifdef ASSERT
{
Label L;
- __ movl(rax, access_flags);
+ __ load_unsigned_short(rax, access_flags);
__ testl(rax, JVM_ACC_SYNCHRONIZED);
__ jcc(Assembler::zero, L);
__ stop("method needs synchronization");
diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp
index 75611524e3b0a..df8633bdd1502 100644
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "compiler/disassembler.hpp"
#include "interpreter/interp_masm.hpp"
diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp
index 5ea2d8eba259b..af5c0fa94b1c0 100644
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "compiler/disassembler.hpp"
#include "interpreter/interp_masm.hpp"
@@ -74,7 +73,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
// Do Int register here
switch ( i ) {
case 0:
- __ movl(rscratch1, Address(rbx, Method::access_flags_offset()));
+ __ load_unsigned_short(rscratch1, Address(rbx, Method::access_flags_offset()));
__ testl(rscratch1, JVM_ACC_STATIC);
__ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0));
break;
@@ -159,7 +158,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
}
// Now handle integrals. Only do c_rarg1 if not static.
- __ movl(c_rarg3, Address(rbx, Method::access_flags_offset()));
+ __ load_unsigned_short(c_rarg3, Address(rbx, Method::access_flags_offset()));
__ testl(c_rarg3, JVM_ACC_STATIC);
__ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0));
diff --git a/src/hotspot/cpu/x86/templateTable_x86.cpp b/src/hotspot/cpu/x86/templateTable_x86.cpp
index 441e4c8a0b877..55bdb52c442d0 100644
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "compiler/disassembler.hpp"
#include "gc/shared/collectedHeap.hpp"
diff --git a/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp b/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp
index 6ccf965a771d3..6dd2ddd58747d 100644
--- a/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp
+++ b/src/hotspot/cpu/x86/upcallLinker_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "prims/upcallLinker.hpp"
address UpcallLinker::make_upcall_stub(jobject receiver, Symbol* signature,
diff --git a/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp b/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp
index e2dadf7f0ef98..3b1aea5a02425 100644
--- a/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp
+++ b/src/hotspot/cpu/x86/upcallLinker_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.hpp"
#include "code/codeBlob.hpp"
diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp
index 688cd4fa5a6d1..cc438ce951f96 100644
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/vmIntrinsics.hpp"
@@ -1722,9 +1721,9 @@ void VM_Version::get_processor_features() {
if (ArrayOperationPartialInlineSize > MaxVectorSize) {
ArrayOperationPartialInlineSize = MaxVectorSize >= 16 ? MaxVectorSize : 0;
if (ArrayOperationPartialInlineSize) {
- warning("Setting ArrayOperationPartialInlineSize as MaxVectorSize" INTX_FORMAT ")", MaxVectorSize);
+ warning("Setting ArrayOperationPartialInlineSize as MaxVectorSize=%zd", MaxVectorSize);
} else {
- warning("Setting ArrayOperationPartialInlineSize as " INTX_FORMAT, ArrayOperationPartialInlineSize);
+ warning("Setting ArrayOperationPartialInlineSize as %zd", ArrayOperationPartialInlineSize);
}
}
}
diff --git a/src/hotspot/cpu/x86/vmreg_x86.cpp b/src/hotspot/cpu/x86/vmreg_x86.cpp
index d40a6eaa4b2ac..44aee56ef15ce 100644
--- a/src/hotspot/cpu/x86/vmreg_x86.cpp
+++ b/src/hotspot/cpu/x86/vmreg_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
#include "vmreg_x86.inline.hpp"
diff --git a/src/hotspot/cpu/x86/vtableStubs_x86_32.cpp b/src/hotspot/cpu/x86/vtableStubs_x86_32.cpp
index 8d3ceca7b4ab1..3e70a45b58b02 100644
--- a/src/hotspot/cpu/x86/vtableStubs_x86_32.cpp
+++ b/src/hotspot/cpu/x86/vtableStubs_x86_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/compiledIC.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/cpu/x86/vtableStubs_x86_64.cpp b/src/hotspot/cpu/x86/vtableStubs_x86_64.cpp
index 20fb035905227..b27755a243f24 100644
--- a/src/hotspot/cpu/x86/vtableStubs_x86_64.cpp
+++ b/src/hotspot/cpu/x86/vtableStubs_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "code/compiledIC.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad
index 02c0f9362085e..0b8dee7392aea 100644
--- a/src/hotspot/cpu/x86/x86_32.ad
+++ b/src/hotspot/cpu/x86/x86_32.ad
@@ -1,5 +1,5 @@
//
-// Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 1997, 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
@@ -2443,22 +2443,6 @@ encode %{
}
%}
- enc_class Push_ModD_encoding(regD src0, regD src1) %{
- __ subptr(rsp, 8);
- __ movdbl(Address(rsp, 0), $src1$$XMMRegister);
- __ fld_d(Address(rsp, 0));
- __ movdbl(Address(rsp, 0), $src0$$XMMRegister);
- __ fld_d(Address(rsp, 0));
- %}
-
- enc_class Push_ModF_encoding(regF src0, regF src1) %{
- __ subptr(rsp, 4);
- __ movflt(Address(rsp, 0), $src1$$XMMRegister);
- __ fld_s(Address(rsp, 0));
- __ movflt(Address(rsp, 0), $src0$$XMMRegister);
- __ fld_s(Address(rsp, 0));
- %}
-
enc_class Push_ResultD(regD dst) %{
__ fstp_d(Address(rsp, 0));
__ movdbl($dst$$XMMRegister, Address(rsp, 0));
@@ -2490,20 +2474,6 @@ encode %{
__ fld_d(Address(rsp, 0));
%}
- enc_class Push_Result_Mod_DPR( regDPR src) %{
- if ($src$$reg != FPR1L_enc) {
- // fincstp
- emit_opcode (masm, 0xD9);
- emit_opcode (masm, 0xF7);
- // FXCH FPR1 with src
- emit_opcode(masm, 0xD9);
- emit_d8(masm, 0xC8-1+$src$$reg );
- // fdecstp
- emit_opcode (masm, 0xD9);
- emit_opcode (masm, 0xF6);
- }
- %}
-
enc_class fnstsw_sahf_skip_parity() %{
// fnstsw ax
emit_opcode( masm, 0xDF );
@@ -2515,28 +2485,6 @@ encode %{
emit_opcode( masm, 0x05 );
%}
- enc_class emitModDPR() %{
- // fprem must be iterative
- // :: loop
- // fprem
- emit_opcode( masm, 0xD9 );
- emit_opcode( masm, 0xF8 );
- // wait
- emit_opcode( masm, 0x9b );
- // fnstsw ax
- emit_opcode( masm, 0xDF );
- emit_opcode( masm, 0xE0 );
- // sahf
- emit_opcode( masm, 0x9E );
- // jp ::loop
- emit_opcode( masm, 0x0F );
- emit_opcode( masm, 0x8A );
- emit_opcode( masm, 0xF4 );
- emit_opcode( masm, 0xFF );
- emit_opcode( masm, 0xFF );
- emit_opcode( masm, 0xFF );
- %}
-
enc_class fpu_flags() %{
// fnstsw_ax
emit_opcode( masm, 0xDF);
@@ -9801,45 +9749,6 @@ instruct strictfp_divDPR_reg(regDPR1 dst, regnotDPR1 src) %{
ins_pipe( fpu_reg_reg );
%}
-instruct modDPR_reg(regDPR dst, regDPR src, eAXRegI rax, eFlagsReg cr) %{
- predicate(UseSSE<=1);
- match(Set dst (ModD dst src));
- effect(KILL rax, KILL cr); // emitModDPR() uses EAX and EFLAGS
-
- format %{ "DMOD $dst,$src" %}
- ins_cost(250);
- ins_encode(Push_Reg_Mod_DPR(dst, src),
- emitModDPR(),
- Push_Result_Mod_DPR(src),
- Pop_Reg_DPR(dst));
- ins_pipe( pipe_slow );
-%}
-
-instruct modD_reg(regD dst, regD src0, regD src1, eAXRegI rax, eFlagsReg cr) %{
- predicate(UseSSE>=2);
- match(Set dst (ModD src0 src1));
- effect(KILL rax, KILL cr);
-
- format %{ "SUB ESP,8\t # DMOD\n"
- "\tMOVSD [ESP+0],$src1\n"
- "\tFLD_D [ESP+0]\n"
- "\tMOVSD [ESP+0],$src0\n"
- "\tFLD_D [ESP+0]\n"
- "loop:\tFPREM\n"
- "\tFWAIT\n"
- "\tFNSTSW AX\n"
- "\tSAHF\n"
- "\tJP loop\n"
- "\tFSTP_D [ESP+0]\n"
- "\tMOVSD $dst,[ESP+0]\n"
- "\tADD ESP,8\n"
- "\tFSTP ST0\t # Restore FPU Stack"
- %}
- ins_cost(250);
- ins_encode( Push_ModD_encoding(src0, src1), emitModDPR(), Push_ResultD(dst), PopFPU);
- ins_pipe( pipe_slow );
-%}
-
instruct atanDPR_reg(regDPR dst, regDPR src) %{
predicate (UseSSE<=1);
match(Set dst(AtanD dst src));
@@ -10445,59 +10354,6 @@ instruct divFPR_reg(regFPR dst, regFPR src) %{
%}
-// Spill to obtain 24-bit precision
-instruct modFPR24_reg(stackSlotF dst, regFPR src1, regFPR src2, eAXRegI rax, eFlagsReg cr) %{
- predicate( UseSSE==0 && Compile::current()->select_24_bit_instr());
- match(Set dst (ModF src1 src2));
- effect(KILL rax, KILL cr); // emitModDPR() uses EAX and EFLAGS
-
- format %{ "FMOD $dst,$src1,$src2" %}
- ins_encode( Push_Reg_Mod_DPR(src1, src2),
- emitModDPR(),
- Push_Result_Mod_DPR(src2),
- Pop_Mem_FPR(dst));
- ins_pipe( pipe_slow );
-%}
-//
-// This instruction does not round to 24-bits
-instruct modFPR_reg(regFPR dst, regFPR src, eAXRegI rax, eFlagsReg cr) %{
- predicate( UseSSE==0 && !Compile::current()->select_24_bit_instr());
- match(Set dst (ModF dst src));
- effect(KILL rax, KILL cr); // emitModDPR() uses EAX and EFLAGS
-
- format %{ "FMOD $dst,$src" %}
- ins_encode(Push_Reg_Mod_DPR(dst, src),
- emitModDPR(),
- Push_Result_Mod_DPR(src),
- Pop_Reg_FPR(dst));
- ins_pipe( pipe_slow );
-%}
-
-instruct modF_reg(regF dst, regF src0, regF src1, eAXRegI rax, eFlagsReg cr) %{
- predicate(UseSSE>=1);
- match(Set dst (ModF src0 src1));
- effect(KILL rax, KILL cr);
- format %{ "SUB ESP,4\t # FMOD\n"
- "\tMOVSS [ESP+0],$src1\n"
- "\tFLD_S [ESP+0]\n"
- "\tMOVSS [ESP+0],$src0\n"
- "\tFLD_S [ESP+0]\n"
- "loop:\tFPREM\n"
- "\tFWAIT\n"
- "\tFNSTSW AX\n"
- "\tSAHF\n"
- "\tJP loop\n"
- "\tFSTP_S [ESP+0]\n"
- "\tMOVSS $dst,[ESP+0]\n"
- "\tADD ESP,4\n"
- "\tFSTP ST0\t # Restore FPU Stack"
- %}
- ins_cost(250);
- ins_encode( Push_ModF_encoding(src0, src1), emitModDPR(), Push_ResultF(dst,0x4), PopFPU);
- ins_pipe( pipe_slow );
-%}
-
-
//----------Arithmetic Conversion Instructions---------------------------------
// The conversions operations are all Alpha sorted. Please keep it that way!
diff --git a/src/hotspot/cpu/zero/abstractInterpreter_zero.cpp b/src/hotspot/cpu/zero/abstractInterpreter_zero.cpp
index bf0d13f02f87e..ec293cfa41ab9 100644
--- a/src/hotspot/cpu/zero/abstractInterpreter_zero.cpp
+++ b/src/hotspot/cpu/zero/abstractInterpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/zero/bytecodeInterpreter.hpp"
#include "interpreter/zero/zeroInterpreter.hpp"
#include "runtime/frame.inline.hpp"
diff --git a/src/hotspot/cpu/zero/assembler_zero.cpp b/src/hotspot/cpu/zero/assembler_zero.cpp
index fe0f168885630..82815a57f8f26 100644
--- a/src/hotspot/cpu/zero/assembler_zero.cpp
+++ b/src/hotspot/cpu/zero/assembler_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp b/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp
index 3f02ff573fa72..17e845146e2d5 100644
--- a/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp
+++ b/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/cpu/zero/compiledIC_zero.cpp b/src/hotspot/cpu/zero/compiledIC_zero.cpp
index 869d96e65f844..a32bc2809aeb9 100644
--- a/src/hotspot/cpu/zero/compiledIC_zero.cpp
+++ b/src/hotspot/cpu/zero/compiledIC_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/cpu/zero/disassembler_zero.cpp b/src/hotspot/cpu/zero/disassembler_zero.cpp
index 944a52f5dd963..1fdb09eb73c15 100644
--- a/src/hotspot/cpu/zero/disassembler_zero.cpp
+++ b/src/hotspot/cpu/zero/disassembler_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,6 +23,5 @@
*
*/
-#include "precompiled.hpp"
// This file is intentionally empty
diff --git a/src/hotspot/cpu/zero/downcallLinker_zero.cpp b/src/hotspot/cpu/zero/downcallLinker_zero.cpp
index 4e549552e96da..3c7d93fc79e91 100644
--- a/src/hotspot/cpu/zero/downcallLinker_zero.cpp
+++ b/src/hotspot/cpu/zero/downcallLinker_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "prims/downcallLinker.hpp"
RuntimeStub* DowncallLinker::make_downcall_stub(BasicType* signature,
diff --git a/src/hotspot/cpu/zero/foreignGlobals_zero.cpp b/src/hotspot/cpu/zero/foreignGlobals_zero.cpp
index d28a4c7c2f170..57433ffb98c1a 100644
--- a/src/hotspot/cpu/zero/foreignGlobals_zero.cpp
+++ b/src/hotspot/cpu/zero/foreignGlobals_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/vmreg.hpp"
#include "prims/foreignGlobals.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/zero/frame_zero.cpp b/src/hotspot/cpu/zero/frame_zero.cpp
index 7c65387f2388d..4b4bd1e2b87af 100644
--- a/src/hotspot/cpu/zero/frame_zero.cpp
+++ b/src/hotspot/cpu/zero/frame_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/cpu/zero/gc/shared/barrierSetNMethod_zero.cpp b/src/hotspot/cpu/zero/gc/shared/barrierSetNMethod_zero.cpp
index 90f971a315243..62e7134ed61ee 100644
--- a/src/hotspot/cpu/zero/gc/shared/barrierSetNMethod_zero.cpp
+++ b/src/hotspot/cpu/zero/gc/shared/barrierSetNMethod_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/zero/icache_zero.cpp b/src/hotspot/cpu/zero/icache_zero.cpp
index 3b255befd55ac..25018110d9c98 100644
--- a/src/hotspot/cpu/zero/icache_zero.cpp
+++ b/src/hotspot/cpu/zero/icache_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/icache.hpp"
diff --git a/src/hotspot/cpu/zero/interpreterRT_zero.cpp b/src/hotspot/cpu/zero/interpreterRT_zero.cpp
index 5aeb5a0981de0..85199524a888a 100644
--- a/src/hotspot/cpu/zero/interpreterRT_zero.cpp
+++ b/src/hotspot/cpu/zero/interpreterRT_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/cpu/zero/jniFastGetField_zero.cpp b/src/hotspot/cpu/zero/jniFastGetField_zero.cpp
index dea7d7c3b831b..3c43ccf69c1b4 100644
--- a/src/hotspot/cpu/zero/jniFastGetField_zero.cpp
+++ b/src/hotspot/cpu/zero/jniFastGetField_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jniFastGetField.hpp"
diff --git a/src/hotspot/cpu/zero/methodHandles_zero.cpp b/src/hotspot/cpu/zero/methodHandles_zero.cpp
index 4021d0e74b681..3bf8c46f56c8a 100644
--- a/src/hotspot/cpu/zero/methodHandles_zero.cpp
+++ b/src/hotspot/cpu/zero/methodHandles_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/cpu/zero/nativeInst_zero.cpp b/src/hotspot/cpu/zero/nativeInst_zero.cpp
index 53f6fcef83019..0d2747f7fa698 100644
--- a/src/hotspot/cpu/zero/nativeInst_zero.cpp
+++ b/src/hotspot/cpu/zero/nativeInst_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "entry_zero.hpp"
#include "interpreter/zero/zeroInterpreter.hpp"
diff --git a/src/hotspot/cpu/zero/register_zero.cpp b/src/hotspot/cpu/zero/register_zero.cpp
index 812119b66af70..eef89153896a6 100644
--- a/src/hotspot/cpu/zero/register_zero.cpp
+++ b/src/hotspot/cpu/zero/register_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "register_zero.hpp"
const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers;
diff --git a/src/hotspot/cpu/zero/relocInfo_zero.cpp b/src/hotspot/cpu/zero/relocInfo_zero.cpp
index b926f20cfe7d8..647d5be31314c 100644
--- a/src/hotspot/cpu/zero/relocInfo_zero.cpp
+++ b/src/hotspot/cpu/zero/relocInfo_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.hpp"
#include "code/relocInfo.hpp"
#include "nativeInst_zero.hpp"
diff --git a/src/hotspot/cpu/zero/sharedRuntime_zero.cpp b/src/hotspot/cpu/zero/sharedRuntime_zero.cpp
index 672f1d73dc1c0..f141135ff9571 100644
--- a/src/hotspot/cpu/zero/sharedRuntime_zero.cpp
+++ b/src/hotspot/cpu/zero/sharedRuntime_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/debugInfoRec.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/cpu/zero/stack_zero.cpp b/src/hotspot/cpu/zero/stack_zero.cpp
index ef986111cf890..67692a2bb7bc0 100644
--- a/src/hotspot/cpu/zero/stack_zero.cpp
+++ b/src/hotspot/cpu/zero/stack_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "interpreter/zero/bytecodeInterpreter.hpp"
#include "runtime/frame.inline.hpp"
diff --git a/src/hotspot/cpu/zero/stubGenerator_zero.cpp b/src/hotspot/cpu/zero/stubGenerator_zero.cpp
index b6905791e9884..0ab43ed78f7a3 100644
--- a/src/hotspot/cpu/zero/stubGenerator_zero.cpp
+++ b/src/hotspot/cpu/zero/stubGenerator_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010, 2015 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "interpreter/interpreter.hpp"
#include "nativeInst_zero.hpp"
diff --git a/src/hotspot/cpu/zero/stubRoutines_zero.cpp b/src/hotspot/cpu/zero/stubRoutines_zero.cpp
index 0a9e3558711dd..4337b2db73042 100644
--- a/src/hotspot/cpu/zero/stubRoutines_zero.cpp
+++ b/src/hotspot/cpu/zero/stubRoutines_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/cpu/zero/upcallLinker_zero.cpp b/src/hotspot/cpu/zero/upcallLinker_zero.cpp
index 5dbc3cb62972d..55479a4b34176 100644
--- a/src/hotspot/cpu/zero/upcallLinker_zero.cpp
+++ b/src/hotspot/cpu/zero/upcallLinker_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "prims/upcallLinker.hpp"
address UpcallLinker::make_upcall_stub(jobject mh, Symbol* signature,
diff --git a/src/hotspot/cpu/zero/vm_version_zero.cpp b/src/hotspot/cpu/zero/vm_version_zero.cpp
index 1706be3089d78..e38561e19c571 100644
--- a/src/hotspot/cpu/zero/vm_version_zero.cpp
+++ b/src/hotspot/cpu/zero/vm_version_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/arguments.hpp"
diff --git a/src/hotspot/cpu/zero/vmreg_zero.cpp b/src/hotspot/cpu/zero/vmreg_zero.cpp
index f9f410de9c805..dfaec25540fef 100644
--- a/src/hotspot/cpu/zero/vmreg_zero.cpp
+++ b/src/hotspot/cpu/zero/vmreg_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/cpu/zero/vtableStubs_zero.cpp b/src/hotspot/cpu/zero/vtableStubs_zero.cpp
index 6258762279ee0..12819b484b2b6 100644
--- a/src/hotspot/cpu/zero/vtableStubs_zero.cpp
+++ b/src/hotspot/cpu/zero/vtableStubs_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/vtableStubs.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp
index 3e05eb1448dd6..029ccbded1366 100644
--- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp
+++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/os/aix/attachListener_aix.cpp b/src/hotspot/os/aix/attachListener_aix.cpp
index 721901bb0e244..218ee04fdcc0e 100644
--- a/src/hotspot/os/aix/attachListener_aix.cpp
+++ b/src/hotspot/os/aix/attachListener_aix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "os_posix.hpp"
#include "runtime/interfaceSupport.inline.hpp"
diff --git a/src/hotspot/os/aix/loadlib_aix.cpp b/src/hotspot/os/aix/loadlib_aix.cpp
index bc21aef383698..2c38e1b637ca7 100644
--- a/src/hotspot/os/aix/loadlib_aix.cpp
+++ b/src/hotspot/os/aix/loadlib_aix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2022, IBM Corp.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -203,7 +203,7 @@ static bool reload_table() {
}
}
- trcVerbose("loadquery buffer size is " SIZE_FORMAT ".", buflen);
+ trcVerbose("loadquery buffer size is %zu.", buflen);
// Iterate over the loadquery result. For details see sys/ldr.h on AIX.
ldi = (struct ld_info*) buffer;
@@ -262,7 +262,7 @@ static bool reload_table() {
lm->is_in_vm = true;
}
- trcVerbose("entry: %p " SIZE_FORMAT ", %p " SIZE_FORMAT ", %s %s %s, %d",
+ trcVerbose("entry: %p %zu, %p %zu, %s %s %s, %d",
lm->text, lm->text_len,
lm->data, lm->data_len,
lm->path, lm->shortname,
diff --git a/src/hotspot/os/aix/osThread_aix.cpp b/src/hotspot/os/aix/osThread_aix.cpp
index 86d9821e5a520..204b271ceee11 100644
--- a/src/hotspot/os/aix/osThread_aix.cpp
+++ b/src/hotspot/os/aix/osThread_aix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "runtime/mutex.hpp"
#include "runtime/osThread.hpp"
diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp
index 26627c2f8fb3b..9222104c6d6b7 100644
--- a/src/hotspot/os/aix/os_aix.cpp
+++ b/src/hotspot/os/aix/os_aix.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2024 SAP SE. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2025 SAP SE. 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
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "classfile/vmSymbols.hpp"
#include "code/vtableStubs.hpp"
#include "compiler/compileBroker.hpp"
@@ -450,7 +449,7 @@ static void query_multipage_support() {
if (p != (void*) -1) {
const size_t real_pagesize = os::Aix::query_pagesize(p);
if (real_pagesize != pagesize) {
- log_warning(pagesize)("real page size (" SIZE_FORMAT_X ") differs.", real_pagesize);
+ log_warning(pagesize)("real page size (0x%zx) differs.", real_pagesize);
} else {
can_use = true;
}
@@ -631,8 +630,8 @@ static void *thread_native_entry(Thread *thread) {
if (lt.is_enabled()) {
address low_address = thread->stack_end();
address high_address = thread->stack_base();
- lt.print("Thread is alive (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT
- ", stack [" PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k using %luk pages)).",
+ lt.print("Thread is alive (tid: %zu, kernel thread id: %zu"
+ ", stack [" PTR_FORMAT " - " PTR_FORMAT " (%zuk using %luk pages)).",
os::current_thread_id(), (uintx) kernel_thread_id, p2i(low_address), p2i(high_address),
(high_address - low_address) / K, os::Aix::query_pagesize(low_address) / K);
}
@@ -681,7 +680,7 @@ static void *thread_native_entry(Thread *thread) {
// Prevent dereferencing it from here on out.
thread = nullptr;
- log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT ").",
+ log_info(os, thread)("Thread finished (tid: %zu, kernel thread id: %zu).",
os::current_thread_id(), (uintx) kernel_thread_id);
return 0;
@@ -733,7 +732,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
// guard pages might not fit on the tiny stack created.
int ret = pthread_attr_setstacksize(&attr, stack_size);
if (ret != 0) {
- log_warning(os, thread)("The %sthread stack size specified is invalid: " SIZE_FORMAT "k",
+ log_warning(os, thread)("The %sthread stack size specified is invalid: %zuk",
(thr_type == compiler_thread) ? "compiler " : ((thr_type == java_thread) ? "" : "VM "),
stack_size / K);
thread->set_osthread(nullptr);
@@ -761,7 +760,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
if (ret == 0) {
char buf[64];
- log_info(os, thread)("Thread \"%s\" started (pthread id: " UINTX_FORMAT ", attributes: %s). ",
+ log_info(os, thread)("Thread \"%s\" started (pthread id: %zu, attributes: %s). ",
thread->name(), (uintx) tid, os::Posix::describe_pthread_attr(buf, sizeof(buf), &attr));
} else {
char buf[64];
@@ -769,7 +768,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
thread->name(), ret, os::errno_name(ret), os::Posix::describe_pthread_attr(buf, sizeof(buf), &attr));
// Log some OS information which might explain why creating the thread failed.
log_warning(os, thread)("Number of threads approx. running in the VM: %d", Threads::number_of_threads());
- log_warning(os, thread)("Checking JVM parameter MaxExpectedDataSegmentSize (currently " SIZE_FORMAT "k) might be helpful", MaxExpectedDataSegmentSize/K);
+ log_warning(os, thread)("Checking JVM parameter MaxExpectedDataSegmentSize (currently %zuk) might be helpful", MaxExpectedDataSegmentSize/K);
LogStream st(Log(os, thread)::info());
os::Posix::print_rlimit_info(&st);
os::print_memory_info(&st);
@@ -839,8 +838,8 @@ bool os::create_attached_thread(JavaThread* thread) {
// and save the caller's signal mask
PosixSignals::hotspot_sigmask(thread);
- log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT
- ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).",
+ log_info(os, thread)("Thread attached (tid: %zu, kernel thread id: %zu"
+ ", stack: " PTR_FORMAT " - " PTR_FORMAT " (%zuK) ).",
os::current_thread_id(), (uintx) kernel_thread_id,
p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size() / K);
@@ -1067,21 +1066,24 @@ static void* dll_load_library(const char *filename, int *eno, char *ebuf, int eb
// If filename matches .so, and loading fails, repeat with .a.
void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
void* result = nullptr;
- char* const file_path = strdup(filename);
- char* const pointer_to_dot = strrchr(file_path, '.');
const char old_extension[] = ".so";
const char new_extension[] = ".a";
- STATIC_ASSERT(sizeof(old_extension) >= sizeof(new_extension));
// First try to load the existing file.
- int eno=0;
+ int eno = 0;
result = dll_load_library(filename, &eno, ebuf, ebuflen);
- // If the load fails,we try to reload by changing the extension to .a for .so files only.
+ // If the load fails, we try to reload by changing the extension to .a for .so files only.
// Shared object in .so format dont have braces, hence they get removed for archives with members.
- if (result == nullptr && eno == ENOENT && pointer_to_dot != nullptr && strcmp(pointer_to_dot, old_extension) == 0) {
- snprintf(pointer_to_dot, sizeof(old_extension), "%s", new_extension);
- result = dll_load_library(file_path, &eno, ebuf, ebuflen);
+ if (result == nullptr && eno == ENOENT) {
+ const char* pointer_to_dot = strrchr(filename, '.');
+ if (pointer_to_dot != nullptr && strcmp(pointer_to_dot, old_extension) == 0) {
+ STATIC_ASSERT(sizeof(old_extension) >= sizeof(new_extension));
+ char* tmp_path = os::strdup(filename);
+ size_t prefix_size = pointer_delta(pointer_to_dot, filename, 1);
+ os::snprintf(tmp_path + prefix_size, sizeof(old_extension), "%s", new_extension);
+ result = dll_load_library(tmp_path, &eno, ebuf, ebuflen);
+ os::free(tmp_path);
+ }
}
- FREE_C_HEAP_ARRAY(char, file_path);
return result;
}
@@ -1191,10 +1193,10 @@ void os::print_memory_info(outputStream* st) {
os::Aix::meminfo_t mi;
if (os::Aix::get_meminfo(&mi)) {
- st->print_cr("physical total : " SIZE_FORMAT, mi.real_total);
- st->print_cr("physical free : " SIZE_FORMAT, mi.real_free);
- st->print_cr("swap total : " SIZE_FORMAT, mi.pgsp_total);
- st->print_cr("swap free : " SIZE_FORMAT, mi.pgsp_free);
+ st->print_cr("physical total : %zu", mi.real_total);
+ st->print_cr("physical free : %zu", mi.real_free);
+ st->print_cr("swap total : %zu", mi.pgsp_total);
+ st->print_cr("swap free : %zu", mi.pgsp_free);
}
st->cr();
@@ -1202,10 +1204,10 @@ void os::print_memory_info(outputStream* st) {
st->print_cr("Program break at VM startup: " PTR_FORMAT ".", p2i(g_brk_at_startup));
address brk_now = (address)::sbrk(0);
if (brk_now != (address)-1) {
- st->print_cr("Program break now : " PTR_FORMAT " (distance: " SIZE_FORMAT "k).",
+ st->print_cr("Program break now : " PTR_FORMAT " (distance: %zuk).",
p2i(brk_now), (size_t)((brk_now - g_brk_at_startup) / K));
}
- st->print_cr("MaxExpectedDataSegmentSize : " SIZE_FORMAT "k.", MaxExpectedDataSegmentSize / K);
+ st->print_cr("MaxExpectedDataSegmentSize : %zuk.", MaxExpectedDataSegmentSize / K);
st->cr();
// Print segments allocated with os::reserve_memory.
@@ -1379,7 +1381,7 @@ struct vmembk_t {
}
void print_on(outputStream* os) const {
- os->print("[" PTR_FORMAT " - " PTR_FORMAT "] (" UINTX_FORMAT
+ os->print("[" PTR_FORMAT " - " PTR_FORMAT "] (%zu"
" bytes, %ld %s pages), %s",
p2i(addr), p2i(addr) + size - 1, size, size / pagesize, describe_pagesize(pagesize),
(type == VMEM_SHMATED ? "shmat" : "mmap")
@@ -1456,7 +1458,7 @@ static void vmembk_print_on(outputStream* os) {
// If is null, function will attach the memory anywhere.
static char* reserve_shmated_memory (size_t bytes, char* requested_addr) {
- trcVerbose("reserve_shmated_memory " UINTX_FORMAT " bytes, wishaddress "
+ trcVerbose("reserve_shmated_memory %zu bytes, wishaddress "
PTR_FORMAT "...", bytes, p2i(requested_addr));
// We must prevent anyone from attaching too close to the
@@ -1477,7 +1479,7 @@ static char* reserve_shmated_memory (size_t bytes, char* requested_addr) {
int shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | S_IRUSR | S_IWUSR);
if (shmid == -1) {
ErrnoPreserver ep;
- log_trace(os, map)("shmget(.., " UINTX_FORMAT ", ..) failed (errno=%s).",
+ log_trace(os, map)("shmget(.., %zu, ..) failed (errno=%s).",
size, os::strerror(ep.saved_errno()));
return nullptr;
}
@@ -1493,7 +1495,7 @@ static char* reserve_shmated_memory (size_t bytes, char* requested_addr) {
shmbuf.shm_pagesize = 64*K;
if (shmctl(shmid, SHM_PAGESIZE, &shmbuf) != 0) {
assert(false,
- "Failed to set page size (need " UINTX_FORMAT
+ "Failed to set page size (need %zu"
" 64K pages) - shmctl failed. (errno=%s).",
size / (64 * K), os::strerror(os::get_last_error()));
}
@@ -1530,13 +1532,13 @@ static char* reserve_shmated_memory (size_t bytes, char* requested_addr) {
// work (see above), the system may have given us something other then 4K (LDR_CNTRL).
const size_t real_pagesize = os::Aix::query_pagesize(addr);
if (real_pagesize != (size_t)shmbuf.shm_pagesize) {
- log_trace(os, map)("pagesize is, surprisingly, " SIZE_FORMAT,
+ log_trace(os, map)("pagesize is, surprisingly, %zu",
real_pagesize);
}
if (addr) {
log_trace(os, map)("shm-allocated succeeded: " RANGEFMT
- " (" UINTX_FORMAT " %s pages)",
+ " (%zu %s pages)",
RANGEFMTARGS(addr, size),
size / real_pagesize,
describe_pagesize(real_pagesize));
@@ -1545,7 +1547,7 @@ static char* reserve_shmated_memory (size_t bytes, char* requested_addr) {
log_trace(os, map)("shm-allocate failed: " RANGEFMT,
RANGEFMTARGS(requested_addr, size));
} else {
- log_trace(os, map)("failed to shm-allocate " UINTX_FORMAT
+ log_trace(os, map)("failed to shm-allocate %zu"
" bytes at any address.",
size);
}
@@ -1587,7 +1589,7 @@ static bool uncommit_shmated_memory(char* addr, size_t size) {
if (rc != 0) {
ErrnoPreserver ep;
- log_warning(os)("disclaim64(" PTR_FORMAT ", " UINTX_FORMAT ") failed, %s\n", p2i(addr), size, os::strerror(ep.saved_errno()));
+ log_warning(os)("disclaim64(" PTR_FORMAT ", %zu) failed, %s\n", p2i(addr), size, os::strerror(ep.saved_errno()));
return false;
}
return true;
@@ -1599,7 +1601,7 @@ static bool uncommit_shmated_memory(char* addr, size_t size) {
// If is given, an attempt is made to attach at the given address.
// Failing that, memory is allocated at any address.
static char* reserve_mmaped_memory(size_t bytes, char* requested_addr) {
- trcVerbose("reserve_mmaped_memory " UINTX_FORMAT " bytes, wishaddress " PTR_FORMAT "...",
+ trcVerbose("reserve_mmaped_memory %zu bytes, wishaddress " PTR_FORMAT "...",
bytes, p2i(requested_addr));
if (requested_addr && !is_aligned_to(requested_addr, os::vm_page_size()) != 0) {
@@ -1689,7 +1691,7 @@ static char* reserve_mmaped_memory(size_t bytes, char* requested_addr) {
}
addr = addr_aligned;
- trcVerbose("mmap-allocated " PTR_FORMAT " .. " PTR_FORMAT " (" UINTX_FORMAT " bytes)",
+ trcVerbose("mmap-allocated " PTR_FORMAT " .. " PTR_FORMAT " (%zu bytes)",
p2i(addr), p2i(addr + bytes), bytes);
// bookkeeping
@@ -1756,9 +1758,8 @@ static bool uncommit_mmaped_memory(char* addr, size_t size) {
#ifdef PRODUCT
static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
int err) {
- warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
- ", %d) failed; error='%s' (errno=%d)", p2i(addr), size, exec,
- os::errno_name(err), err);
+ warning("INFO: os::commit_memory(" PTR_FORMAT ", %zu, %d) failed; error='%s' (errno=%d)",
+ p2i(addr), size, exec, os::errno_name(err), err);
}
#endif
@@ -1775,10 +1776,10 @@ void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec,
bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
assert(is_aligned_to(addr, os::vm_page_size()),
- "addr " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
+ "addr " PTR_FORMAT " not aligned to vm_page_size (%zu)",
p2i(addr), os::vm_page_size());
assert(is_aligned_to(size, os::vm_page_size()),
- "size " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
+ "size " PTR_FORMAT " not aligned to vm_page_size (%zu)",
size, os::vm_page_size());
vmembk_t* const vmi = vmembk_find(addr);
@@ -1810,10 +1811,10 @@ void os::pd_commit_memory_or_exit(char* addr, size_t size,
bool os::pd_uncommit_memory(char* addr, size_t size, bool exec) {
assert(is_aligned_to(addr, os::vm_page_size()),
- "addr " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
+ "addr " PTR_FORMAT " not aligned to vm_page_size (%zu)",
p2i(addr), os::vm_page_size());
assert(is_aligned_to(size, os::vm_page_size()),
- "size " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
+ "size " PTR_FORMAT " not aligned to vm_page_size (%zu)",
size, os::vm_page_size());
// Dynamically do different things for mmap/shmat.
@@ -2783,7 +2784,7 @@ bool os::start_debugging(char *buf, int buflen) {
jio_snprintf(p, buflen -len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'dbx -a %d'; then switch to thread tid " INTX_FORMAT ", k-tid " INTX_FORMAT "\n"
+ "To debug, run 'dbx -a %d'; then switch to thread tid %zd, k-tid %zd\n"
"Enter 'yes' to launch dbx automatically (PATH must include dbx)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(),
diff --git a/src/hotspot/os/aix/os_perf_aix.cpp b/src/hotspot/os/aix/os_perf_aix.cpp
index b5ae1a6a725a5..0b008a197ded7 100644
--- a/src/hotspot/os/aix/os_perf_aix.cpp
+++ b/src/hotspot/os/aix/os_perf_aix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, IBM Corp.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "libperfstat_aix.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/os/aix/safepointMechanism_aix.cpp b/src/hotspot/os/aix/safepointMechanism_aix.cpp
index 0a36c89bec6a9..e1f717cdd1490 100644
--- a/src/hotspot/os/aix/safepointMechanism_aix.cpp
+++ b/src/hotspot/os/aix/safepointMechanism_aix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "nmt/memTracker.hpp"
#include "runtime/globals.hpp"
diff --git a/src/hotspot/os/bsd/decoder_machO.cpp b/src/hotspot/os/bsd/decoder_machO.cpp
index 417e7139a5897..173e030a7b51c 100644
--- a/src/hotspot/os/bsd/decoder_machO.cpp
+++ b/src/hotspot/os/bsd/decoder_machO.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#ifdef __APPLE__
#include "decoder_machO.hpp"
diff --git a/src/hotspot/os/bsd/gc/z/zLargePages_bsd.cpp b/src/hotspot/os/bsd/gc/z/zLargePages_bsd.cpp
index 6e26741a5071f..0c42d7790886e 100644
--- a/src/hotspot/os/bsd/gc/z/zLargePages_bsd.cpp
+++ b/src/hotspot/os/bsd/gc/z/zLargePages_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zLargePages.hpp"
#include "runtime/globals.hpp"
diff --git a/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp b/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp
index e5b3895c44e6d..3cd9338f1d66d 100644
--- a/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp
+++ b/src/hotspot/os/bsd/gc/z/zNUMA_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zNUMA.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp b/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp
index 16835c8303931..37c855c2e2be5 100644
--- a/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp
+++ b/src/hotspot/os/bsd/gc/z/zPhysicalMemoryBacking_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zErrno.hpp"
#include "gc/z/zGlobals.hpp"
@@ -102,7 +101,7 @@ bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const {
assert(is_aligned(untype(offset), os::vm_page_size()), "Invalid offset");
assert(is_aligned(length, os::vm_page_size()), "Invalid length");
- log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
+ log_trace(gc, heap)("Committing memory: %zuM-%zuM (%zuM)",
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
const uintptr_t addr = _base + untype(offset);
@@ -149,7 +148,7 @@ size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) const {
assert(is_aligned(untype(offset), os::vm_page_size()), "Invalid offset");
assert(is_aligned(length, os::vm_page_size()), "Invalid length");
- log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
+ log_trace(gc, heap)("Uncommitting memory: %zuM-%zuM (%zuM)",
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
const uintptr_t start = _base + untype(offset);
diff --git a/src/hotspot/os/bsd/memMapPrinter_macosx.cpp b/src/hotspot/os/bsd/memMapPrinter_macosx.cpp
index 33c30ab6f7099..477803001cb9f 100644
--- a/src/hotspot/os/bsd/memMapPrinter_macosx.cpp
+++ b/src/hotspot/os/bsd/memMapPrinter_macosx.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -25,8 +25,6 @@
#if defined(__APPLE__)
-#include "precompiled.hpp"
-
#include "nmt/memMapPrinter.hpp"
#include "runtime/os.hpp"
#include "utilities/align.hpp"
@@ -380,4 +378,4 @@ void MemMapPrinter::pd_print_all_mappings(const MappingPrintSession& session) {
summary.print_on(session);
st->cr();
}
-#endif // __APPLE__
\ No newline at end of file
+#endif // __APPLE__
diff --git a/src/hotspot/os/bsd/osThread_bsd.cpp b/src/hotspot/os/bsd/osThread_bsd.cpp
index d9624040bc740..db476e529ac2b 100644
--- a/src/hotspot/os/bsd/osThread_bsd.cpp
+++ b/src/hotspot/os/bsd/osThread_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "runtime/mutex.hpp"
#include "runtime/osThread.hpp"
diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp
index 5db846275d4b4..b386169138faf 100644
--- a/src/hotspot/os/bsd/os_bsd.cpp
+++ b/src/hotspot/os/bsd/os_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-// no precompiled headers
#include "classfile/vmSymbols.hpp"
#include "code/vtableStubs.hpp"
#include "compiler/compileBroker.hpp"
@@ -605,7 +604,7 @@ static void *thread_native_entry(Thread *thread) {
}
}
- log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
+ log_info(os, thread)("Thread is alive (tid: %zu, pthread id: %zu).",
os::current_thread_id(), (uintx) pthread_self());
// call one more level start routine
@@ -615,7 +614,7 @@ static void *thread_native_entry(Thread *thread) {
// Prevent dereferencing it from here on out.
thread = nullptr;
- log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
+ log_info(os, thread)("Thread finished (tid: %zu, pthread id: %zu).",
os::current_thread_id(), (uintx) pthread_self());
return 0;
@@ -660,7 +659,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
char buf[64];
if (ret == 0) {
- log_info(os, thread)("Thread \"%s\" started (pthread id: " UINTX_FORMAT ", attributes: %s). ",
+ log_info(os, thread)("Thread \"%s\" started (pthread id: %zu, attributes: %s). ",
thread->name(), (uintx) tid, os::Posix::describe_pthread_attr(buf, sizeof(buf), &attr));
} else {
log_warning(os, thread)("Failed to start thread \"%s\" - pthread_create failed (%s) for attributes: %s.",
@@ -744,8 +743,8 @@ bool os::create_attached_thread(JavaThread* thread) {
// and save the caller's signal mask
PosixSignals::hotspot_sigmask(thread);
- log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT
- ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).",
+ log_info(os, thread)("Thread attached (tid: %zu, pthread id: %zu"
+ ", stack: " PTR_FORMAT " - " PTR_FORMAT " (%zuK) ).",
os::current_thread_id(), (uintx) pthread_self(),
p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size() / K);
return true;
@@ -1459,7 +1458,7 @@ void os::print_memory_info(outputStream* st) {
size_t size = sizeof(swap_usage);
st->print("Memory:");
- st->print(" " SIZE_FORMAT "k page", os::vm_page_size()>>10);
+ st->print(" %zuk page", os::vm_page_size()>>10);
st->print(", physical " UINT64_FORMAT "k",
os::physical_memory() >> 10);
@@ -1586,7 +1585,7 @@ void os::jvm_path(char *buf, jint buflen) {
static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
int err) {
- warning("INFO: os::commit_memory(" INTPTR_FORMAT ", " SIZE_FORMAT
+ warning("INFO: os::commit_memory(" INTPTR_FORMAT ", %zu"
", %d) failed; error='%s' (errno=%d)", (intptr_t)addr, size, exec,
os::errno_name(err), err);
}
@@ -2524,7 +2523,7 @@ bool os::start_debugging(char *buf, int buflen) {
jio_snprintf(p, buflen-len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n"
+ "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread %zd (" INTPTR_FORMAT ")\n"
"Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(), os::current_process_id(),
diff --git a/src/hotspot/os/bsd/os_perf_bsd.cpp b/src/hotspot/os/bsd/os_perf_bsd.cpp
index 631d2135b6475..78d9519c3a71a 100644
--- a/src/hotspot/os/bsd/os_perf_bsd.cpp
+++ b/src/hotspot/os/bsd/os_perf_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/bsd/semaphore_bsd.cpp b/src/hotspot/os/bsd/semaphore_bsd.cpp
index 849dafb36ee6d..771756ea5e028 100644
--- a/src/hotspot/os/bsd/semaphore_bsd.cpp
+++ b/src/hotspot/os/bsd/semaphore_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "semaphore_bsd.hpp"
#include "runtime/os.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/os/linux/cgroupSubsystem_linux.cpp b/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
index 4a8fda432d894..bb51d4f3b8ee0 100644
--- a/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
+++ b/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
@@ -37,7 +37,7 @@
#include "utilities/globalDefinitions.hpp"
// controller names have to match the *_IDX indices
-static const char* cg_controller_name[] = { "cpu", "cpuset", "cpuacct", "memory", "pids" };
+static const char* cg_controller_name[] = { "cpuset", "cpu", "cpuacct", "memory", "pids" };
CgroupSubsystem* CgroupSubsystemFactory::create() {
CgroupV1MemoryController* memory = nullptr;
@@ -226,9 +226,10 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
char buf[MAXPATHLEN+1];
char *p;
bool is_cgroupsV2;
- // true iff all required controllers, memory, cpu, cpuset, cpuacct are enabled
+ // true iff all required controllers, memory, cpu, cpuacct are enabled
// at the kernel level.
// pids might not be enabled on older Linux distros (SLES 12.1, RHEL 7.1)
+ // cpuset might not be enabled on newer Linux distros (Fedora 41)
bool all_required_controllers_enabled;
/*
@@ -260,6 +261,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
cg_infos[MEMORY_IDX]._hierarchy_id = hierarchy_id;
cg_infos[MEMORY_IDX]._enabled = (enabled == 1);
} else if (strcmp(name, "cpuset") == 0) {
+ log_debug(os, container)("Detected optional cpuset controller entry in %s", proc_cgroups);
cg_infos[CPUSET_IDX]._name = os::strdup(name);
cg_infos[CPUSET_IDX]._hierarchy_id = hierarchy_id;
cg_infos[CPUSET_IDX]._enabled = (enabled == 1);
@@ -283,8 +285,8 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
is_cgroupsV2 = true;
all_required_controllers_enabled = true;
for (int i = 0; i < CG_INFO_LENGTH; i++) {
- // pids controller is optional. All other controllers are required
- if (i != PIDS_IDX) {
+ // pids and cpuset controllers are optional. All other controllers are required
+ if (i != PIDS_IDX && i != CPUSET_IDX) {
is_cgroupsV2 = is_cgroupsV2 && cg_infos[i]._hierarchy_id == 0;
all_required_controllers_enabled = all_required_controllers_enabled && cg_infos[i]._enabled;
}
diff --git a/src/hotspot/os/linux/gc/z/zLargePages_linux.cpp b/src/hotspot/os/linux/gc/z/zLargePages_linux.cpp
index a00572f08e769..c9f99a4b6db4d 100644
--- a/src/hotspot/os/linux/gc/z/zLargePages_linux.cpp
+++ b/src/hotspot/os/linux/gc/z/zLargePages_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zLargePages.hpp"
#include "hugepages.hpp"
#include "os_linux.hpp"
diff --git a/src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp b/src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp
index e24367219aa48..60ce39179ff14 100644
--- a/src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp
+++ b/src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zArray.inline.hpp"
#include "gc/z/zErrno.hpp"
diff --git a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp
index b648876ac602c..1ae4e18fcf142 100644
--- a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp
+++ b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zArray.inline.hpp"
@@ -185,13 +184,13 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity)
// Make sure the filesystem block size is compatible
if (ZGranuleSize % _block_size != 0) {
- ZInitialize::error("Filesystem backing the heap has incompatible block size (" SIZE_FORMAT ")",
+ ZInitialize::error("Filesystem backing the heap has incompatible block size (%zu)",
_block_size);
return;
}
if (is_hugetlbfs() && _block_size != ZGranuleSize) {
- ZInitialize::error("%s filesystem has unexpected block size " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
+ ZInitialize::error("%s filesystem has unexpected block size %zu (expected %zu)",
ZFILESYSTEM_HUGETLBFS, _block_size, ZGranuleSize);
return;
}
@@ -316,7 +315,7 @@ void ZPhysicalMemoryBacking::warn_available_space(size_t max_capacity) const {
return;
}
- log_info_p(gc, init)("Available space on backing filesystem: " SIZE_FORMAT "M", _available / M);
+ log_info_p(gc, init)("Available space on backing filesystem: %zuM", _available / M);
// Warn if the filesystem doesn't currently have enough space available to hold
// the max heap size. The max heap size will be capped if we later hit this limit
@@ -324,9 +323,9 @@ void ZPhysicalMemoryBacking::warn_available_space(size_t max_capacity) const {
if (_available < max_capacity) {
log_warning_p(gc)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****");
log_warning_p(gc)("Not enough space available on the backing filesystem to hold the current max Java heap");
- log_warning_p(gc)("size (" SIZE_FORMAT "M). Please adjust the size of the backing filesystem accordingly "
+ log_warning_p(gc)("size (%zuM). Please adjust the size of the backing filesystem accordingly "
"(available", max_capacity / M);
- log_warning_p(gc)("space is currently " SIZE_FORMAT "M). Continuing execution with the current filesystem "
+ log_warning_p(gc)("space is currently %zuM). Continuing execution with the current filesystem "
"size could", _available / M);
log_warning_p(gc)("lead to a premature OutOfMemoryError being thrown, due to failure to commit memory.");
}
@@ -342,7 +341,7 @@ void ZPhysicalMemoryBacking::warn_max_map_count(size_t max_capacity) const {
}
size_t actual_max_map_count = 0;
- const int result = fscanf(file, SIZE_FORMAT, &actual_max_map_count);
+ const int result = fscanf(file, "%zu", &actual_max_map_count);
fclose(file);
if (result != 1) {
// Failed to read file, skip check
@@ -359,9 +358,9 @@ void ZPhysicalMemoryBacking::warn_max_map_count(size_t max_capacity) const {
if (actual_max_map_count < required_max_map_count) {
log_warning_p(gc)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****");
log_warning_p(gc)("The system limit on number of memory mappings per process might be too low for the given");
- log_warning_p(gc)("max Java heap size (" SIZE_FORMAT "M). Please adjust %s to allow for at",
+ log_warning_p(gc)("max Java heap size (%zuM). Please adjust %s to allow for at",
max_capacity / M, filename);
- log_warning_p(gc)("least " SIZE_FORMAT " mappings (current limit is " SIZE_FORMAT "). Continuing execution "
+ log_warning_p(gc)("least %zu mappings (current limit is %zu). Continuing execution "
"with the current", required_max_map_count, actual_max_map_count);
log_warning_p(gc)("limit could lead to a premature OutOfMemoryError being thrown, due to failure to map memory.");
}
@@ -598,7 +597,7 @@ ZErrno ZPhysicalMemoryBacking::fallocate(bool punch_hole, zoffset offset, size_t
}
bool ZPhysicalMemoryBacking::commit_inner(zoffset offset, size_t length) const {
- log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
+ log_trace(gc, heap)("Committing memory: %zuM-%zuM (%zuM)",
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
retry:
@@ -698,7 +697,7 @@ size_t ZPhysicalMemoryBacking::commit(zoffset offset, size_t length) const {
}
size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) const {
- log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
+ log_trace(gc, heap)("Uncommitting memory: %zuM-%zuM (%zuM)",
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
const ZErrno err = fallocate(true /* punch_hole */, offset, length);
diff --git a/src/hotspot/os/linux/gc/z/zSyscall_linux.cpp b/src/hotspot/os/linux/gc/z/zSyscall_linux.cpp
index ba26cbfcb2456..83225be506ff1 100644
--- a/src/hotspot/os/linux/gc/z/zSyscall_linux.cpp
+++ b/src/hotspot/os/linux/gc/z/zSyscall_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zSyscall_linux.hpp"
#include OS_CPU_HEADER(gc/z/zSyscall)
diff --git a/src/hotspot/os/linux/hugepages.cpp b/src/hotspot/os/linux/hugepages.cpp
index c04ff7a4ca0e3..5472c093d3f30 100644
--- a/src/hotspot/os/linux/hugepages.cpp
+++ b/src/hotspot/os/linux/hugepages.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2024, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,9 +23,7 @@
*
*/
-#include "precompiled.hpp"
#include "hugepages.hpp"
-
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "runtime/globals_extension.hpp"
@@ -95,7 +93,7 @@ static bool read_number_file(const char* file, size_t* out) {
bool rc = false;
if (f != nullptr) {
uint64_t i = 0;
- if (::fscanf(f, SIZE_FORMAT, out) == 1) {
+ if (::fscanf(f, "%zu", out) == 1) {
rc = true;
}
::fclose(f);
@@ -155,7 +153,7 @@ void ExplicitHugePageSupport::scan_os() {
// that only exposes /proc/meminfo but not /sys/kernel/mm/hugepages. In that case, we are not
// sure about the state of hugepage support by the kernel, so we won't use explicit hugepages.
if (!_pagesizes.contains(_default_hugepage_size)) {
- log_info(pagesize)("Unexpected configuration: default pagesize (" SIZE_FORMAT ") "
+ log_info(pagesize)("Unexpected configuration: default pagesize (%zu) "
"has no associated directory in /sys/kernel/mm/hugepages..", _default_hugepage_size);
_inconsistent = true;
}
diff --git a/src/hotspot/os/linux/mallocInfoDcmd.cpp b/src/hotspot/os/linux/mallocInfoDcmd.cpp
index 9fd35e6fe6dbc..ad98d5edece19 100644
--- a/src/hotspot/os/linux/mallocInfoDcmd.cpp
+++ b/src/hotspot/os/linux/mallocInfoDcmd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "mallocInfoDcmd.hpp"
#include "os_linux.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/os/linux/memMapPrinter_linux.cpp b/src/hotspot/os/linux/memMapPrinter_linux.cpp
index 0b696b9914efe..b84921dd3bb08 100644
--- a/src/hotspot/os/linux/memMapPrinter_linux.cpp
+++ b/src/hotspot/os/linux/memMapPrinter_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "nmt/memMapPrinter.hpp"
#include "procMapsParser.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/linux/osThread_linux.cpp b/src/hotspot/os/linux/osThread_linux.cpp
index c9a44eb413f43..88e26a5d69b54 100644
--- a/src/hotspot/os/linux/osThread_linux.cpp
+++ b/src/hotspot/os/linux/osThread_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "runtime/mutex.hpp"
#include "runtime/osThread.hpp"
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 094ca2bf2fc91..92996789394e5 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "classfile/vmSymbols.hpp"
#include "code/vtableStubs.hpp"
#include "compiler/compileBroker.hpp"
@@ -847,7 +846,7 @@ static void *thread_native_entry(Thread *thread) {
}
}
- log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
+ log_info(os, thread)("Thread is alive (tid: %zu, pthread id: %zu).",
os::current_thread_id(), (uintx) pthread_self());
assert(osthread->pthread_id() != 0, "pthread_id was not set as expected");
@@ -863,7 +862,7 @@ static void *thread_native_entry(Thread *thread) {
// Prevent dereferencing it from here on out.
thread = nullptr;
- log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").",
+ log_info(os, thread)("Thread finished (tid: %zu, pthread id: %zu).",
os::current_thread_id(), (uintx) pthread_self());
return nullptr;
@@ -925,7 +924,7 @@ static size_t get_static_tls_area_size(const pthread_attr_t *attr) {
}
}
- log_info(os, thread)("Stack size adjustment for TLS is " SIZE_FORMAT,
+ log_info(os, thread)("Stack size adjustment for TLS is %zu",
tls_size);
return tls_size;
}
@@ -1032,7 +1031,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
// pthread_attr_setstacksize() function can fail
// if the stack size exceeds a system-imposed limit.
assert_status(status == EINVAL, status, "pthread_attr_setstacksize");
- log_warning(os, thread)("The %sthread stack size specified is invalid: " SIZE_FORMAT "k",
+ log_warning(os, thread)("The %sthread stack size specified is invalid: %zuk",
(thr_type == compiler_thread) ? "compiler " : ((thr_type == java_thread) ? "" : "VM "),
stack_size / K);
thread->set_osthread(nullptr);
@@ -1054,7 +1053,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
char buf[64];
if (ret == 0) {
- log_info(os, thread)("Thread \"%s\" started (pthread id: " UINTX_FORMAT ", attributes: %s). ",
+ log_info(os, thread)("Thread \"%s\" started (pthread id: %zu, attributes: %s). ",
thread->name(), (uintx) tid, os::Posix::describe_pthread_attr(buf, sizeof(buf), &attr));
// Print current timer slack if override is enabled and timer slack value is available.
@@ -1062,7 +1061,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
if (TimerSlack >= 0) {
int slack = prctl(PR_GET_TIMERSLACK);
if (slack >= 0) {
- log_info(os, thread)("Thread \"%s\" (pthread id: " UINTX_FORMAT ") timer slack: %dns",
+ log_info(os, thread)("Thread \"%s\" (pthread id: %zu) timer slack: %dns",
thread->name(), (uintx) tid, slack);
}
}
@@ -1170,8 +1169,8 @@ bool os::create_attached_thread(JavaThread* thread) {
// and save the caller's signal mask
PosixSignals::hotspot_sigmask(thread);
- log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT
- ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).",
+ log_info(os, thread)("Thread attached (tid: %zu, pthread id: %zu"
+ ", stack: " PTR_FORMAT " - " PTR_FORMAT " (%zuK) ).",
os::current_thread_id(), (uintx) pthread_self(),
p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size() / K);
@@ -1366,12 +1365,9 @@ void os::Linux::capture_initial_stack(size_t max_size) {
// Skip blank chars
do { s++; } while (s && isspace((unsigned char) *s));
-#define _UFM UINTX_FORMAT
-#define _DFM INTX_FORMAT
-
- // 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
- // 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
- i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld " _UFM _UFM _DFM _UFM _UFM _UFM _UFM,
+ // 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
+ // 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
+ i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %zu %zu %zd %zu %zu %zu %zu",
&state, // 3 %c
&ppid, // 4 %d
&pgrp, // 5 %d
@@ -1391,18 +1387,15 @@ void os::Linux::capture_initial_stack(size_t max_size) {
&nice, // 19 %ld
&junk, // 20 %ld
&it_real, // 21 %ld
- &start, // 22 UINTX_FORMAT
- &vsize, // 23 UINTX_FORMAT
- &rss, // 24 INTX_FORMAT
- &rsslim, // 25 UINTX_FORMAT
- &scodes, // 26 UINTX_FORMAT
- &ecode, // 27 UINTX_FORMAT
- &stack_start); // 28 UINTX_FORMAT
+ &start, // 22 %zu
+ &vsize, // 23 %zu
+ &rss, // 24 %zd
+ &rsslim, // 25 %zu
+ &scodes, // 26 %zu
+ &ecode, // 27 %zu
+ &stack_start); // 28 %zu
}
-#undef _UFM
-#undef _DFM
-
if (i != 28 - 2) {
assert(false, "Bad conversion from /proc/self/stat");
// product mode - assume we are the primordial thread, good luck in the
@@ -1463,8 +1456,8 @@ void os::Linux::capture_initial_stack(size_t max_size) {
bool primordial = uintptr_t(&rlim) > uintptr_t(_initial_thread_stack_bottom) &&
uintptr_t(&rlim) < stack_top;
- log_info(os, thread)("Capturing initial stack in %s thread: req. size: " SIZE_FORMAT "K, actual size: "
- SIZE_FORMAT "K, top=" INTPTR_FORMAT ", bottom=" INTPTR_FORMAT,
+ log_info(os, thread)("Capturing initial stack in %s thread: req. size: %zuK, actual size: "
+ "%zuK, top=" INTPTR_FORMAT ", bottom=" INTPTR_FORMAT,
primordial ? "primordial" : "user", max_size / K, _initial_thread_stack_size / K,
stack_top, intptr_t(_initial_thread_stack_bottom));
}
@@ -2312,14 +2305,14 @@ bool os::Linux::query_process_memory_info(os::Linux::meminfo_t* info) {
info->rssanon = info->rssfile = info->rssshmem = -1;
if (f != nullptr) {
while (::fgets(buf, sizeof(buf), f) != nullptr && num_found < num_values) {
- if ( (info->vmsize == -1 && sscanf(buf, "VmSize: " SSIZE_FORMAT " kB", &info->vmsize) == 1) ||
- (info->vmpeak == -1 && sscanf(buf, "VmPeak: " SSIZE_FORMAT " kB", &info->vmpeak) == 1) ||
- (info->vmswap == -1 && sscanf(buf, "VmSwap: " SSIZE_FORMAT " kB", &info->vmswap) == 1) ||
- (info->vmhwm == -1 && sscanf(buf, "VmHWM: " SSIZE_FORMAT " kB", &info->vmhwm) == 1) ||
- (info->vmrss == -1 && sscanf(buf, "VmRSS: " SSIZE_FORMAT " kB", &info->vmrss) == 1) ||
- (info->rssanon == -1 && sscanf(buf, "RssAnon: " SSIZE_FORMAT " kB", &info->rssanon) == 1) || // Needs Linux 4.5
- (info->rssfile == -1 && sscanf(buf, "RssFile: " SSIZE_FORMAT " kB", &info->rssfile) == 1) || // Needs Linux 4.5
- (info->rssshmem == -1 && sscanf(buf, "RssShmem: " SSIZE_FORMAT " kB", &info->rssshmem) == 1) // Needs Linux 4.5
+ if ( (info->vmsize == -1 && sscanf(buf, "VmSize: %zd kB", &info->vmsize) == 1) ||
+ (info->vmpeak == -1 && sscanf(buf, "VmPeak: %zd kB", &info->vmpeak) == 1) ||
+ (info->vmswap == -1 && sscanf(buf, "VmSwap: %zd kB", &info->vmswap) == 1) ||
+ (info->vmhwm == -1 && sscanf(buf, "VmHWM: %zd kB", &info->vmhwm) == 1) ||
+ (info->vmrss == -1 && sscanf(buf, "VmRSS: %zd kB", &info->vmrss) == 1) ||
+ (info->rssanon == -1 && sscanf(buf, "RssAnon: %zd kB", &info->rssanon) == 1) || // Needs Linux 4.5
+ (info->rssfile == -1 && sscanf(buf, "RssFile: %zd kB", &info->rssfile) == 1) || // Needs Linux 4.5
+ (info->rssshmem == -1 && sscanf(buf, "RssShmem: %zd kB", &info->rssshmem) == 1) // Needs Linux 4.5
)
{
num_found ++;
@@ -2367,15 +2360,15 @@ void os::Linux::print_process_memory_info(outputStream* st) {
// rss its components if the kernel is recent enough.
meminfo_t info;
if (query_process_memory_info(&info)) {
- st->print_cr("Virtual Size: " SSIZE_FORMAT "K (peak: " SSIZE_FORMAT "K)", info.vmsize, info.vmpeak);
- st->print("Resident Set Size: " SSIZE_FORMAT "K (peak: " SSIZE_FORMAT "K)", info.vmrss, info.vmhwm);
+ st->print_cr("Virtual Size: %zdK (peak: %zdK)", info.vmsize, info.vmpeak);
+ st->print("Resident Set Size: %zdK (peak: %zdK)", info.vmrss, info.vmhwm);
if (info.rssanon != -1) { // requires kernel >= 4.5
- st->print(" (anon: " SSIZE_FORMAT "K, file: " SSIZE_FORMAT "K, shmem: " SSIZE_FORMAT "K)",
+ st->print(" (anon: %zdK, file: %zdK, shmem: %zdK)",
info.rssanon, info.rssfile, info.rssshmem);
}
st->cr();
if (info.vmswap != -1) { // requires kernel >= 2.6.34
- st->print_cr("Swapped out: " SSIZE_FORMAT "K", info.vmswap);
+ st->print_cr("Swapped out: %zdK", info.vmswap);
}
} else {
st->print_cr("Could not open /proc/self/status to get process memory related information");
@@ -2396,7 +2389,7 @@ void os::Linux::print_process_memory_info(outputStream* st) {
// If legacy mallinfo(), we can still print the values if we are sure they cannot have wrapped.
might_have_wrapped = might_have_wrapped && (info.vmsize * K) > UINT_MAX;
#endif
- st->print_cr("C-Heap outstanding allocations: " SIZE_FORMAT "K, retained: " SIZE_FORMAT "K%s",
+ st->print_cr("C-Heap outstanding allocations: %zuK, retained: %zuK%s",
total_allocated / K, free_retained / K,
might_have_wrapped ? " (may have wrapped)" : "");
// Tunables
@@ -2524,7 +2517,7 @@ void os::Linux::print_steal_info(outputStream* st) {
void os::print_memory_info(outputStream* st) {
st->print("Memory:");
- st->print(" " SIZE_FORMAT "k page", os::vm_page_size()>>10);
+ st->print(" %zuk page", os::vm_page_size()>>10);
// values in struct sysinfo are "unsigned long"
struct sysinfo si;
@@ -2889,17 +2882,15 @@ static bool recoverable_mmap_error(int err) {
static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
int err) {
- warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
- ", %d) failed; error='%s' (errno=%d)", p2i(addr), size, exec,
- os::strerror(err), err);
+ warning("INFO: os::commit_memory(" PTR_FORMAT ", %zu, %d) failed; error='%s' (errno=%d)",
+ p2i(addr), size, exec, os::strerror(err), err);
}
static void warn_fail_commit_memory(char* addr, size_t size,
size_t alignment_hint, bool exec,
int err) {
- warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
- ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", p2i(addr), size,
- alignment_hint, exec, os::strerror(err), err);
+ warning("INFO: os::commit_memory(" PTR_FORMAT ", %zu, %zu, %d) failed; error='%s' (errno=%d)",
+ p2i(addr), size, alignment_hint, exec, os::strerror(err), err);
}
// NOTE: Linux kernel does not really reserve the pages for us.
@@ -3049,7 +3040,7 @@ size_t os::pd_pretouch_memory(void* first, void* last, size_t page_size) {
// OS will initially always use small pages.
return os::vm_page_size();
} else if (err != 0) {
- log_info(gc, os)("::madvise(" PTR_FORMAT ", " SIZE_FORMAT ", %d) failed; "
+ log_info(gc, os)("::madvise(" PTR_FORMAT ", %zu, %d) failed; "
"error='%s' (errno=%d)", p2i(first), len,
MADV_POPULATE_WRITE, os::strerror(err), err);
}
@@ -3766,7 +3757,7 @@ static bool hugetlbfs_sanity_check(size_t page_size) {
munmap(p, page_size);
return true;
} else {
- log_info(pagesize)("Large page size (" SIZE_FORMAT "%s) failed sanity check, "
+ log_info(pagesize)("Large page size (%zu%s) failed sanity check, "
"checking if smaller large page sizes are usable",
byte_size_in_exact_unit(page_size),
exact_unit_for_byte_size(page_size));
@@ -3778,7 +3769,7 @@ static bool hugetlbfs_sanity_check(size_t page_size) {
if (p != MAP_FAILED) {
// Mapping succeeded, sanity check passed.
munmap(p, page_size_);
- log_info(pagesize)("Large page size (" SIZE_FORMAT "%s) passed sanity check",
+ log_info(pagesize)("Large page size (%zu%s) passed sanity check",
byte_size_in_exact_unit(page_size_),
exact_unit_for_byte_size(page_size_));
return true;
@@ -3977,22 +3968,22 @@ void os::Linux::large_page_init() {
LargePageSizeInBytes == 0 ||
LargePageSizeInBytes == default_large_page_size) {
large_page_size = default_large_page_size;
- log_info(pagesize)("Using the default large page size: " SIZE_FORMAT "%s",
+ log_info(pagesize)("Using the default large page size: %zu%s",
byte_size_in_exact_unit(large_page_size),
exact_unit_for_byte_size(large_page_size));
} else {
if (all_large_pages.contains(LargePageSizeInBytes)) {
large_page_size = LargePageSizeInBytes;
- log_info(pagesize)("Overriding default large page size (" SIZE_FORMAT "%s) "
- "using LargePageSizeInBytes: " SIZE_FORMAT "%s",
+ log_info(pagesize)("Overriding default large page size (%zu%s) "
+ "using LargePageSizeInBytes: %zu%s",
byte_size_in_exact_unit(default_large_page_size),
exact_unit_for_byte_size(default_large_page_size),
byte_size_in_exact_unit(large_page_size),
exact_unit_for_byte_size(large_page_size));
} else {
large_page_size = default_large_page_size;
- log_info(pagesize)("LargePageSizeInBytes is not a valid large page size (" SIZE_FORMAT "%s) "
- "using the default large page size: " SIZE_FORMAT "%s",
+ log_info(pagesize)("LargePageSizeInBytes is not a valid large page size (%zu%s) "
+ "using the default large page size: %zu%s",
byte_size_in_exact_unit(LargePageSizeInBytes),
exact_unit_for_byte_size(LargePageSizeInBytes),
byte_size_in_exact_unit(large_page_size),
@@ -4037,7 +4028,7 @@ static void log_on_commit_special_failure(char* req_addr, size_t bytes,
assert(error == ENOMEM, "Only expect to fail if no memory is available");
log_info(pagesize)("Failed to reserve and commit memory with given page size. req_addr: " PTR_FORMAT
- " size: " SIZE_FORMAT "%s, page size: " SIZE_FORMAT "%s, (errno = %d)",
+ " size: %zu%s, page size: %zu%s, (errno = %d)",
p2i(req_addr), byte_size_in_exact_unit(bytes), exact_unit_for_byte_size(bytes),
byte_size_in_exact_unit(page_size), exact_unit_for_byte_size(page_size), error);
}
@@ -4066,8 +4057,7 @@ static bool commit_memory_special(size_t bytes,
return false;
}
- log_debug(pagesize)("Commit special mapping: " PTR_FORMAT ", size=" SIZE_FORMAT "%s, page size="
- SIZE_FORMAT "%s",
+ log_debug(pagesize)("Commit special mapping: " PTR_FORMAT ", size=%zu%s, page size=%zu%s",
p2i(addr), byte_size_in_exact_unit(bytes),
exact_unit_for_byte_size(bytes),
byte_size_in_exact_unit(page_size),
@@ -4483,15 +4473,15 @@ void os::Linux::numa_init() {
// bitmask when externally configured to run on all or fewer nodes.
if (!Linux::libnuma_init()) {
- disable_numa("Failed to initialize libnuma");
+ disable_numa("Failed to initialize libnuma", true);
} else {
Linux::set_configured_numa_policy(Linux::identify_numa_policy());
if (Linux::numa_max_node() < 1) {
- disable_numa("Only a single NUMA node is available");
+ disable_numa("Only a single NUMA node is available", false);
} else if (Linux::is_bound_to_single_mem_node()) {
- disable_numa("The process is bound to a single NUMA node");
+ disable_numa("The process is bound to a single NUMA node", true);
} else if (Linux::mem_and_cpu_node_mismatch()) {
- disable_numa("The process memory and cpu node configuration does not match");
+ disable_numa("The process memory and cpu node configuration does not match", true);
} else {
LogTarget(Info,os) log;
LogStream ls(log);
@@ -4533,11 +4523,15 @@ void os::Linux::numa_init() {
}
}
-void os::Linux::disable_numa(const char* reason) {
+void os::Linux::disable_numa(const char* reason, bool warning) {
if ((UseNUMA && FLAG_IS_CMDLINE(UseNUMA)) ||
(UseNUMAInterleaving && FLAG_IS_CMDLINE(UseNUMAInterleaving))) {
- // Only issue a warning if the user explicitly asked for NUMA support
- log_warning(os)("NUMA support disabled: %s", reason);
+ // Only issue a message if the user explicitly asked for NUMA support
+ if (warning) {
+ log_warning(os)("NUMA support disabled: %s", reason);
+ } else {
+ log_info(os)("NUMA support disabled: %s", reason);
+ }
}
FLAG_SET_ERGO(UseNUMA, false);
FLAG_SET_ERGO(UseNUMAInterleaving, false);
@@ -5279,7 +5273,7 @@ bool os::start_debugging(char *buf, int buflen) {
jio_snprintf(p, buflen-len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " UINTX_FORMAT " (" INTPTR_FORMAT ")\n"
+ "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread %zu (" INTPTR_FORMAT ")\n"
"Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(), os::current_process_id(),
diff --git a/src/hotspot/os/linux/os_linux.hpp b/src/hotspot/os/linux/os_linux.hpp
index 1cd445138899c..29848580c4ad5 100644
--- a/src/hotspot/os/linux/os_linux.hpp
+++ b/src/hotspot/os/linux/os_linux.hpp
@@ -193,7 +193,7 @@ class os::Linux {
private:
static void numa_init();
- static void disable_numa(const char* reason);
+ static void disable_numa(const char* reason, bool warning);
typedef int (*sched_getcpu_func_t)(void);
typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen);
typedef int (*numa_node_to_cpus_v2_func_t)(int node, void *mask);
diff --git a/src/hotspot/os/linux/os_perf_linux.cpp b/src/hotspot/os/linux/os_perf_linux.cpp
index 996f83611b048..ea7535edb870f 100644
--- a/src/hotspot/os/linux/os_perf_linux.cpp
+++ b/src/hotspot/os/linux/os_perf_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "memory/allocation.inline.hpp"
#include "os_linux.inline.hpp"
diff --git a/src/hotspot/os/linux/procMapsParser.cpp b/src/hotspot/os/linux/procMapsParser.cpp
index 6dfd49a0596e3..71b828bcefbc5 100644
--- a/src/hotspot/os/linux/procMapsParser.cpp
+++ b/src/hotspot/os/linux/procMapsParser.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2024, Red Hat, Inc. and/or its affiliates.
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -23,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "procMapsParser.hpp"
#include "runtime/os.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp b/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp
index 2398beb736033..870b3f5016a97 100644
--- a/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp
+++ b/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "os_linux.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/os/linux/trimCHeapDCmd.cpp b/src/hotspot/os/linux/trimCHeapDCmd.cpp
index 26c066ffe5b6e..6b4cad03c1b55 100644
--- a/src/hotspot/os/linux/trimCHeapDCmd.cpp
+++ b/src/hotspot/os/linux/trimCHeapDCmd.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
- * Copyright (c) 2021, 2022, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/os.inline.hpp"
#include "trimCHeapDCmd.hpp"
diff --git a/src/hotspot/os/linux/waitBarrier_linux.cpp b/src/hotspot/os/linux/waitBarrier_linux.cpp
index 2be31ce8366bb..f1f5be0515213 100644
--- a/src/hotspot/os/linux/waitBarrier_linux.cpp
+++ b/src/hotspot/os/linux/waitBarrier_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/os/posix/attachListener_posix.cpp b/src/hotspot/os/posix/attachListener_posix.cpp
index fea2075296a40..27728d0ca1f6e 100644
--- a/src/hotspot/os/posix/attachListener_posix.cpp
+++ b/src/hotspot/os/posix/attachListener_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
diff --git a/src/hotspot/os/posix/gc/z/zArguments_posix.cpp b/src/hotspot/os/posix/gc/z/zArguments_posix.cpp
index 4e6d43b16e918..dd84ef169907e 100644
--- a/src/hotspot/os/posix/gc/z/zArguments_posix.cpp
+++ b/src/hotspot/os/posix/gc/z/zArguments_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zArguments.hpp"
bool ZArguments::is_os_supported() {
diff --git a/src/hotspot/os/posix/gc/z/zInitialize_posix.cpp b/src/hotspot/os/posix/gc/z/zInitialize_posix.cpp
index ad4af504d8daf..193cae28a4cce 100644
--- a/src/hotspot/os/posix/gc/z/zInitialize_posix.cpp
+++ b/src/hotspot/os/posix/gc/z/zInitialize_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zInitialize.hpp"
void ZInitialize::pd_initialize() {
diff --git a/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp b/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp
index 936e734e8ff07..a177fe2b63647 100644
--- a/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp
+++ b/src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zVirtualMemory.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/os/posix/jvm_posix.cpp b/src/hotspot/os/posix/jvm_posix.cpp
index a552e2695b59e..d34f2fc198b61 100644
--- a/src/hotspot/os/posix/jvm_posix.cpp
+++ b/src/hotspot/os/posix/jvm_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/osThread.hpp"
diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp
index 61214a4296998..6f756fbf64831 100644
--- a/src/hotspot/os/posix/os_posix.cpp
+++ b/src/hotspot/os/posix/os_posix.cpp
@@ -972,7 +972,7 @@ char* os::Posix::describe_pthread_attr(char* buf, size_t buflen, const pthread_a
// Work around glibc stack guard issue, see os::create_thread() in os_linux.cpp.
LINUX_ONLY(if (os::Linux::adjustStackSizeForGuardPages()) stack_size -= guard_size;)
pthread_attr_getdetachstate(attr, &detachstate);
- jio_snprintf(buf, buflen, "stacksize: " SIZE_FORMAT "k, guardsize: " SIZE_FORMAT "k, %s",
+ jio_snprintf(buf, buflen, "stacksize: %zuk, guardsize: %zuk, %s",
stack_size / K, guard_size / K,
(detachstate == PTHREAD_CREATE_DETACHED ? "detached" : "joinable"));
return buf;
diff --git a/src/hotspot/os/posix/perfMemory_posix.cpp b/src/hotspot/os/posix/perfMemory_posix.cpp
index 5fbd5e76c5aca..72f5311622bb1 100644
--- a/src/hotspot/os/posix/perfMemory_posix.cpp
+++ b/src/hotspot/os/posix/perfMemory_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmSymbols.hpp"
#include "jvm_io.h"
#include "logging/log.hpp"
@@ -1086,7 +1085,7 @@ static char* mmap_create_shared(size_t size) {
static void unmap_shared(char* addr, size_t bytes) {
int res;
if (MemTracker::enabled()) {
- ThreadCritical tc;
+ MemTracker::NmtVirtualMemoryLocker nvml;
res = ::munmap(addr, bytes);
if (res == 0) {
MemTracker::record_virtual_memory_release((address)addr, bytes);
@@ -1095,7 +1094,7 @@ static void unmap_shared(char* addr, size_t bytes) {
res = ::munmap(addr, bytes);
}
if (res != 0) {
- log_info(os)("os::release_memory failed (" PTR_FORMAT ", " SIZE_FORMAT ")", p2i(addr), bytes);
+ log_info(os)("os::release_memory failed (" PTR_FORMAT ", %zu)", p2i(addr), bytes);
}
}
@@ -1227,7 +1226,7 @@ static void mmap_attach_shared(int vmid, char** addr, size_t* sizep, TRAPS) {
*addr = mapAddress;
*sizep = size;
- log_debug(perf, memops)("mapped " SIZE_FORMAT " bytes for vmid %d at "
+ log_debug(perf, memops)("mapped %zu bytes for vmid %d at "
INTPTR_FORMAT, size, vmid, p2i((void*)mapAddress));
}
diff --git a/src/hotspot/os/posix/safefetch_sigjmp.cpp b/src/hotspot/os/posix/safefetch_sigjmp.cpp
index e141b8fb57317..57f0f8460bf7d 100644
--- a/src/hotspot/os/posix/safefetch_sigjmp.cpp
+++ b/src/hotspot/os/posix/safefetch_sigjmp.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/safefetch.hpp"
#include "sanitizers/address.hpp"
diff --git a/src/hotspot/os/posix/safefetch_static_posix.cpp b/src/hotspot/os/posix/safefetch_static_posix.cpp
index 5685a9e09f920..0e8f47fb2667d 100644
--- a/src/hotspot/os/posix/safefetch_static_posix.cpp
+++ b/src/hotspot/os/posix/safefetch_static_posix.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "os_posix.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/posix/semaphore_posix.cpp b/src/hotspot/os/posix/semaphore_posix.cpp
index 625abdf335b8b..23a5225eba3ef 100644
--- a/src/hotspot/os/posix/semaphore_posix.cpp
+++ b/src/hotspot/os/posix/semaphore_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#ifndef __APPLE__
#include "os_posix.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/posix/signals_posix.cpp b/src/hotspot/os/posix/signals_posix.cpp
index ddc7a05c2ff57..2c0ab6732c168 100644
--- a/src/hotspot/os/posix/signals_posix.cpp
+++ b/src/hotspot/os/posix/signals_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nativeInst.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/os/posix/suspendResume_posix.cpp b/src/hotspot/os/posix/suspendResume_posix.cpp
index 5256d9d888113..dbd0e791d77af 100644
--- a/src/hotspot/os/posix/suspendResume_posix.cpp
+++ b/src/hotspot/os/posix/suspendResume_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/atomic.hpp"
#include "suspendResume_posix.hpp"
diff --git a/src/hotspot/os/posix/threadCrashProtection_posix.cpp b/src/hotspot/os/posix/threadCrashProtection_posix.cpp
index 7d19b060479bc..06ecc844317e6 100644
--- a/src/hotspot/os/posix/threadCrashProtection_posix.cpp
+++ b/src/hotspot/os/posix/threadCrashProtection_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/thread.hpp"
#include "runtime/threadCrashProtection.hpp"
diff --git a/src/hotspot/os/posix/threadCritical_posix.cpp b/src/hotspot/os/posix/threadCritical_posix.cpp
index cd3b42e71ba8b..47fe98c7429f3 100644
--- a/src/hotspot/os/posix/threadCritical_posix.cpp
+++ b/src/hotspot/os/posix/threadCritical_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/threadCritical.hpp"
#include "utilities/compilerWarnings.hpp"
diff --git a/src/hotspot/os/posix/vmError_posix.cpp b/src/hotspot/os/posix/vmError_posix.cpp
index c1d89efa85596..9d6cd175c669b 100644
--- a/src/hotspot/os/posix/vmError_posix.cpp
+++ b/src/hotspot/os/posix/vmError_posix.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp"
#include "os_posix.hpp"
diff --git a/src/hotspot/os/windows/attachListener_windows.cpp b/src/hotspot/os/windows/attachListener_windows.cpp
index 8423fe42b7560..4e6f39b8f8189 100644
--- a/src/hotspot/os/windows/attachListener_windows.cpp
+++ b/src/hotspot/os/windows/attachListener_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/windows/decoder_windows.cpp b/src/hotspot/os/windows/decoder_windows.cpp
index 6a67a4eba9f2f..9bcab878e874f 100644
--- a/src/hotspot/os/windows/decoder_windows.cpp
+++ b/src/hotspot/os/windows/decoder_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "utilities/decoder.hpp"
#include "symbolengine.hpp"
#include "windbghelp.hpp"
diff --git a/src/hotspot/os/windows/gc/z/zArguments_windows.cpp b/src/hotspot/os/windows/gc/z/zArguments_windows.cpp
index e10a06648f0e7..f5449d6232071 100644
--- a/src/hotspot/os/windows/gc/z/zArguments_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zArguments_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zArguments.hpp"
#include "gc/z/zSyscall_windows.hpp"
diff --git a/src/hotspot/os/windows/gc/z/zInitialize_windows.cpp b/src/hotspot/os/windows/gc/z/zInitialize_windows.cpp
index 06b15c7db4172..a4751617ce7bd 100644
--- a/src/hotspot/os/windows/gc/z/zInitialize_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zInitialize_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zInitialize.hpp"
#include "gc/z/zSyscall_windows.hpp"
diff --git a/src/hotspot/os/windows/gc/z/zLargePages_windows.cpp b/src/hotspot/os/windows/gc/z/zLargePages_windows.cpp
index f5455cbc58b80..dcd178da8212b 100644
--- a/src/hotspot/os/windows/gc/z/zLargePages_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zLargePages_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zLargePages.hpp"
#include "gc/z/zSyscall_windows.hpp"
diff --git a/src/hotspot/os/windows/gc/z/zMapper_windows.cpp b/src/hotspot/os/windows/gc/z/zMapper_windows.cpp
index b2923a300e4bc..eadabcbb03026 100644
--- a/src/hotspot/os/windows/gc/z/zMapper_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zMapper_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zMapper_windows.hpp"
#include "gc/z/zSyscall_windows.hpp"
@@ -57,7 +56,7 @@
// they will be split before being used.
#define fatal_error(msg, addr, size) \
- fatal(msg ": " PTR_FORMAT " " SIZE_FORMAT "M (%d)", \
+ fatal(msg ": " PTR_FORMAT " %zuM (%d)", \
(addr), (size) / M, GetLastError())
zaddress_unsafe ZMapper::reserve(zaddress_unsafe addr, size_t size) {
@@ -251,7 +250,7 @@ void ZMapper::unreserve_for_shared_awe(zaddress_unsafe addr, size_t size) {
);
if (!res) {
- fatal("Failed to unreserve memory: " PTR_FORMAT " " SIZE_FORMAT "M (%d)",
+ fatal("Failed to unreserve memory: " PTR_FORMAT " %zuM (%d)",
untype(addr), size / M, GetLastError());
}
}
diff --git a/src/hotspot/os/windows/gc/z/zNUMA_windows.cpp b/src/hotspot/os/windows/gc/z/zNUMA_windows.cpp
index a0fe34c65041e..8a93b66f38902 100644
--- a/src/hotspot/os/windows/gc/z/zNUMA_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zNUMA_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zNUMA.hpp"
void ZNUMA::pd_initialize() {
diff --git a/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp b/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp
index 0a66f04d31c30..2764f51c13b98 100644
--- a/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zPhysicalMemoryBacking_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zGranuleMap.inline.hpp"
@@ -157,10 +156,10 @@ class ZPhysicalMemoryBackingLargePages : public ZPhysicalMemoryBackingImpl {
size_t npages_res = npages;
const bool res = AllocateUserPhysicalPages(ZAWESection, &npages_res, &_page_array[index]);
if (!res) {
- fatal("Failed to allocate physical memory " SIZE_FORMAT "M @ " PTR_FORMAT " (%d)",
+ fatal("Failed to allocate physical memory %zuM @ " PTR_FORMAT " (%d)",
size / M, untype(offset), GetLastError());
} else {
- log_debug(gc)("Allocated physical memory: " SIZE_FORMAT "M @ " PTR_FORMAT, size / M, untype(offset));
+ log_debug(gc)("Allocated physical memory: %zuM @ " PTR_FORMAT, size / M, untype(offset));
}
// AllocateUserPhysicalPages might not be able to allocate the requested amount of memory.
@@ -175,7 +174,7 @@ class ZPhysicalMemoryBackingLargePages : public ZPhysicalMemoryBackingImpl {
size_t npages_res = npages;
const bool res = FreeUserPhysicalPages(ZAWESection, &npages_res, &_page_array[index]);
if (!res) {
- fatal("Failed to uncommit physical memory " SIZE_FORMAT "M @ " PTR_FORMAT " (%d)",
+ fatal("Failed to uncommit physical memory %zuM @ " PTR_FORMAT " (%d)",
size, untype(offset), GetLastError());
}
@@ -188,7 +187,7 @@ class ZPhysicalMemoryBackingLargePages : public ZPhysicalMemoryBackingImpl {
const bool res = MapUserPhysicalPages((char*)untype(addr), npages, &_page_array[index]);
if (!res) {
- fatal("Failed to map view " PTR_FORMAT " " SIZE_FORMAT "M @ " PTR_FORMAT " (%d)",
+ fatal("Failed to map view " PTR_FORMAT " %zuM @ " PTR_FORMAT " (%d)",
untype(addr), size / M, untype(offset), GetLastError());
}
}
@@ -198,7 +197,7 @@ class ZPhysicalMemoryBackingLargePages : public ZPhysicalMemoryBackingImpl {
const bool res = MapUserPhysicalPages((char*)untype(addr), npages, nullptr);
if (!res) {
- fatal("Failed to unmap view " PTR_FORMAT " " SIZE_FORMAT "M (%d)",
+ fatal("Failed to unmap view " PTR_FORMAT " %zuM (%d)",
addr, size / M, GetLastError());
}
}
@@ -224,14 +223,14 @@ void ZPhysicalMemoryBacking::warn_commit_limits(size_t max_capacity) const {
}
size_t ZPhysicalMemoryBacking::commit(zoffset offset, size_t length) {
- log_trace(gc, heap)("Committing memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
+ log_trace(gc, heap)("Committing memory: %zuM-%zuM (%zuM)",
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
return _impl->commit(offset, length);
}
size_t ZPhysicalMemoryBacking::uncommit(zoffset offset, size_t length) {
- log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)",
+ log_trace(gc, heap)("Uncommitting memory: %zuM-%zuM (%zuM)",
untype(offset) / M, untype(to_zoffset_end(offset, length)) / M, length / M);
return _impl->uncommit(offset, length);
diff --git a/src/hotspot/os/windows/gc/z/zSyscall_windows.cpp b/src/hotspot/os/windows/gc/z/zSyscall_windows.cpp
index 68ebee5e655cc..527958770c0ea 100644
--- a/src/hotspot/os/windows/gc/z/zSyscall_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zSyscall_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zSyscall_windows.hpp"
#include "runtime/java.hpp"
diff --git a/src/hotspot/os/windows/gc/z/zVirtualMemory_windows.cpp b/src/hotspot/os/windows/gc/z/zVirtualMemory_windows.cpp
index 294935eda866c..392b16e38a308 100644
--- a/src/hotspot/os/windows/gc/z/zVirtualMemory_windows.cpp
+++ b/src/hotspot/os/windows/gc/z/zVirtualMemory_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zLargePages.inline.hpp"
diff --git a/src/hotspot/os/windows/include/jvm_md.h b/src/hotspot/os/windows/include/jvm_md.h
index a0e44a4561365..165b25a82f919 100644
--- a/src/hotspot/os/windows/include/jvm_md.h
+++ b/src/hotspot/os/windows/include/jvm_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -31,12 +31,12 @@
* JNI conversion, which should be sorted out later.
*/
+#include "jni.h"
+
#include
#include
#include
-#include "jni.h"
-
typedef int socklen_t;
#define JNI_LIB_PREFIX ""
diff --git a/src/hotspot/os/windows/iphlp_interface.cpp b/src/hotspot/os/windows/iphlp_interface.cpp
index 0d6a08b0bd0d4..d30def1749004 100644
--- a/src/hotspot/os/windows/iphlp_interface.cpp
+++ b/src/hotspot/os/windows/iphlp_interface.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "iphlp_interface.hpp"
#include "os_windows.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/windows/jvm_windows.cpp b/src/hotspot/os/windows/jvm_windows.cpp
index c3fa1645fcc58..da29b156ad688 100644
--- a/src/hotspot/os/windows/jvm_windows.cpp
+++ b/src/hotspot/os/windows/jvm_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "os_windows.hpp"
#include "runtime/interfaceSupport.inline.hpp"
diff --git a/src/hotspot/os/windows/memMapPrinter_windows.cpp b/src/hotspot/os/windows/memMapPrinter_windows.cpp
index ff27aea02c592..075a64f5863b2 100644
--- a/src/hotspot/os/windows/memMapPrinter_windows.cpp
+++ b/src/hotspot/os/windows/memMapPrinter_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "nmt/memMapPrinter.hpp"
#include "os_windows.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os/windows/osThread_windows.cpp b/src/hotspot/os/windows/osThread_windows.cpp
index abbff6b3a78f9..f36e95c51c106 100644
--- a/src/hotspot/os/windows/osThread_windows.cpp
+++ b/src/hotspot/os/windows/osThread_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/osThread.hpp"
#include
diff --git a/src/hotspot/os/windows/os_perf_windows.cpp b/src/hotspot/os/windows/os_perf_windows.cpp
index 57dcd2710c876..9d04ae65954cc 100644
--- a/src/hotspot/os/windows/os_perf_windows.cpp
+++ b/src/hotspot/os/windows/os_perf_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "iphlp_interface.hpp"
#include "jvm_io.h"
#include "logging/log.hpp"
diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp
index afd8fe01752b0..b0676e9268d52 100644
--- a/src/hotspot/os/windows/os_windows.cpp
+++ b/src/hotspot/os/windows/os_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -24,7 +24,6 @@
// API level must be at least Windows Vista or Server 2008 to use InitOnceExecuteOnce
-// no precompiled headers
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/nativeInst.hpp"
@@ -146,26 +145,34 @@ LPTOP_LEVEL_EXCEPTION_FILTER previousUnhandledExceptionFilter = nullptr;
HINSTANCE vm_lib_handle;
+static void windows_preinit(HINSTANCE hinst) {
+ vm_lib_handle = hinst;
+ if (ForceTimeHighResolution) {
+ timeBeginPeriod(1L);
+ }
+ WindowsDbgHelp::pre_initialize();
+ SymbolEngine::pre_initialize();
+}
+
+static void windows_atexit() {
+ if (ForceTimeHighResolution) {
+ timeEndPeriod(1L);
+ }
+#if defined(USE_VECTORED_EXCEPTION_HANDLING)
+ if (topLevelVectoredExceptionHandler != nullptr) {
+ RemoveVectoredExceptionHandler(topLevelVectoredExceptionHandler);
+ topLevelVectoredExceptionHandler = nullptr;
+ }
+#endif
+}
+
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
switch (reason) {
case DLL_PROCESS_ATTACH:
- vm_lib_handle = hinst;
- if (ForceTimeHighResolution) {
- timeBeginPeriod(1L);
- }
- WindowsDbgHelp::pre_initialize();
- SymbolEngine::pre_initialize();
+ windows_preinit(hinst);
break;
case DLL_PROCESS_DETACH:
- if (ForceTimeHighResolution) {
- timeEndPeriod(1L);
- }
-#if defined(USE_VECTORED_EXCEPTION_HANDLING)
- if (topLevelVectoredExceptionHandler != nullptr) {
- RemoveVectoredExceptionHandler(topLevelVectoredExceptionHandler);
- topLevelVectoredExceptionHandler = nullptr;
- }
-#endif
+ windows_atexit();
break;
default:
break;
@@ -198,12 +205,12 @@ struct PreserveLastError {
static LPVOID virtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) {
LPVOID result = ::VirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect);
if (result != nullptr) {
- log_trace(os)("VirtualAlloc(" PTR_FORMAT ", " SIZE_FORMAT ", %x, %x) returned " PTR_FORMAT "%s.",
+ log_trace(os)("VirtualAlloc(" PTR_FORMAT ", %zu, %x, %x) returned " PTR_FORMAT "%s.",
p2i(lpAddress), dwSize, flAllocationType, flProtect, p2i(result),
((lpAddress != nullptr && result != lpAddress) ? " " : ""));
} else {
PreserveLastError ple;
- log_info(os)("VirtualAlloc(" PTR_FORMAT ", " SIZE_FORMAT ", %x, %x) failed (%u).",
+ log_info(os)("VirtualAlloc(" PTR_FORMAT ", %zu, %x, %x) failed (%u).",
p2i(lpAddress), dwSize, flAllocationType, flProtect, ple.v);
}
return result;
@@ -213,11 +220,11 @@ static LPVOID virtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationTy
static BOOL virtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) {
BOOL result = ::VirtualFree(lpAddress, dwSize, dwFreeType);
if (result != FALSE) {
- log_trace(os)("VirtualFree(" PTR_FORMAT ", " SIZE_FORMAT ", %x) succeeded",
+ log_trace(os)("VirtualFree(" PTR_FORMAT ", %zu, %x) succeeded",
p2i(lpAddress), dwSize, dwFreeType);
} else {
PreserveLastError ple;
- log_info(os)("VirtualFree(" PTR_FORMAT ", " SIZE_FORMAT ", %x) failed (%u).",
+ log_info(os)("VirtualFree(" PTR_FORMAT ", %zu, %x) failed (%u).",
p2i(lpAddress), dwSize, dwFreeType, ple.v);
}
return result;
@@ -228,12 +235,12 @@ static LPVOID virtualAllocExNuma(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSiz
DWORD flProtect, DWORD nndPreferred) {
LPVOID result = ::VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred);
if (result != nullptr) {
- log_trace(os)("VirtualAllocExNuma(" PTR_FORMAT ", " SIZE_FORMAT ", %x, %x, %x) returned " PTR_FORMAT "%s.",
+ log_trace(os)("VirtualAllocExNuma(" PTR_FORMAT ", %zu, %x, %x, %x) returned " PTR_FORMAT "%s.",
p2i(lpAddress), dwSize, flAllocationType, flProtect, nndPreferred, p2i(result),
((lpAddress != nullptr && result != lpAddress) ? " " : ""));
} else {
PreserveLastError ple;
- log_info(os)("VirtualAllocExNuma(" PTR_FORMAT ", " SIZE_FORMAT ", %x, %x, %x) failed (%u).",
+ log_info(os)("VirtualAllocExNuma(" PTR_FORMAT ", %zu, %x, %x, %x) failed (%u).",
p2i(lpAddress), dwSize, flAllocationType, flProtect, nndPreferred, ple.v);
}
return result;
@@ -245,12 +252,12 @@ static LPVOID mapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess,
LPVOID result = ::MapViewOfFileEx(hFileMappingObject, dwDesiredAccess, dwFileOffsetHigh,
dwFileOffsetLow, dwNumberOfBytesToMap, lpBaseAddress);
if (result != nullptr) {
- log_trace(os)("MapViewOfFileEx(" PTR_FORMAT ", " SIZE_FORMAT ") returned " PTR_FORMAT "%s.",
+ log_trace(os)("MapViewOfFileEx(" PTR_FORMAT ", %zu) returned " PTR_FORMAT "%s.",
p2i(lpBaseAddress), dwNumberOfBytesToMap, p2i(result),
((lpBaseAddress != nullptr && result != lpBaseAddress) ? " " : ""));
} else {
PreserveLastError ple;
- log_info(os)("MapViewOfFileEx(" PTR_FORMAT ", " SIZE_FORMAT ") failed (%u).",
+ log_info(os)("MapViewOfFileEx(" PTR_FORMAT ", %zu) failed (%u).",
p2i(lpBaseAddress), dwNumberOfBytesToMap, ple.v);
}
return result;
@@ -285,6 +292,8 @@ void os::run_periodic_checks(outputStream* st) {
static LONG WINAPI Uncaught_Exception_Handler(struct _EXCEPTION_POINTERS* exceptionInfo);
+#define JVM_LIB_NAME "jvm.dll"
+
void os::init_system_properties_values() {
// sysclasspath, java_home, dll_dir
{
@@ -300,15 +309,27 @@ void os::init_system_properties_values() {
home_dir[MAX_PATH] = '\0';
} else {
os::jvm_path(home_dir, sizeof(home_dir));
- // Found the full path to jvm.dll.
- // Now cut the path to /jre if we can.
- *(strrchr(home_dir, '\\')) = '\0'; // get rid of \jvm.dll
+ // Found the full path to the binary. It is normally of this structure:
+ // /bin//jvm.dll
+ // but can also be like this for a statically linked binary:
+ // /bin/.exe
pslash = strrchr(home_dir, '\\');
if (pslash != nullptr) {
- *pslash = '\0'; // get rid of \{client|server}
+ if (strncmp(pslash + 1, JVM_LIB_NAME, strlen(JVM_LIB_NAME)) == 0) {
+ // Binary name is jvm.dll. Get rid of \jvm.dll.
+ *pslash = '\0';
+ }
+
+ // Get rid of \hotspot_variant>, if binary is jvm.dll,
+ // or cut off \, if it is a statically linked binary.
pslash = strrchr(home_dir, '\\');
if (pslash != nullptr) {
- *pslash = '\0'; // get rid of \bin
+ *pslash = '\0';
+ // Get rid of \bin
+ pslash = strrchr(home_dir, '\\');
+ if (pslash != nullptr) {
+ *pslash = '\0';
+ }
}
}
}
@@ -530,7 +551,7 @@ static unsigned thread_native_entry(void* t) {
res = 20115; // java thread
}
- log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ", stacksize: " SIZE_FORMAT "k).", os::current_thread_id(), thread->stack_size() / K);
+ log_info(os, thread)("Thread is alive (tid: %zu, stacksize: %zuk).", os::current_thread_id(), thread->stack_size() / K);
#ifdef USE_VECTORED_EXCEPTION_HANDLING
// Any exception is caught by the Vectored Exception Handler, so VM can
@@ -552,7 +573,7 @@ static unsigned thread_native_entry(void* t) {
// Note: at this point the thread object may already have deleted itself.
// Do not dereference it from here on out.
- log_info(os, thread)("Thread finished (tid: " UINTX_FORMAT ").", os::current_thread_id());
+ log_info(os, thread)("Thread finished (tid: %zu).", os::current_thread_id());
// Thread must not return from exit_process_or_thread(), but if it does,
// let it proceed to exit normally
@@ -615,8 +636,8 @@ bool os::create_attached_thread(JavaThread* thread) {
thread->set_osthread(osthread);
- log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", stack: "
- PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "K) ).",
+ log_info(os, thread)("Thread attached (tid: %zu, stack: "
+ PTR_FORMAT " - " PTR_FORMAT " (%zuK) ).",
os::current_thread_id(), p2i(thread->stack_base()),
p2i(thread->stack_end()), thread->stack_size() / K);
@@ -649,7 +670,7 @@ static char* describe_beginthreadex_attributes(char* buf, size_t buflen,
if (stacksize == 0) {
ss.print("stacksize: default, ");
} else {
- ss.print("stacksize: " SIZE_FORMAT "k, ", stacksize / K);
+ ss.print("stacksize: %zuk, ", stacksize / K);
}
ss.print("flags: ");
#define PRINT_FLAG(f) if (initflag & f) ss.print( #f " ");
@@ -1402,9 +1423,7 @@ void* os::dll_lookup(void *lib, const char *name) {
}
void* os::lookup_function(const char* name) {
- // This is needed only for static builds which are not supported on Windows
- ShouldNotReachHere();
- return nullptr; // Satisfy compiler
+ return ::GetProcAddress(nullptr, name);
}
// Directory routines copied from src/win32/native/java/io/dirent_md.c
@@ -2071,7 +2090,7 @@ void os::get_summary_cpu_info(char* buf, size_t buflen) {
void os::print_memory_info(outputStream* st) {
st->print("Memory:");
- st->print(" " SIZE_FORMAT "k page", os::vm_page_size()>>10);
+ st->print(" %zuk page", os::vm_page_size()>>10);
// Use GlobalMemoryStatusEx() because GlobalMemoryStatus() may return incorrect
// value if total memory is larger than 4GB
@@ -3337,7 +3356,7 @@ char* os::pd_attempt_reserve_memory_at(char* addr, size_t bytes, bool exec) {
}
if (Verbose && PrintMiscellaneous) {
reserveTimer.stop();
- tty->print_cr("reserve_memory of %Ix bytes took " JLONG_FORMAT " ms (" JLONG_FORMAT " ticks)", bytes,
+ tty->print_cr("reserve_memory of %zx bytes took " JLONG_FORMAT " ms (" JLONG_FORMAT " ticks)", bytes,
reserveTimer.milliseconds(), reserveTimer.ticks());
}
}
@@ -3421,7 +3440,7 @@ static char* find_aligned_address(size_t size, size_t alignment) {
}
static char* reserve_large_pages_aligned(size_t size, size_t alignment, bool exec) {
- log_debug(pagesize)("Reserving large pages at an aligned address, alignment=" SIZE_FORMAT "%s",
+ log_debug(pagesize)("Reserving large pages at an aligned address, alignment=%zu%s",
byte_size_in_exact_unit(alignment), exact_unit_for_byte_size(alignment));
// Will try to find a suitable address at most 20 times. The reason we need to try
@@ -3483,7 +3502,7 @@ static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec) {
int err = os::get_last_error();
char buf[256];
size_t buf_len = os::lasterror(buf, sizeof(buf));
- warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT
+ warning("INFO: os::commit_memory(" PTR_FORMAT ", %zu"
", %d) failed; error='%s' (DOS error/errno=%d)", addr, bytes,
exec, buf_len != 0 ? buf : "", err);
}
@@ -3619,10 +3638,7 @@ bool os::pd_release_memory(char* addr, size_t bytes) {
// Handle mapping error. We assert in debug, unconditionally print a warning in release.
if (err != nullptr) {
log_warning(os)("bad release: [" PTR_FORMAT "-" PTR_FORMAT "): %s", p2i(start), p2i(end), err);
-#ifdef ASSERT
- os::print_memory_mappings((char*)start, bytes, tty);
assert(false, "bad release: [" PTR_FORMAT "-" PTR_FORMAT "): %s", p2i(start), p2i(end), err);
-#endif
return false;
}
// Free this range
@@ -3713,7 +3729,7 @@ bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
int err = os::get_last_error();
char buf[256];
size_t buf_len = os::lasterror(buf, sizeof(buf));
- warning("INFO: os::protect_memory(" PTR_FORMAT ", " SIZE_FORMAT
+ warning("INFO: os::protect_memory(" PTR_FORMAT ", %zu"
") failed; error='%s' (DOS error/errno=%d)", addr, bytes,
buf_len != 0 ? buf : "", err);
}
@@ -4415,6 +4431,14 @@ bool os::message_box(const char* title, const char* message) {
// This is called _before_ the global arguments have been parsed
void os::init(void) {
+ if (is_vm_statically_linked()) {
+ // Mimick what is done in DllMain for non-static builds
+ HMODULE hModule = NULL;
+ GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, &hModule);
+ windows_preinit(hModule);
+ atexit(windows_atexit);
+ }
+
_initial_pid = _getpid();
win32::initialize_windows_version();
diff --git a/src/hotspot/os/windows/pdh_interface.cpp b/src/hotspot/os/windows/pdh_interface.cpp
index 3134dc3f24cce..6f63452e7d9d7 100644
--- a/src/hotspot/os/windows/pdh_interface.cpp
+++ b/src/hotspot/os/windows/pdh_interface.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "os_windows.hpp"
#include "pdh_interface.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os/windows/perfMemory_windows.cpp b/src/hotspot/os/windows/perfMemory_windows.cpp
index 06b057315cbdd..7a3791ced1a00 100644
--- a/src/hotspot/os/windows/perfMemory_windows.cpp
+++ b/src/hotspot/os/windows/perfMemory_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmSymbols.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
@@ -1561,7 +1560,7 @@ static size_t sharedmem_filesize(const char* filename, TRAPS) {
if ((statbuf.st_size == 0) || (statbuf.st_size % os::vm_page_size() != 0)) {
if (PrintMiscellaneous && Verbose) {
- warning("unexpected file size: size = " SIZE_FORMAT "\n",
+ warning("unexpected file size: size = %zu\n",
statbuf.st_size);
}
THROW_MSG_0(vmSymbols::java_io_IOException(),
@@ -1660,7 +1659,7 @@ static void open_file_mapping(int vmid, char** addrp, size_t* sizep, TRAPS) {
// invalidating the mapped view of the file
CloseHandle(fmh);
- log_debug(perf, memops)("mapped " SIZE_FORMAT " bytes for vmid %d at "
+ log_debug(perf, memops)("mapped %zu bytes for vmid %d at "
INTPTR_FORMAT, size, vmid, mapAddress);
}
@@ -1803,7 +1802,7 @@ void PerfMemory::detach(char* addr, size_t bytes) {
if (MemTracker::enabled()) {
// it does not go through os api, the operation has to record from here
- ThreadCritical tc;
+ MemTracker::NmtVirtualMemoryLocker nvml;
remove_file_mapping(addr);
MemTracker::record_virtual_memory_release((address)addr, bytes);
} else {
diff --git a/src/hotspot/os/windows/semaphore_windows.cpp b/src/hotspot/os/windows/semaphore_windows.cpp
index 22b06241841ff..098ca526803a1 100644
--- a/src/hotspot/os/windows/semaphore_windows.cpp
+++ b/src/hotspot/os/windows/semaphore_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "semaphore_windows.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/os/windows/sharedRuntimeRem.cpp b/src/hotspot/os/windows/sharedRuntimeRem.cpp
index 62a85e55a0107..aae93f701ec7b 100644
--- a/src/hotspot/os/windows/sharedRuntimeRem.cpp
+++ b/src/hotspot/os/windows/sharedRuntimeRem.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/sharedRuntime.hpp"
// These are copied defines originally from fdlibm.h.
diff --git a/src/hotspot/os/windows/symbolengine.cpp b/src/hotspot/os/windows/symbolengine.cpp
index 0d461e671bb34..83cb930f7bfec 100644
--- a/src/hotspot/os/windows/symbolengine.cpp
+++ b/src/hotspot/os/windows/symbolengine.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "utilities/globalDefinitions.hpp"
#include "symbolengine.hpp"
#include "utilities/debug.hpp"
@@ -526,7 +525,7 @@ namespace { // Do not export.
};
}
-// Called at DLL_PROCESS_ATTACH.
+// Called at DLL_PROCESS_ATTACH for dynamic builds, and from os::init() for static builds.
void SymbolEngine::pre_initialize() {
::InitializeCriticalSection(&g_cs);
}
diff --git a/src/hotspot/os/windows/symbolengine.hpp b/src/hotspot/os/windows/symbolengine.hpp
index 02d3ba9487d44..6f0f671f982e7 100644
--- a/src/hotspot/os/windows/symbolengine.hpp
+++ b/src/hotspot/os/windows/symbolengine.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -58,7 +58,7 @@ namespace SymbolEngine {
// missing - if any, and the dbhelp API version)
void print_state_on(outputStream* st);
- // Call at DLL_PROCESS_ATTACH.
+ // Called at DLL_PROCESS_ATTACH for dynamic builds, and from os::init() for static builds.
void pre_initialize();
};
diff --git a/src/hotspot/os/windows/systemMemoryBarrier_windows.cpp b/src/hotspot/os/windows/systemMemoryBarrier_windows.cpp
index 1ba27c4ced577..03811fcd64b69 100644
--- a/src/hotspot/os/windows/systemMemoryBarrier_windows.cpp
+++ b/src/hotspot/os/windows/systemMemoryBarrier_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "systemMemoryBarrier_windows.hpp"
#include
diff --git a/src/hotspot/os/windows/threadCrashProtection_windows.cpp b/src/hotspot/os/windows/threadCrashProtection_windows.cpp
index b8caa7aff5e78..07248c07426ac 100644
--- a/src/hotspot/os/windows/threadCrashProtection_windows.cpp
+++ b/src/hotspot/os/windows/threadCrashProtection_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/thread.hpp"
#include "runtime/threadCrashProtection.hpp"
diff --git a/src/hotspot/os/windows/threadCritical_windows.cpp b/src/hotspot/os/windows/threadCritical_windows.cpp
index c85143f80930d..35aa0839089bf 100644
--- a/src/hotspot/os/windows/threadCritical_windows.cpp
+++ b/src/hotspot/os/windows/threadCritical_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/atomic.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/threadCritical.hpp"
diff --git a/src/hotspot/os/windows/threadLocalStorage_windows.cpp b/src/hotspot/os/windows/threadLocalStorage_windows.cpp
index 7d809518aab33..f18c3fcb0a39f 100644
--- a/src/hotspot/os/windows/threadLocalStorage_windows.cpp
+++ b/src/hotspot/os/windows/threadLocalStorage_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/threadLocalStorage.hpp"
#include "utilities/debug.hpp"
#include
diff --git a/src/hotspot/os/windows/vmError_windows.cpp b/src/hotspot/os/windows/vmError_windows.cpp
index 705e04e77db45..1613f52136fb1 100644
--- a/src/hotspot/os/windows/vmError_windows.cpp
+++ b/src/hotspot/os/windows/vmError_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp"
#include "runtime/arguments.hpp"
diff --git a/src/hotspot/os/windows/windbghelp.cpp b/src/hotspot/os/windows/windbghelp.cpp
index 92c88d08cfc17..0de702580a306 100644
--- a/src/hotspot/os/windows/windbghelp.cpp
+++ b/src/hotspot/os/windows/windbghelp.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "utilities/ostream.hpp"
#include "windbghelp.hpp"
@@ -141,7 +140,7 @@ namespace { // Do not export.
};
}
-// Called at DLL_PROCESS_ATTACH.
+// Called at DLL_PROCESS_ATTACH for dynamic builds, and from os::init() for static builds.
void WindowsDbgHelp::pre_initialize() {
::InitializeCriticalSection(&g_cs);
}
diff --git a/src/hotspot/os/windows/windbghelp.hpp b/src/hotspot/os/windows/windbghelp.hpp
index e3e3826db29aa..cdfe781c3435a 100644
--- a/src/hotspot/os/windows/windbghelp.hpp
+++ b/src/hotspot/os/windows/windbghelp.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -67,7 +67,7 @@ namespace WindowsDbgHelp {
// missing - if any, and the dbhelp API version)
void print_state_on(outputStream* st);
- // Call at DLL_PROCESS_ATTACH.
+ // Called at DLL_PROCESS_ATTACH for dynamic builds, and from os::init() for static builds.
void pre_initialize();
};
diff --git a/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp b/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp
index 94e0c387a81dc..7cd57b65d32b3 100644
--- a/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp
+++ b/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* Copyright (c) 2022, IBM Corp.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
index 45d91c60ed42a..720c732327ea4 100644
--- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
+++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "assembler_ppc.hpp"
#include "asm/assembler.inline.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/os_cpu/bsd_aarch64/javaThread_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/javaThread_bsd_aarch64.cpp
index 336f194e276e4..fa40ef2b8f1c4 100644
--- a/src/hotspot/os_cpu/bsd_aarch64/javaThread_bsd_aarch64.cpp
+++ b/src/hotspot/os_cpu/bsd_aarch64/javaThread_bsd_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/metaspaceShared.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
index 1e3602d08f428..7b35317882da8 100644
--- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
+++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-// no precompiled headers
#include "asm/macroAssembler.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
index cbfda539321f3..5424b58da6d10 100644
--- a/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
+++ b/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/bsd_x86/assembler_bsd_x86.cpp b/src/hotspot/os_cpu/bsd_x86/assembler_bsd_x86.cpp
index dd20ea833c8d2..2dc6b32998ac5 100644
--- a/src/hotspot/os_cpu/bsd_x86/assembler_bsd_x86.cpp
+++ b/src/hotspot/os_cpu/bsd_x86/assembler_bsd_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os_cpu/bsd_x86/javaThread_bsd_x86.cpp b/src/hotspot/os_cpu/bsd_x86/javaThread_bsd_x86.cpp
index c636d147768d0..0b5e5b6e7bdd6 100644
--- a/src/hotspot/os_cpu/bsd_x86/javaThread_bsd_x86.cpp
+++ b/src/hotspot/os_cpu/bsd_x86/javaThread_bsd_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
index 153c5ad7e2b76..d11e7d8b90b62 100644
--- a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
+++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-// no precompiled headers
#include "asm/macroAssembler.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/os_cpu/bsd_x86/vm_version_bsd_x86.cpp b/src/hotspot/os_cpu/bsd_x86/vm_version_bsd_x86.cpp
index 3455a845eb97f..2d84caf2e84a6 100644
--- a/src/hotspot/os_cpu/bsd_x86/vm_version_bsd_x86.cpp
+++ b/src/hotspot/os_cpu/bsd_x86/vm_version_bsd_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/bsd_zero/javaThread_bsd_zero.cpp b/src/hotspot/os_cpu/bsd_zero/javaThread_bsd_zero.cpp
index d09516ff9eab6..0300103f72772 100644
--- a/src/hotspot/os_cpu/bsd_zero/javaThread_bsd_zero.cpp
+++ b/src/hotspot/os_cpu/bsd_zero/javaThread_bsd_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp b/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
index fa64c857eeeaa..29efae1adc874 100644
--- a/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
+++ b/src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "asm/assembler.inline.hpp"
#include "atomic_bsd_zero.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/os_cpu/bsd_zero/vm_version_bsd_zero.cpp b/src/hotspot/os_cpu/bsd_zero/vm_version_bsd_zero.cpp
index eaf1b85e4be58..48a9d1f835220 100644
--- a/src/hotspot/os_cpu/bsd_zero/vm_version_bsd_zero.cpp
+++ b/src/hotspot/os_cpu/bsd_zero/vm_version_bsd_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/linux_aarch64/javaThread_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/javaThread_linux_aarch64.cpp
index 533151096b341..d4d428c9ddca3 100644
--- a/src/hotspot/os_cpu/linux_aarch64/javaThread_linux_aarch64.cpp
+++ b/src/hotspot/os_cpu/linux_aarch64/javaThread_linux_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
index a7ec163f78553..171b40e414e25 100644
--- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
+++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "asm/macroAssembler.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
index 6102f70f06b7a..dabc69403f3d5 100644
--- a/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
+++ b/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/linux_arm/javaThread_linux_arm.cpp b/src/hotspot/os_cpu/linux_arm/javaThread_linux_arm.cpp
index 738017a08957a..3dc0035ed8716 100644
--- a/src/hotspot/os_cpu/linux_arm/javaThread_linux_arm.cpp
+++ b/src/hotspot/os_cpu/linux_arm/javaThread_linux_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.inline.hpp"
diff --git a/src/hotspot/os_cpu/linux_arm/macroAssembler_linux_arm_32.cpp b/src/hotspot/os_cpu/linux_arm/macroAssembler_linux_arm_32.cpp
index 0a3968ffa7064..e74daaa6d666a 100644
--- a/src/hotspot/os_cpu/linux_arm/macroAssembler_linux_arm_32.cpp
+++ b/src/hotspot/os_cpu/linux_arm/macroAssembler_linux_arm_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
index 861d0d20153f7..4debfaa077f06 100644
--- a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
+++ b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-// no precompiled headers
#include "asm/assembler.inline.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/os_cpu/linux_arm/vm_version_linux_arm_32.cpp b/src/hotspot/os_cpu/linux_arm/vm_version_linux_arm_32.cpp
index f1d29556e13cb..d1ef511d9d45c 100644
--- a/src/hotspot/os_cpu/linux_arm/vm_version_linux_arm_32.cpp
+++ b/src/hotspot/os_cpu/linux_arm/vm_version_linux_arm_32.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp b/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
index f9fc6cec7fac9..a1c3d616eea5d 100644
--- a/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
+++ b/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
index f3f9a3a88df67..11ac1b0178433 100644
--- a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "assembler_ppc.hpp"
#include "asm/assembler.inline.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/os_cpu/linux_riscv/javaThread_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/javaThread_linux_riscv.cpp
index c0dcba0ec51ea..4490ebcfdbf08 100644
--- a/src/hotspot/os_cpu/linux_riscv/javaThread_linux_riscv.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/javaThread_linux_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp
index a00659f37cb42..945280bca10b9 100644
--- a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "asm/macroAssembler.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
@@ -56,8 +55,9 @@
// put OS-includes here
# include
-# include
# include
+# include
+# include
# include
# include
# include
@@ -350,6 +350,72 @@ void os::print_context(outputStream *st, const void *context) {
st->print_cr("%-*.*s=" INTPTR_FORMAT, 8, 8, reg_abi_names[r], (uintptr_t)uc->uc_mcontext.__gregs[r]);
}
st->cr();
+ const struct __riscv_mc_d_ext_state * const f_ext_state = &(uc->uc_mcontext.__fpregs.__d);
+ st->print_cr("Floating point state:");
+ st->print_cr("fcsr=" UINT32_FORMAT, f_ext_state->__fcsr);
+ st->print_cr("Floating point registers:");
+ for (int r = 0; r < 32; r++) {
+ st->print_cr("f%d=" INTPTR_FORMAT, r, (intptr_t)f_ext_state->__f[r]);
+ }
+ st->cr();
+
+#ifdef NO_RVV_SIGCONTEXT
+ st->print_cr("Vector state: JVM compiled without vector sigcontext support");
+#else // ifndef NO_RVV_SIGCONTEXT
+// This magic number is not in any user-space header.
+// No other choice but to define it (arch/riscv/include/uapi/asm/sigcontext.h).
+#ifndef RISCV_V_MAGIC
+#define RISCV_V_MAGIC 0x53465457
+#endif
+
+ // Find the vector context
+ struct __riscv_extra_ext_header *ext = (struct __riscv_extra_ext_header *)(&uc->uc_mcontext.__fpregs);
+ if (ext->hdr.magic != RISCV_V_MAGIC) {
+ st->print_cr("Vector state: not found");
+ return;
+ }
+
+ // The size passed to user-space is calculated accordingly:
+ // size = sizeof(struct __riscv_ctx_hdr) + sizeof(struct __riscv_v_ext_state) + riscv_v_vsize;
+ uint32_t ext_size = ext->hdr.size;
+
+ if (ext_size < (sizeof(struct __riscv_ctx_hdr) + sizeof(struct __riscv_v_ext_state))) {
+ st->print_cr("Vector state: not found, invalid size");
+ return;
+ }
+
+ struct __riscv_v_ext_state *v_ext_state = (struct __riscv_v_ext_state *)((char *)(ext) + sizeof(struct __riscv_extra_ext_header));
+
+ st->print_cr("Vector state:");
+ st->print_cr("vstart=" INTPTR_FORMAT, v_ext_state->vstart);
+ st->print_cr("vl =" INTPTR_FORMAT, v_ext_state->vl);
+ st->print_cr("vtype =" INTPTR_FORMAT, v_ext_state->vtype);
+ st->print_cr("vcsr =" INTPTR_FORMAT, v_ext_state->vcsr);
+ st->print_cr("vlenb =" INTPTR_FORMAT, v_ext_state->vlenb);
+ st->print_cr("Vector registers:");
+
+ uint64_t vr_size = v_ext_state->vlenb;
+
+ // Registers are after the v extensions header.
+ ext_size -= (sizeof(struct __riscv_ctx_hdr) + sizeof(struct __riscv_v_ext_state));
+
+ if (ext_size != (32 * vr_size)) {
+ st->print_cr("Vector registers: not found, invalid size");
+ return;
+ }
+
+ // datap format is undocumented, but is generated by kernel function riscv_v_vstate_save().
+ uint8_t *regp = (uint8_t *)v_ext_state->datap;
+ for (int r = 0; r < 32; r++) {
+ st->print("v%d=0x", r);
+ for (int i = vr_size; i > 0; i--) {
+ st->print("%02" PRIx8, regp[i-1]);
+ }
+ st->print_cr("");
+ regp += vr_size;
+ }
+ st->cr();
+#endif // #ifndef NO_RVV_SIGCONTEXT
}
void os::print_register_info(outputStream *st, const void *context, int& continuation) {
diff --git a/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp b/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp
index 4ca977bd57609..16c1445179bb8 100644
--- a/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Rivos Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "riscv_flush_icache.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp b/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
index e65254fc5718f..10652660c7362 100644
--- a/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Rivos Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "riscv_hwprobe.hpp"
#include "runtime/os.hpp"
@@ -178,6 +177,9 @@ void RiscvHwprobe::add_features_from_query_result() {
if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZFH)) {
VM_Version::ext_Zfh.enable_feature();
}
+ if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZFHMIN)) {
+ VM_Version::ext_Zfhmin.enable_feature();
+ }
if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZVBC)) {
VM_Version::ext_Zvbc.enable_feature();
}
diff --git a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
index 323cab446274a..b6095c279cbf0 100644
--- a/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
+++ b/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2023, Rivos Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
#include "logging/log.hpp"
#include "riscv_hwprobe.hpp"
diff --git a/src/hotspot/os_cpu/linux_s390/javaThread_linux_s390.cpp b/src/hotspot/os_cpu/linux_s390/javaThread_linux_s390.cpp
index 2e930396ce460..5da39b13a144e 100644
--- a/src/hotspot/os_cpu/linux_s390/javaThread_linux_s390.cpp
+++ b/src/hotspot/os_cpu/linux_s390/javaThread_linux_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
index d599359d52903..192bfb6d537c2 100644
--- a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
+++ b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -25,7 +25,6 @@
// This file is organized as os_linux_x86.cpp.
-// no precompiled headers
#include "asm/assembler.inline.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/nativeInst.hpp"
diff --git a/src/hotspot/os_cpu/linux_x86/assembler_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/assembler_linux_x86.cpp
index dd20ea833c8d2..2dc6b32998ac5 100644
--- a/src/hotspot/os_cpu/linux_x86/assembler_linux_x86.cpp
+++ b/src/hotspot/os_cpu/linux_x86/assembler_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/os_cpu/linux_x86/javaThread_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/javaThread_linux_x86.cpp
index 145b9a3f0220a..6f0cd49951d6a 100644
--- a/src/hotspot/os_cpu/linux_x86/javaThread_linux_x86.cpp
+++ b/src/hotspot/os_cpu/linux_x86/javaThread_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
index e357747bfea46..3eb91412d8c48 100644
--- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-// no precompiled headers
#include "asm/macroAssembler.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/os_cpu/linux_x86/vm_version_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/vm_version_linux_x86.cpp
index ef85f6fb920f8..6907d2bf72790 100644
--- a/src/hotspot/os_cpu/linux_x86/vm_version_linux_x86.cpp
+++ b/src/hotspot/os_cpu/linux_x86/vm_version_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/linux_zero/javaThread_linux_zero.cpp b/src/hotspot/os_cpu/linux_zero/javaThread_linux_zero.cpp
index 4f4f4efad2eb6..0aadd9db18921 100644
--- a/src/hotspot/os_cpu/linux_zero/javaThread_linux_zero.cpp
+++ b/src/hotspot/os_cpu/linux_zero/javaThread_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp
index e8d67bcdddc28..01e207b73c863 100644
--- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp
+++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-// no precompiled headers
#include "asm/assembler.inline.hpp"
#include "atomic_linux_zero.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/os_cpu/linux_zero/vm_version_linux_zero.cpp b/src/hotspot/os_cpu/linux_zero/vm_version_linux_zero.cpp
index eaf1b85e4be58..48a9d1f835220 100644
--- a/src/hotspot/os_cpu/linux_zero/vm_version_linux_zero.cpp
+++ b/src/hotspot/os_cpu/linux_zero/vm_version_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/windows_aarch64/assembler_windows_aarch64.cpp b/src/hotspot/os_cpu/windows_aarch64/assembler_windows_aarch64.cpp
index 965613fd1e5bd..fefcfcb496d0c 100644
--- a/src/hotspot/os_cpu/windows_aarch64/assembler_windows_aarch64.cpp
+++ b/src/hotspot/os_cpu/windows_aarch64/assembler_windows_aarch64.cpp
@@ -23,4 +23,3 @@
*/
// nothing required here
-#include "precompiled.hpp"
diff --git a/src/hotspot/os_cpu/windows_aarch64/javaThread_windows_aarch64.cpp b/src/hotspot/os_cpu/windows_aarch64/javaThread_windows_aarch64.cpp
index df434398deb5c..8f6f1ccd38abe 100644
--- a/src/hotspot/os_cpu/windows_aarch64/javaThread_windows_aarch64.cpp
+++ b/src/hotspot/os_cpu/windows_aarch64/javaThread_windows_aarch64.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp b/src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp
index 24410ed920314..df77502b8606d 100644
--- a/src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp
+++ b/src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Microsoft Corporation. All rights reserved.
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp b/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp
index 3813287af0591..de9bf76fdb0ce 100644
--- a/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp
+++ b/src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/os_cpu/windows_x86/assembler_windows_x86.cpp b/src/hotspot/os_cpu/windows_x86/assembler_windows_x86.cpp
index c541213615cac..c0dd1ca23aae3 100644
--- a/src/hotspot/os_cpu/windows_x86/assembler_windows_x86.cpp
+++ b/src/hotspot/os_cpu/windows_x86/assembler_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
void MacroAssembler::int3() {
diff --git a/src/hotspot/os_cpu/windows_x86/javaThread_windows_x86.cpp b/src/hotspot/os_cpu/windows_x86/javaThread_windows_x86.cpp
index 23819d594a3e2..63edd9d8eda1b 100644
--- a/src/hotspot/os_cpu/windows_x86/javaThread_windows_x86.cpp
+++ b/src/hotspot/os_cpu/windows_x86/javaThread_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
index 9a23ac6733521..2617a0b5f2cf9 100644
--- a/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
+++ b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-// no precompiled headers
#include "asm/macroAssembler.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/vtableStubs.hpp"
diff --git a/src/hotspot/os_cpu/windows_x86/vm_version_windows_x86.cpp b/src/hotspot/os_cpu/windows_x86/vm_version_windows_x86.cpp
index ef85f6fb920f8..6907d2bf72790 100644
--- a/src/hotspot/os_cpu/windows_x86/vm_version_windows_x86.cpp
+++ b/src/hotspot/os_cpu/windows_x86/vm_version_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
diff --git a/src/hotspot/share/adlc/main.cpp b/src/hotspot/share/adlc/main.cpp
index f15b6e8813ff1..16fd4ddcf93c6 100644
--- a/src/hotspot/share/adlc/main.cpp
+++ b/src/hotspot/share/adlc/main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -210,7 +210,6 @@ int main(int argc, char *argv[])
AD.addIncludeGuardStart(AD._HPP_file, "GENERATED_ADFILES_AD_HPP"); // .hpp
AD.addIncludeGuardStart(AD._VM_file, "GENERATED_ADFILES_ADGLOBALS_HPP"); // .hpp
// Add includes
- AD.addInclude(AD._CPP_file, "precompiled.hpp");
AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._VM_file._name));
AD.addInclude(AD._CPP_file, "adfiles", get_basename(AD._HPP_file._name));
AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp");
@@ -245,26 +244,18 @@ int main(int argc, char *argv[])
AD.addInclude(AD._HPP_file, "opto/regalloc.hpp");
AD.addInclude(AD._HPP_file, "opto/subnode.hpp");
AD.addInclude(AD._HPP_file, "opto/vectornode.hpp");
- AD.addInclude(AD._CPP_CLONE_file, "precompiled.hpp");
AD.addInclude(AD._CPP_CLONE_file, "adfiles", get_basename(AD._HPP_file._name));
- AD.addInclude(AD._CPP_EXPAND_file, "precompiled.hpp");
AD.addInclude(AD._CPP_EXPAND_file, "adfiles", get_basename(AD._HPP_file._name));
AD.addInclude(AD._CPP_EXPAND_file, "oops/compressedOops.hpp");
- AD.addInclude(AD._CPP_FORMAT_file, "precompiled.hpp");
AD.addInclude(AD._CPP_FORMAT_file, "adfiles", get_basename(AD._HPP_file._name));
AD.addInclude(AD._CPP_FORMAT_file, "compiler/oopMap.hpp");
- AD.addInclude(AD._CPP_GEN_file, "precompiled.hpp");
AD.addInclude(AD._CPP_GEN_file, "adfiles", get_basename(AD._HPP_file._name));
AD.addInclude(AD._CPP_GEN_file, "opto/cfgnode.hpp");
AD.addInclude(AD._CPP_GEN_file, "opto/locknode.hpp");
AD.addInclude(AD._CPP_GEN_file, "opto/rootnode.hpp");
- AD.addInclude(AD._CPP_MISC_file, "precompiled.hpp");
AD.addInclude(AD._CPP_MISC_file, "adfiles", get_basename(AD._HPP_file._name));
- AD.addInclude(AD._CPP_PEEPHOLE_file, "precompiled.hpp");
AD.addInclude(AD._CPP_PEEPHOLE_file, "adfiles", get_basename(AD._HPP_file._name));
- AD.addInclude(AD._CPP_PIPELINE_file, "precompiled.hpp");
AD.addInclude(AD._CPP_PIPELINE_file, "adfiles", get_basename(AD._HPP_file._name));
- AD.addInclude(AD._DFA_file, "precompiled.hpp");
AD.addInclude(AD._DFA_file, "adfiles", get_basename(AD._HPP_file._name));
AD.addInclude(AD._DFA_file, "oops/compressedOops.hpp");
AD.addInclude(AD._DFA_file, "opto/cfgnode.hpp"); // Use PROB_MAX in predicate.
diff --git a/src/hotspot/share/asm/assembler.cpp b/src/hotspot/share/asm/assembler.cpp
index 4e19effff61ac..d415ddf004a25 100644
--- a/src/hotspot/share/asm/assembler.cpp
+++ b/src/hotspot/share/asm/assembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
diff --git a/src/hotspot/share/asm/codeBuffer.cpp b/src/hotspot/share/asm/codeBuffer.cpp
index 4aaf8b6daa248..2aa77abc5f2e7 100644
--- a/src/hotspot/share/asm/codeBuffer.cpp
+++ b/src/hotspot/share/asm/codeBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.hpp"
#include "code/compiledIC.hpp"
#include "code/oopRecorder.inline.hpp"
diff --git a/src/hotspot/share/asm/codeBuffer.hpp b/src/hotspot/share/asm/codeBuffer.hpp
index 343981e1a7bc5..025aa641d2c8b 100644
--- a/src/hotspot/share/asm/codeBuffer.hpp
+++ b/src/hotspot/share/asm/codeBuffer.hpp
@@ -607,7 +607,6 @@ class CodeBuffer: public StackObj DEBUG_ONLY(COMMA private Scrubber) {
// Properties
const char* name() const { return _name; }
- void set_name(const char* name) { _name = name; }
CodeBuffer* before_expand() const { return _before_expand; }
BufferBlob* blob() const { return _blob; }
void set_blob(BufferBlob* blob);
diff --git a/src/hotspot/share/asm/register.cpp b/src/hotspot/share/asm/register.cpp
index 85da369ca2098..c6ea693e4a9f5 100644
--- a/src/hotspot/share/asm/register.cpp
+++ b/src/hotspot/share/asm/register.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/register.hpp"
diff --git a/src/hotspot/share/c1/c1_CFGPrinter.cpp b/src/hotspot/share/c1/c1_CFGPrinter.cpp
index 5e167f5660c39..d178b69923864 100644
--- a/src/hotspot/share/c1/c1_CFGPrinter.cpp
+++ b/src/hotspot/share/c1/c1_CFGPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_CFGPrinter.hpp"
#include "c1/c1_IR.hpp"
#include "c1/c1_InstructionPrinter.hpp"
@@ -63,7 +62,7 @@ CFGPrinterOutput::CFGPrinterOutput(Compilation* compilation)
_do_print_LIR(false)
{
char file_name[O_BUFLEN];
- jio_snprintf(file_name, sizeof(file_name), "output_tid" UINTX_FORMAT "_pid%u.cfg",
+ jio_snprintf(file_name, sizeof(file_name), "output_tid%zu_pid%u.cfg",
os::current_thread_id(), os::current_process_id());
_output = new (mtCompiler) fileStream(file_name, "at");
}
diff --git a/src/hotspot/share/c1/c1_Canonicalizer.cpp b/src/hotspot/share/c1/c1_Canonicalizer.cpp
index 87657038a4ce0..9a8d517822fcc 100644
--- a/src/hotspot/share/c1/c1_Canonicalizer.cpp
+++ b/src/hotspot/share/c1/c1_Canonicalizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Canonicalizer.hpp"
#include "c1/c1_InstructionPrinter.hpp"
#include "c1/c1_ValueStack.hpp"
diff --git a/src/hotspot/share/c1/c1_Compilation.cpp b/src/hotspot/share/c1/c1_Compilation.cpp
index 7e0d439aff4ef..9b80c8a20a852 100644
--- a/src/hotspot/share/c1/c1_Compilation.cpp
+++ b/src/hotspot/share/c1/c1_Compilation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_CFGPrinter.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_IR.hpp"
diff --git a/src/hotspot/share/c1/c1_Compilation.hpp b/src/hotspot/share/c1/c1_Compilation.hpp
index 5f554496f932b..dab584ac3b084 100644
--- a/src/hotspot/share/c1/c1_Compilation.hpp
+++ b/src/hotspot/share/c1/c1_Compilation.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -30,6 +30,7 @@
#include "code/exceptionHandlerTable.hpp"
#include "compiler/compiler_globals.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
+#include "compiler/compilerDirectives.hpp"
#include "runtime/deoptimization.hpp"
class CompilationFailureInfo;
diff --git a/src/hotspot/share/c1/c1_Compiler.cpp b/src/hotspot/share/c1/c1_Compiler.cpp
index a0944c864e68f..a07a92b4419ae 100644
--- a/src/hotspot/share/c1/c1_Compiler.cpp
+++ b/src/hotspot/share/c1/c1_Compiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_Compiler.hpp"
#include "c1/c1_FrameMap.hpp"
diff --git a/src/hotspot/share/c1/c1_FrameMap.cpp b/src/hotspot/share/c1/c1_FrameMap.cpp
index a38e55572d4cd..f42a9f7035b67 100644
--- a/src/hotspot/share/c1/c1_FrameMap.cpp
+++ b/src/hotspot/share/c1/c1_FrameMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "code/vmreg.inline.hpp"
diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp
index 9925c592f6f10..e918aa7d19ae7 100644
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_CFGPrinter.hpp"
#include "c1/c1_Canonicalizer.hpp"
#include "c1/c1_Compilation.hpp"
diff --git a/src/hotspot/share/c1/c1_IR.cpp b/src/hotspot/share/c1/c1_IR.cpp
index b3faa54cc69b8..7f006c0b3ff5d 100644
--- a/src/hotspot/share/c1/c1_IR.cpp
+++ b/src/hotspot/share/c1/c1_IR.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_GraphBuilder.hpp"
diff --git a/src/hotspot/share/c1/c1_IR.hpp b/src/hotspot/share/c1/c1_IR.hpp
index 9dfcb8419c3f1..a9a7a02639095 100644
--- a/src/hotspot/share/c1/c1_IR.hpp
+++ b/src/hotspot/share/c1/c1_IR.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -27,6 +27,7 @@
#include "c1/c1_Instruction.hpp"
#include "ci/ciExceptionHandler.hpp"
+#include "ci/ciStreams.hpp"
#include "memory/allocation.hpp"
// An XHandler is a C1 internal description for an exception handler
diff --git a/src/hotspot/share/c1/c1_Instruction.cpp b/src/hotspot/share/c1/c1_Instruction.cpp
index 431bcea42cb5b..92affba99b24e 100644
--- a/src/hotspot/share/c1/c1_Instruction.cpp
+++ b/src/hotspot/share/c1/c1_Instruction.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_IR.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_InstructionPrinter.hpp"
diff --git a/src/hotspot/share/c1/c1_InstructionPrinter.cpp b/src/hotspot/share/c1/c1_InstructionPrinter.cpp
index 5f865ae518d00..35818188496f8 100644
--- a/src/hotspot/share/c1/c1_InstructionPrinter.cpp
+++ b/src/hotspot/share/c1/c1_InstructionPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmSymbols.hpp"
#include "c1/c1_InstructionPrinter.hpp"
#include "c1/c1_ValueStack.hpp"
diff --git a/src/hotspot/share/c1/c1_LIR.cpp b/src/hotspot/share/c1/c1_LIR.cpp
index 048eb6047ede9..fc90530ec95d8 100644
--- a/src/hotspot/share/c1/c1_LIR.cpp
+++ b/src/hotspot/share/c1/c1_LIR.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_InstructionPrinter.hpp"
#include "c1/c1_LIR.hpp"
@@ -452,12 +451,18 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
case lir_monaddr: // input and result always valid, info always invalid
case lir_null_check: // input and info always valid, result always invalid
case lir_move: // input and result always valid, may have info
+ case lir_sqrt: // FP Ops have no info, but input and result
+ case lir_abs:
+ case lir_neg:
+ case lir_f2hf:
+ case lir_hf2f:
{
assert(op->as_Op1() != nullptr, "must be");
LIR_Op1* op1 = (LIR_Op1*)op;
if (op1->_info) do_info(op1->_info);
if (op1->_opr->is_valid()) do_input(op1->_opr);
+ if (op1->_tmp->is_valid()) do_temp(op1->_tmp);
if (op1->_result->is_valid()) do_output(op1->_result);
break;
@@ -483,6 +488,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
assert(op1->_info != nullptr, ""); do_info(op1->_info);
if (op1->_opr->is_valid()) do_temp(op1->_opr); // safepoints on SPARC need temporary register
+ assert(op1->_tmp->is_illegal(), "not used");
assert(op1->_result->is_illegal(), "safepoint does not produce value");
break;
@@ -566,11 +572,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
case lir_add:
case lir_sub:
case lir_rem:
- case lir_sqrt:
- case lir_abs:
- case lir_neg:
- case lir_f2hf:
- case lir_hf2f:
case lir_logic_and:
case lir_logic_or:
case lir_logic_xor:
@@ -667,6 +668,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
assert(op1->_info == nullptr, "no info");
assert(op1->_opr->is_valid(), "exception oop"); do_input(op1->_opr);
+ assert(op1->_tmp->is_illegal(), "not used");
assert(op1->_result->is_illegal(), "no result");
break;
@@ -1614,7 +1616,7 @@ void LIR_Address::print_value_on(outputStream* out) const {
case times_8: out->print(" * 8"); break;
}
}
- out->print(" Disp: " INTX_FORMAT, _disp);
+ out->print(" Disp: %zd", _disp);
}
// debug output of block header without InstructionPrinter
@@ -1730,6 +1732,11 @@ const char * LIR_Op::name() const {
case lir_cond_float_branch: s = "flt_cond_br"; break;
case lir_move: s = "move"; break;
case lir_roundfp: s = "roundfp"; break;
+ case lir_abs: s = "abs"; break;
+ case lir_neg: s = "neg"; break;
+ case lir_sqrt: s = "sqrt"; break;
+ case lir_f2hf: s = "f2hf"; break;
+ case lir_hf2f: s = "hf2f"; break;
case lir_rtcall: s = "rtcall"; break;
case lir_throw: s = "throw"; break;
case lir_unwind: s = "unwind"; break;
@@ -1746,11 +1753,6 @@ const char * LIR_Op::name() const {
case lir_mul: s = "mul"; break;
case lir_div: s = "div"; break;
case lir_rem: s = "rem"; break;
- case lir_abs: s = "abs"; break;
- case lir_neg: s = "neg"; break;
- case lir_sqrt: s = "sqrt"; break;
- case lir_f2hf: s = "f2hf"; break;
- case lir_hf2f: s = "hf2f"; break;
case lir_logic_and: s = "logic_and"; break;
case lir_logic_or: s = "logic_or"; break;
case lir_logic_xor: s = "logic_xor"; break;
diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp
index c568caeca4b30..d9005c49c89d4 100644
--- a/src/hotspot/share/c1/c1_LIR.hpp
+++ b/src/hotspot/share/c1/c1_LIR.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -939,6 +939,11 @@ enum LIR_Code {
, lir_alloc_object
, lir_monaddr
, lir_roundfp
+ , lir_sqrt
+ , lir_abs
+ , lir_neg
+ , lir_f2hf
+ , lir_hf2f
, lir_safepoint
, lir_unwind
, lir_load_klass
@@ -955,13 +960,6 @@ enum LIR_Code {
, lir_mul
, lir_div
, lir_rem
- , lir_sqrt
- , lir_abs
- , lir_neg
- , lir_tan
- , lir_f2hf
- , lir_hf2f
- , lir_log10
, lir_logic_and
, lir_logic_or
, lir_logic_xor
@@ -1018,7 +1016,7 @@ enum LIR_Code {
, begin_opAssert
, lir_assert
, end_opAssert
-#ifdef INCLUDE_ZGC
+#if INCLUDE_ZGC
, begin_opXLoadBarrierTest
, lir_xloadbarrier_test
, end_opXLoadBarrierTest
@@ -1357,6 +1355,7 @@ class LIR_Op1: public LIR_Op {
protected:
LIR_Opr _opr; // input operand
+ LIR_Opr _tmp;
BasicType _type; // Operand types
LIR_PatchCode _patch; // only required with patchin (NEEDS_CLEANUP: do we want a special instruction for patching?)
@@ -1371,12 +1370,21 @@ class LIR_Op1: public LIR_Op {
LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result = LIR_OprFact::illegalOpr, BasicType type = T_ILLEGAL, LIR_PatchCode patch = lir_patch_none, CodeEmitInfo* info = nullptr)
: LIR_Op(code, result, info)
, _opr(opr)
+ , _tmp(LIR_OprFact::illegalOpr)
+ , _type(type)
+ , _patch(patch) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
+
+ LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result, LIR_Opr tmp, BasicType type = T_ILLEGAL, LIR_PatchCode patch = lir_patch_none, CodeEmitInfo* info = nullptr)
+ : LIR_Op(code, result, info)
+ , _opr(opr)
+ , _tmp(tmp)
, _type(type)
, _patch(patch) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
LIR_Op1(LIR_Code code, LIR_Opr opr, LIR_Opr result, BasicType type, LIR_PatchCode patch, CodeEmitInfo* info, LIR_MoveKind kind)
: LIR_Op(code, result, info)
, _opr(opr)
+ , _tmp(LIR_OprFact::illegalOpr)
, _type(type)
, _patch(patch) {
assert(code == lir_move, "must be");
@@ -1386,10 +1394,12 @@ class LIR_Op1: public LIR_Op {
LIR_Op1(LIR_Code code, LIR_Opr opr, CodeEmitInfo* info)
: LIR_Op(code, LIR_OprFact::illegalOpr, info)
, _opr(opr)
+ , _tmp(LIR_OprFact::illegalOpr)
, _type(T_ILLEGAL)
, _patch(lir_patch_none) { assert(is_in_range(code, begin_op1, end_op1), "code check"); }
LIR_Opr in_opr() const { return _opr; }
+ LIR_Opr tmp_opr() const { return _tmp; }
LIR_PatchCode patch_code() const { return _patch; }
BasicType type() const { return _type; }
@@ -1589,8 +1599,6 @@ class LIR_OpTypeCheck: public LIR_Op {
class LIR_Op2: public LIR_Op {
friend class LIR_OpVisitState;
- int _fpu_stack_size; // for sin/cos implementation on Intel
-
protected:
LIR_Opr _opr1;
LIR_Opr _opr2;
@@ -1607,7 +1615,6 @@ class LIR_Op2: public LIR_Op {
public:
LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, CodeEmitInfo* info = nullptr, BasicType type = T_ILLEGAL)
: LIR_Op(code, LIR_OprFact::illegalOpr, info)
- , _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _tmp1(LIR_OprFact::illegalOpr)
@@ -1622,7 +1629,6 @@ class LIR_Op2: public LIR_Op {
LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type)
: LIR_Op(code, result, nullptr)
- , _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _tmp1(LIR_OprFact::illegalOpr)
@@ -1639,7 +1645,6 @@ class LIR_Op2: public LIR_Op {
LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result = LIR_OprFact::illegalOpr,
CodeEmitInfo* info = nullptr, BasicType type = T_ILLEGAL)
: LIR_Op(code, result, info)
- , _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _tmp1(LIR_OprFact::illegalOpr)
@@ -1655,7 +1660,6 @@ class LIR_Op2: public LIR_Op {
LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr,
LIR_Opr tmp3 = LIR_OprFact::illegalOpr, LIR_Opr tmp4 = LIR_OprFact::illegalOpr, LIR_Opr tmp5 = LIR_OprFact::illegalOpr)
: LIR_Op(code, result, nullptr)
- , _fpu_stack_size(0)
, _opr1(opr1)
, _opr2(opr2)
, _tmp1(tmp1)
@@ -1683,9 +1687,6 @@ class LIR_Op2: public LIR_Op {
assert(code() == lir_cmp || code() == lir_branch || code() == lir_cond_float_branch, "only valid for branch"); _condition = condition;
}
- void set_fpu_stack_size(int size) { _fpu_stack_size = size; }
- int fpu_stack_size() const { return _fpu_stack_size; }
-
void set_in_opr1(LIR_Opr opr) { _opr1 = opr; }
void set_in_opr2(LIR_Opr opr) { _opr2 = opr; }
@@ -2272,15 +2273,13 @@ class LIR_List: public CompilationResourceObj {
void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
- void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); }
- void negate(LIR_Opr from, LIR_Opr to, LIR_Opr tmp = LIR_OprFact::illegalOpr) { append(new LIR_Op2(lir_neg, from, tmp, to)); }
- void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); }
+ void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op1(lir_abs , from, to, tmp)); }
+ void negate(LIR_Opr from, LIR_Opr to, LIR_Opr tmp = LIR_OprFact::illegalOpr) { append(new LIR_Op1(lir_neg, from, to, tmp)); }
+ void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op1(lir_sqrt, from, to, tmp)); }
void fmad(LIR_Opr from, LIR_Opr from1, LIR_Opr from2, LIR_Opr to) { append(new LIR_Op3(lir_fmad, from, from1, from2, to)); }
void fmaf(LIR_Opr from, LIR_Opr from1, LIR_Opr from2, LIR_Opr to) { append(new LIR_Op3(lir_fmaf, from, from1, from2, to)); }
- void log10 (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log10, from, LIR_OprFact::illegalOpr, to, tmp)); }
- void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); }
- void f2hf(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_f2hf, from, tmp, to)); }
- void hf2f(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_hf2f, from, tmp, to)); }
+ void f2hf(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op1(lir_f2hf, from, to, tmp)); }
+ void hf2f(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op1(lir_hf2f, from, to, tmp)); }
void add (LIR_Opr left, LIR_Opr right, LIR_Opr res) { append(new LIR_Op2(lir_add, left, right, res)); }
void sub (LIR_Opr left, LIR_Opr right, LIR_Opr res, CodeEmitInfo* info = nullptr) { append(new LIR_Op2(lir_sub, left, right, res, info)); }
diff --git a/src/hotspot/share/c1/c1_LIRAssembler.cpp b/src/hotspot/share/c1/c1_LIRAssembler.cpp
index 0fa4b3a4c93d7..a5930ba54d880 100644
--- a/src/hotspot/share/c1/c1_LIRAssembler.cpp
+++ b/src/hotspot/share/c1/c1_LIRAssembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_Instruction.hpp"
@@ -526,6 +525,17 @@ void LIR_Assembler::emit_op1(LIR_Op1* op) {
break;
}
+ case lir_abs:
+ case lir_sqrt:
+ case lir_f2hf:
+ case lir_hf2f:
+ intrinsic_op(op->code(), op->in_opr(), op->tmp_opr(), op->result_opr(), op);
+ break;
+
+ case lir_neg:
+ negate(op->in_opr(), op->result_opr(), op->tmp_opr());
+ break;
+
case lir_return: {
assert(op->as_OpReturn() != nullptr, "sanity");
LIR_OpReturn *ret_op = (LIR_OpReturn*)op;
@@ -723,19 +733,6 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) {
op->fpu_pop_count() == 1);
break;
- case lir_abs:
- case lir_sqrt:
- case lir_tan:
- case lir_log10:
- case lir_f2hf:
- case lir_hf2f:
- intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op);
- break;
-
- case lir_neg:
- negate(op->in_opr1(), op->result_opr(), op->in_opr2());
- break;
-
case lir_logic_and:
case lir_logic_or:
case lir_logic_xor:
diff --git a/src/hotspot/share/c1/c1_LIRAssembler.hpp b/src/hotspot/share/c1/c1_LIRAssembler.hpp
index eb89e3ea24870..34aa679daedd0 100644
--- a/src/hotspot/share/c1/c1_LIRAssembler.hpp
+++ b/src/hotspot/share/c1/c1_LIRAssembler.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -208,7 +208,7 @@ class LIR_Assembler: public CompilationResourceObj {
void arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack);
void arithmetic_idiv(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr temp, LIR_Opr result, CodeEmitInfo* info);
- void intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr unused, LIR_Opr dest, LIR_Op* op);
+ void intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr temp, LIR_Opr dest, LIR_Op* op);
#ifdef ASSERT
void emit_assert(LIR_OpAssert* op);
#endif
diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp
index 74fdf7a5b76a3..930e5e9df1bf7 100644
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Compilation.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_FrameMap.hpp"
@@ -1337,7 +1336,7 @@ void LIRGenerator::do_getModifiers(Intrinsic* x) {
__ cmove(lir_cond_equal, prim_klass, recv_klass, klass, T_ADDRESS);
// Get the answer.
- __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result);
+ __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_CHAR), result);
}
void LIRGenerator::do_getObjectSize(Intrinsic* x) {
diff --git a/src/hotspot/share/c1/c1_LinearScan.cpp b/src/hotspot/share/c1/c1_LinearScan.cpp
index a4d955e52a004..c099bb47d9726 100644
--- a/src/hotspot/share/c1/c1_LinearScan.cpp
+++ b/src/hotspot/share/c1/c1_LinearScan.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_CFGPrinter.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_Compilation.hpp"
@@ -6739,7 +6738,6 @@ void LinearScanStatistic::collect(LinearScan* allocator) {
case lir_abs:
case lir_f2hf:
case lir_hf2f:
- case lir_log10:
case lir_logic_and:
case lir_logic_or:
case lir_logic_xor:
diff --git a/src/hotspot/share/c1/c1_Optimizer.cpp b/src/hotspot/share/c1/c1_Optimizer.cpp
index d33e4d28bd0dd..f8339b0004993 100644
--- a/src/hotspot/share/c1/c1_Optimizer.cpp
+++ b/src/hotspot/share/c1/c1_Optimizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Optimizer.hpp"
#include "c1/c1_ValueSet.hpp"
#include "c1/c1_ValueStack.hpp"
diff --git a/src/hotspot/share/c1/c1_RangeCheckElimination.cpp b/src/hotspot/share/c1/c1_RangeCheckElimination.cpp
index a4c2976d26f13..6320fc15efefe 100644
--- a/src/hotspot/share/c1/c1_RangeCheckElimination.cpp
+++ b/src/hotspot/share/c1/c1_RangeCheckElimination.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_ValueStack.hpp"
#include "c1/c1_RangeCheckElimination.hpp"
#include "c1/c1_IR.hpp"
diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp
index 4ef2f8f3b0a80..d1b0818701cc1 100644
--- a/src/hotspot/share/c1/c1_Runtime1.cpp
+++ b/src/hotspot/share/c1/c1_Runtime1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/codeBuffer.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_Defs.hpp"
diff --git a/src/hotspot/share/c1/c1_ValueMap.cpp b/src/hotspot/share/c1/c1_ValueMap.cpp
index d9e1e11a3b876..2d7634f6308a5 100644
--- a/src/hotspot/share/c1/c1_ValueMap.cpp
+++ b/src/hotspot/share/c1/c1_ValueMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_IR.hpp"
#include "c1/c1_ValueMap.hpp"
#include "c1/c1_ValueSet.hpp"
diff --git a/src/hotspot/share/c1/c1_ValueStack.cpp b/src/hotspot/share/c1/c1_ValueStack.cpp
index 41424e36d0784..f1ac940bf162c 100644
--- a/src/hotspot/share/c1/c1_ValueStack.cpp
+++ b/src/hotspot/share/c1/c1_ValueStack.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_IR.hpp"
#include "c1/c1_InstructionPrinter.hpp"
#include "c1/c1_ValueStack.hpp"
diff --git a/src/hotspot/share/c1/c1_ValueType.cpp b/src/hotspot/share/c1/c1_ValueType.cpp
index d35d8adadfa99..7bfb884e8c804 100644
--- a/src/hotspot/share/c1/c1_ValueType.cpp
+++ b/src/hotspot/share/c1/c1_ValueType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_ValueType.hpp"
#include "ci/ciArray.hpp"
#include "ci/ciInstance.hpp"
diff --git a/src/hotspot/share/cds/aotArtifactFinder.cpp b/src/hotspot/share/cds/aotArtifactFinder.cpp
new file mode 100644
index 0000000000000..48f31635c63b9
--- /dev/null
+++ b/src/hotspot/share/cds/aotArtifactFinder.cpp
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+#include "cds/aotClassLinker.hpp"
+#include "cds/aotArtifactFinder.hpp"
+#include "cds/aotClassInitializer.hpp"
+#include "cds/dumpTimeClassInfo.inline.hpp"
+#include "cds/heapShared.hpp"
+#include "classfile/systemDictionaryShared.hpp"
+#include "logging/log.hpp"
+#include "memory/metaspaceClosure.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/objArrayKlass.hpp"
+#include "utilities/resourceHash.hpp"
+
+// All the classes that should be included in the AOT cache (in at least the "allocated" state)
+static GrowableArrayCHeap* _all_cached_classes = nullptr;
+
+// This is a stack that tracks all the AOT-inited classes that are waiting to be passed
+// to HeapShared::copy_and_rescan_aot_inited_mirror().
+static GrowableArrayCHeap* _pending_aot_inited_classes = nullptr;
+
+static const int TABLE_SIZE = 15889; // prime number
+using ClassesTable = ResourceHashtable;
+static ClassesTable* _seen_classes; // all classes that have been seen by AOTArtifactFinder
+static ClassesTable* _aot_inited_classes; // all classes that need to be AOT-initialized.
+
+void AOTArtifactFinder::initialize() {
+ _all_cached_classes = new GrowableArrayCHeap();
+ _pending_aot_inited_classes = new GrowableArrayCHeap();
+ _seen_classes = new (mtClass)ClassesTable();
+ _aot_inited_classes = new (mtClass)ClassesTable();
+}
+
+void AOTArtifactFinder::dispose() {
+ delete _all_cached_classes;
+ delete _seen_classes;
+ delete _aot_inited_classes;
+ delete _pending_aot_inited_classes;
+ _all_cached_classes = nullptr;
+ _seen_classes = nullptr;
+ _aot_inited_classes = nullptr;
+ _pending_aot_inited_classes = nullptr;
+}
+
+// Find all Klasses and oops that should be included in the AOT cache. See aotArtifactFinder.hpp
+void AOTArtifactFinder::find_artifacts() {
+ // Some classes might have been marked as excluded as a side effect of running
+ // AOTConstantPoolResolver. Make sure we check all the remaining ones.
+ //
+ // Note, if a class is not excluded, it does NOT mean it will be automatically included
+ // into the AOT cache -- that will be decided by the code below.
+ SystemDictionaryShared::finish_exclusion_checks();
+
+ start_scanning_for_oops();
+
+ // Add the primitive array classes
+ for (int i = T_BOOLEAN; i < T_VOID+1; i++) {
+ BasicType bt = (BasicType)i;
+ if (is_java_primitive(bt)) {
+ add_cached_type_array_class(Universe::typeArrayKlass(bt));
+ }
+ }
+
+#if INCLUDE_CDS_JAVA_HEAP
+ // Add the mirrors that aren't associated with a Klass
+ // - primitive mirrors (E.g., "int.class" in Java code)
+ // - mirror of fillerArrayKlass
+ if (CDSConfig::is_dumping_heap()) {
+ for (int i = T_BOOLEAN; i < T_VOID+1; i++) {
+ BasicType bt = (BasicType)i;
+ if (!is_reference_type(bt)) {
+ oop orig_mirror = Universe::java_mirror(bt);
+ oop scratch_mirror = HeapShared::scratch_java_mirror(bt);
+ HeapShared::scan_java_mirror(orig_mirror);
+ log_trace(cds, heap, mirror)(
+ "Archived %s mirror object from " PTR_FORMAT,
+ type2name(bt), p2i(scratch_mirror));
+ Universe::set_archived_basic_type_mirror_index(bt, HeapShared::append_root(scratch_mirror));
+ }
+ }
+
+ // Universe::fillerArrayKlass() isn't in the class hierarchy, so handle it specially.
+ HeapShared::scan_java_mirror(Universe::fillerArrayKlass()->java_mirror());
+ }
+#endif
+
+ // Add all the InstanceKlasses (and their array classes) that are always included.
+ SystemDictionaryShared::dumptime_table()->iterate_all_live_classes([&] (InstanceKlass* ik, DumpTimeClassInfo& info) {
+ if (!info.is_excluded()) {
+ bool add = false;
+ if (!ik->is_hidden()) {
+ // All non-hidden classes are always included into the AOT cache
+ add = true;
+ } else {
+ if (!CDSConfig::is_dumping_invokedynamic()) {
+ // Legacy support of lambda proxies -- these are always included into the AOT cache
+ if (SystemDictionaryShared::is_registered_lambda_proxy_class(ik)) {
+ add = true;
+ }
+ } else {
+ assert(!SystemDictionaryShared::is_registered_lambda_proxy_class(ik),
+ "registered lambda proxies are only for legacy lambda proxy support");
+ }
+ }
+
+ if (add) {
+ add_cached_instance_class(ik);
+ if (AOTClassInitializer::can_archive_initialized_mirror(ik)) {
+ add_aot_inited_class(ik);
+ }
+ }
+ }
+ });
+
+#if INCLUDE_CDS_JAVA_HEAP
+ // Keep scanning until we discover no more class that need to be AOT-initialized.
+ if (CDSConfig::is_initing_classes_at_dump_time()) {
+ while (_pending_aot_inited_classes->length() > 0) {
+ InstanceKlass* ik = _pending_aot_inited_classes->pop();
+ HeapShared::copy_and_rescan_aot_inited_mirror(ik);
+ }
+ }
+#endif
+
+ // Exclude all the (hidden) classes that have not been discovered by the code above.
+ SystemDictionaryShared::dumptime_table()->iterate_all_live_classes([&] (InstanceKlass* k, DumpTimeClassInfo& info) {
+ if (!info.is_excluded() && _seen_classes->get(k) == nullptr) {
+ info.set_excluded();
+ assert(k->is_hidden(), "must be");
+ if (log_is_enabled(Info, cds)) {
+ ResourceMark rm;
+ log_info(cds)("Skipping %s: Hidden class", k->name()->as_C_string());
+ }
+ }
+ });
+
+ end_scanning_for_oops();
+}
+
+void AOTArtifactFinder::start_scanning_for_oops() {
+#if INCLUDE_CDS_JAVA_HEAP
+ if (CDSConfig::is_dumping_heap()) {
+ HeapShared::start_scanning_for_oops();
+ }
+#endif
+}
+
+void AOTArtifactFinder::end_scanning_for_oops() {
+#if INCLUDE_CDS_JAVA_HEAP
+ if (CDSConfig::is_dumping_heap()) {
+ HeapShared::end_scanning_for_oops();
+ }
+#endif
+}
+
+void AOTArtifactFinder::add_aot_inited_class(InstanceKlass* ik) {
+ if (CDSConfig::is_initing_classes_at_dump_time()) {
+ assert(ik->is_initialized(), "must be");
+ add_cached_instance_class(ik);
+
+ bool created;
+ _aot_inited_classes->put_if_absent(ik, &created);
+ if (created) {
+ _pending_aot_inited_classes->push(ik);
+
+ InstanceKlass* s = ik->java_super();
+ if (s != nullptr) {
+ add_aot_inited_class(s);
+ }
+
+ Array* interfaces = ik->local_interfaces();
+ int len = interfaces->length();
+ for (int i = 0; i < len; i++) {
+ InstanceKlass* intf = interfaces->at(i);
+ if (intf->is_initialized()) {
+ add_aot_inited_class(intf);
+ }
+ }
+ }
+ }
+}
+
+void AOTArtifactFinder::add_cached_instance_class(InstanceKlass* ik) {
+ bool created;
+ _seen_classes->put_if_absent(ik, &created);
+ if (created) {
+ _all_cached_classes->append(ik);
+ scan_oops_in_instance_class(ik);
+ if (ik->is_hidden() && CDSConfig::is_initing_classes_at_dump_time()) {
+ bool succeed = AOTClassLinker::try_add_candidate(ik);
+ guarantee(succeed, "All cached hidden classes must be aot-linkable");
+ add_aot_inited_class(ik);
+ }
+ }
+}
+
+void AOTArtifactFinder::add_cached_type_array_class(TypeArrayKlass* tak) {
+ bool created;
+ _seen_classes->put_if_absent(tak, &created);
+ if (created) {
+ _all_cached_classes->append(tak);
+ scan_oops_in_array_class(tak);
+ }
+}
+
+void AOTArtifactFinder::add_cached_class(Klass* k) {
+ if (k->is_typeArray_klass()) {
+ add_cached_type_array_class(TypeArrayKlass::cast(k));
+ } else if (k->is_objArray_klass()) {
+ add_cached_class(ObjArrayKlass::cast(k)->element_klass());
+ } else {
+ add_cached_instance_class(InstanceKlass::cast(k));
+ }
+}
+
+void AOTArtifactFinder::scan_oops_in_instance_class(InstanceKlass* ik) {
+#if INCLUDE_CDS_JAVA_HEAP
+ if (CDSConfig::is_dumping_heap()) {
+ HeapShared::scan_java_class(ik);
+ scan_oops_in_array_class(ik->array_klasses());
+ }
+#endif
+}
+
+void AOTArtifactFinder::scan_oops_in_array_class(ArrayKlass* ak) {
+#if INCLUDE_CDS_JAVA_HEAP
+ if (CDSConfig::is_dumping_heap()) {
+ while (ak != nullptr) {
+ HeapShared::scan_java_class(ak);
+ ak = ak->array_klass_or_null();
+ }
+ }
+#endif
+}
+
+void AOTArtifactFinder::all_cached_classes_do(MetaspaceClosure* it) {
+ for (int i = 0; i < _all_cached_classes->length(); i++) {
+ it->push(_all_cached_classes->adr_at(i));
+ }
+}
diff --git a/src/hotspot/share/cds/aotArtifactFinder.hpp b/src/hotspot/share/cds/aotArtifactFinder.hpp
new file mode 100644
index 0000000000000..d890d874af9ef
--- /dev/null
+++ b/src/hotspot/share/cds/aotArtifactFinder.hpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+#ifndef SHARE_CDS_AOTARTIFACTFINDER_HPP
+#define SHARE_CDS_AOTARTIFACTFINDER_HPP
+
+#include "memory/allStatic.hpp"
+#include "utilities/exceptions.hpp"
+
+class ArrayKlass;
+class InstanceKlass;
+class MetaspaceClosure;
+class TypeArrayKlass;
+
+// AOTArtifactFinder finds (the roots of) all artifacts that should be included in the AOT cache. These include:
+// [1] C++ Klasses
+// [2] Java heap objects
+// It also decides what Klasses must be cached in aot-initialized state.
+//
+// ArchiveBuilder uses [1] as roots to scan for all MetaspaceObjs that need to be cached.
+// ArchiveHeapWriter uses [2] to create an image of the archived heap.
+//
+// [1] is stored in _all_cached_classes in aotArtifactFinder.cpp.
+// [2] is stored in HeapShared::archived_object_cache().
+//
+// Although many Klasses and heap objects are created in the assembly phase, we only store a subset of them into
+// the AOT cache. For example:
+// - Klasses that fail verification are excluded
+// - Many Klasses are stored in non-initialized state, so any initialized static fields in their
+// java mirrors must be cleared.
+// - To conserve space, we exclude any hidden classes that are not referenced.
+//
+// The discovery of [1] and [2] is interdependent, and is done inside AOTArtifactFinder::find()
+// - We first add a set of roots that must be included in the AOT cache
+// - mirrors of primitive classes (e.g., int.class in Java source code).
+// - primitive array classes
+// - non hidden classes
+// - registered lambda proxy classes
+// - Whenever a class is added, we scan its constant pool. This will discover references
+// to hidden classes. All such hidden classes are added.
+// - As heap objects (**Note2) and classes are discovered, we find out what classes must
+// be AOT-initialized:
+// - If we discover at least one instance of class X, then class X is AOT-initialized (** Note1).
+// - If AOTClassInitializer::can_archive_initialized_mirror(X) is true, then X is AOT-initialized.
+// - For each AOT-initialized class, we scan all the static fields in its java mirror. This will in
+// turn discover more Klasses and java heap objects.
+// - The scanning continues until we reach a steady state.
+//
+// Note1: See TODO comments in HeapShared::archive_object() for exceptions to this rule.
+//
+// Note2: The scanning of Java objects is done in heapShared.cpp. Please see calls into the HeapShared class
+// from AOTArtifactFinder.
+
+class AOTArtifactFinder : AllStatic {
+ static void start_scanning_for_oops();
+ static void end_scanning_for_oops();
+ static void scan_oops_in_instance_class(InstanceKlass* ik);
+ static void scan_oops_in_array_class(ArrayKlass* ak);
+ static void add_cached_type_array_class(TypeArrayKlass* tak);
+ static void add_cached_instance_class(InstanceKlass* ik);
+public:
+ static void initialize();
+ static void find_artifacts();
+ static void add_cached_class(Klass* k);
+ static void add_aot_inited_class(InstanceKlass* ik);
+ static void all_cached_classes_do(MetaspaceClosure* it);
+ static void dispose();
+};
+
+#endif // SHARE_CDS_AOTARTIFACTFINDER_HPP
diff --git a/src/hotspot/share/cds/aotClassInitializer.cpp b/src/hotspot/share/cds/aotClassInitializer.cpp
index b09dfcde6b105..5b022cae24465 100644
--- a/src/hotspot/share/cds/aotClassInitializer.cpp
+++ b/src/hotspot/share/cds/aotClassInitializer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotClassInitializer.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp"
@@ -103,25 +102,17 @@ bool AOTClassInitializer::can_archive_initialized_mirror(InstanceKlass* ik) {
return false;
}
- if (ik->is_hidden()) {
- return HeapShared::is_archivable_hidden_klass(ik);
- }
-
- if (ik->is_enum_subclass()) {
- return true;
- }
-
// About "static field that may hold a different value" errors:
//
// Automatic selection for aot-inited classes
// ==========================================
//
// When CDSConfig::is_initing_classes_at_dump_time() is enabled,
- // HeapShared::find_all_aot_initialized_classes() finds the classes of all
+ // AOTArtifactFinder::find_artifacts() finds the classes of all
// heap objects that are reachable from HeapShared::_run_time_special_subgraph,
// and mark these classes as aot-inited. This preserves the initialized
// mirrors of these classes, and their methods are NOT executed
- // at runtime.
+ // at runtime. See aotArtifactFinder.hpp for more info.
//
// For example, with -XX:+AOTInvokeDynamicLinking, _run_time_special_subgraph
// will contain some DirectMethodHandle objects. As a result, the DirectMethodHandle
@@ -268,9 +259,7 @@ bool AOTClassInitializer::can_archive_initialized_mirror(InstanceKlass* ik) {
// everybody's favorite super
{"java/lang/Object"},
- // above we selected all enums; we must include their super as well
- {"java/lang/Enum"},
- {nullptr}
+ {nullptr}
};
if (is_allowed(specs, ik)) {
return true;
@@ -356,4 +345,3 @@ void AOTClassInitializer::call_runtime_setup(JavaThread* current, InstanceKlass*
}
}
}
-
diff --git a/src/hotspot/share/cds/aotClassLinker.cpp b/src/hotspot/share/cds/aotClassLinker.cpp
index 8525ce928a817..a1cacd735dd68 100644
--- a/src/hotspot/share/cds/aotClassLinker.cpp
+++ b/src/hotspot/share/cds/aotClassLinker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/aotConstantPoolResolver.hpp"
#include "cds/aotLinkedClassTable.hpp"
@@ -146,9 +145,6 @@ bool AOTClassLinker::try_add_candidate(InstanceKlass* ik) {
if (!CDSConfig::is_dumping_invokedynamic()) {
return false;
}
- if (!SystemDictionaryShared::should_hidden_class_be_archived(ik)) {
- return false;
- }
if (HeapShared::is_lambda_proxy_klass(ik)) {
InstanceKlass* nest_host = ik->nest_host_not_null();
if (!try_add_candidate(nest_host)) {
@@ -316,4 +312,3 @@ const char* AOTClassLinker::class_category_name(AOTLinkedClassCategory category)
return "unreg";
}
}
-
diff --git a/src/hotspot/share/cds/aotConstantPoolResolver.cpp b/src/hotspot/share/cds/aotConstantPoolResolver.cpp
index 584be7085cef3..15ca2b2c2a0d7 100644
--- a/src/hotspot/share/cds/aotConstantPoolResolver.cpp
+++ b/src/hotspot/share/cds/aotConstantPoolResolver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/aotConstantPoolResolver.hpp"
#include "cds/archiveBuilder.hpp"
diff --git a/src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp b/src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp
index 9bab6042436d5..31d95024e3bfd 100644
--- a/src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp
+++ b/src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotClassInitializer.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/aotLinkedClassBulkLoader.hpp"
@@ -89,7 +88,7 @@ void AOTLinkedClassBulkLoader::exit_on_exception(JavaThread* current) {
ResourceMark rm(current);
if (current->pending_exception()->is_a(vmClasses::OutOfMemoryError_klass())) {
log_error(cds)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
- SIZE_FORMAT "M", MaxHeapSize/M);
+ "%zuM", MaxHeapSize/M);
} else {
log_error(cds)("%s: %s", current->pending_exception()->klass()->external_name(),
java_lang_String::as_utf8_string(java_lang_Throwable::message(current->pending_exception())));
diff --git a/src/hotspot/share/cds/aotLinkedClassTable.cpp b/src/hotspot/share/cds/aotLinkedClassTable.cpp
index bed090f00a972..b602c599f542f 100644
--- a/src/hotspot/share/cds/aotLinkedClassTable.cpp
+++ b/src/hotspot/share/cds/aotLinkedClassTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotLinkedClassTable.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/serializeClosure.hpp"
diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp
index 233b333ce6822..afd2d909595f5 100644
--- a/src/hotspot/share/cds/archiveBuilder.cpp
+++ b/src/hotspot/share/cds/archiveBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,7 @@
*
*/
-#include "precompiled.hpp"
+#include "cds/aotArtifactFinder.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/aotLinkedClassBulkLoader.hpp"
#include "cds/archiveBuilder.hpp"
@@ -153,9 +153,7 @@ void ArchiveBuilder::SourceObjList::relocate(int i, ArchiveBuilder* builder) {
ArchiveBuilder::ArchiveBuilder() :
_current_dump_region(nullptr),
_buffer_bottom(nullptr),
- _last_verified_top(nullptr),
_num_dump_regions_used(0),
- _other_region_used_bytes(0),
_requested_static_archive_bottom(nullptr),
_requested_static_archive_top(nullptr),
_requested_dynamic_archive_bottom(nullptr),
@@ -172,9 +170,7 @@ ArchiveBuilder::ArchiveBuilder() :
_ro_src_objs(),
_src_obj_table(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE),
_buffered_to_src_table(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE),
- _total_heap_region_size(0),
- _estimated_metaspaceobj_bytes(0),
- _estimated_hashtable_bytes(0)
+ _total_heap_region_size(0)
{
_klasses = new (mtClassShared) GrowableArray(4 * K, mtClassShared);
_symbols = new (mtClassShared) GrowableArray(256 * K, mtClassShared);
@@ -196,6 +192,8 @@ ArchiveBuilder::~ArchiveBuilder() {
if (_shared_rs.is_reserved()) {
MemoryReserver::release(_shared_rs);
}
+
+ AOTArtifactFinder::dispose();
}
// Returns a deterministic sequence of pseudo random numbers. The main purpose is NOT
@@ -233,13 +231,8 @@ bool ArchiveBuilder::gather_klass_and_symbol(MetaspaceClosure::Ref* ref, bool re
_klasses->append(klass);
if (klass->is_hidden()) {
assert(klass->is_instance_klass(), "must be");
- assert(SystemDictionaryShared::should_hidden_class_be_archived(InstanceKlass::cast(klass)), "must be");
}
}
- // See RunTimeClassInfo::get_for(): make sure we have enough space for both maximum
- // Klass alignment as well as the RuntimeInfo* pointer we will embed in front of a Klass.
- _estimated_metaspaceobj_bytes += align_up(BytesPerWord, CompressedKlassPointers::klass_alignment_in_bytes()) +
- align_up(sizeof(void*), SharedSpaceObjectAlignment);
} else if (ref->msotype() == MetaspaceObj::SymbolType) {
// Make sure the symbol won't be GC'ed while we are dumping the archive.
Symbol* sym = (Symbol*)ref->obj();
@@ -247,14 +240,15 @@ bool ArchiveBuilder::gather_klass_and_symbol(MetaspaceClosure::Ref* ref, bool re
_symbols->append(sym);
}
- int bytes = ref->size() * BytesPerWord;
- _estimated_metaspaceobj_bytes += align_up(bytes, SharedSpaceObjectAlignment);
-
return true; // recurse
}
void ArchiveBuilder::gather_klasses_and_symbols() {
ResourceMark rm;
+
+ AOTArtifactFinder::initialize();
+ AOTArtifactFinder::find_artifacts();
+
log_info(cds)("Gathering classes and symbols ... ");
GatherKlassesAndSymbols doit(this);
iterate_roots(&doit);
@@ -288,10 +282,6 @@ void ArchiveBuilder::gather_klasses_and_symbols() {
log_info(cds)("Sorting symbols ... ");
_symbols->sort(compare_symbols_by_address);
sort_klasses();
-
- // TODO -- we need a proper estimate for the archived modules, etc,
- // but this should be enough for now
- _estimated_metaspaceobj_bytes += 200 * 1024 * 1024;
}
AOTClassLinker::add_candidates();
@@ -315,59 +305,26 @@ void ArchiveBuilder::sort_klasses() {
_klasses->sort(compare_klass_by_name);
}
-size_t ArchiveBuilder::estimate_archive_size() {
- // size of the symbol table and two dictionaries, plus the RunTimeClassInfo's
- size_t symbol_table_est = SymbolTable::estimate_size_for_archive();
- size_t dictionary_est = SystemDictionaryShared::estimate_size_for_archive();
- _estimated_hashtable_bytes = symbol_table_est + dictionary_est;
-
- if (CDSConfig::is_dumping_aot_linked_classes()) {
- // This is difficult to estimate when dumping the dynamic archive, as the
- // AOTLinkedClassTable may need to contain classes in the static archive as well.
- //
- // Just give a generous estimate for now. We will remove estimate_archive_size()
- // in JDK-8340416
- _estimated_hashtable_bytes += 20 * 1024 * 1024;
- }
-
- size_t total = 0;
-
- total += _estimated_metaspaceobj_bytes;
- total += _estimated_hashtable_bytes;
-
- // allow fragmentation at the end of each dump region
- total += _total_dump_regions * MetaspaceShared::core_region_alignment();
-
- log_info(cds)("_estimated_hashtable_bytes = " SIZE_FORMAT " + " SIZE_FORMAT " = " SIZE_FORMAT,
- symbol_table_est, dictionary_est, _estimated_hashtable_bytes);
- log_info(cds)("_estimated_metaspaceobj_bytes = " SIZE_FORMAT, _estimated_metaspaceobj_bytes);
- log_info(cds)("total estimate bytes = " SIZE_FORMAT, total);
-
- return align_up(total, MetaspaceShared::core_region_alignment());
-}
-
address ArchiveBuilder::reserve_buffer() {
- size_t buffer_size = estimate_archive_size();
+ size_t buffer_size = LP64_ONLY(CompressedClassSpaceSize) NOT_LP64(256 * M);
ReservedSpace rs = MemoryReserver::reserve(buffer_size,
MetaspaceShared::core_region_alignment(),
os::vm_page_size());
if (!rs.is_reserved()) {
- log_error(cds)("Failed to reserve " SIZE_FORMAT " bytes of output buffer.", buffer_size);
+ log_error(cds)("Failed to reserve %zu bytes of output buffer.", buffer_size);
MetaspaceShared::unrecoverable_writing_error();
}
// buffer_bottom is the lowest address of the 2 core regions (rw, ro) when
// we are copying the class metadata into the buffer.
address buffer_bottom = (address)rs.base();
- log_info(cds)("Reserved output buffer space at " PTR_FORMAT " [" SIZE_FORMAT " bytes]",
+ log_info(cds)("Reserved output buffer space at " PTR_FORMAT " [%zu bytes]",
p2i(buffer_bottom), buffer_size);
_shared_rs = rs;
_buffer_bottom = buffer_bottom;
- _last_verified_top = buffer_bottom;
_current_dump_region = &_rw_region;
_num_dump_regions_used = 1;
- _other_region_used_bytes = 0;
_current_dump_region->init(&_shared_rs, &_shared_vs);
ArchivePtrMarker::initialize(&_ptrmap, &_shared_vs);
@@ -586,28 +543,9 @@ ArchiveBuilder::FollowMode ArchiveBuilder::get_follow_mode(MetaspaceClosure::Ref
}
void ArchiveBuilder::start_dump_region(DumpRegion* next) {
- address bottom = _last_verified_top;
- address top = (address)(current_dump_region()->top());
- _other_region_used_bytes += size_t(top - bottom);
-
current_dump_region()->pack(next);
_current_dump_region = next;
_num_dump_regions_used ++;
-
- _last_verified_top = (address)(current_dump_region()->top());
-}
-
-void ArchiveBuilder::verify_estimate_size(size_t estimate, const char* which) {
- address bottom = _last_verified_top;
- address top = (address)(current_dump_region()->top());
- size_t used = size_t(top - bottom) + _other_region_used_bytes;
- int diff = int(estimate) - int(used);
-
- log_info(cds)("%s estimate = " SIZE_FORMAT " used = " SIZE_FORMAT "; diff = %d bytes", which, estimate, used, diff);
- assert(diff >= 0, "Estimate is too small");
-
- _last_verified_top = top;
- _other_region_used_bytes = 0;
}
char* ArchiveBuilder::ro_strdup(const char* s) {
@@ -1245,7 +1183,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
log_as_hex(last_obj_base, last_obj_end, last_obj_base + buffer_to_runtime_delta());
if (last_obj_end < region_end) {
- log_debug(cds, map)(PTR_FORMAT ": @@ Misc data " SIZE_FORMAT " bytes",
+ log_debug(cds, map)(PTR_FORMAT ": @@ Misc data %zu bytes",
p2i(last_obj_end + buffer_to_runtime_delta()),
size_t(region_end - last_obj_end));
log_as_hex(last_obj_end, region_end, last_obj_end + buffer_to_runtime_delta());
@@ -1265,7 +1203,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
size_t size = top - base;
base = requested_base;
top = requested_base + size;
- log_info(cds, map)("[%-18s " PTR_FORMAT " - " PTR_FORMAT " " SIZE_FORMAT_W(9) " bytes]",
+ log_info(cds, map)("[%-18s " PTR_FORMAT " - " PTR_FORMAT " %9zu bytes]",
name, p2i(base), p2i(top), size);
}
@@ -1306,7 +1244,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
// We have a filler oop, which also does not exist in BufferOffsetToSourceObjectTable.
// Example:
// 0x00000007ffc3ffd8: @@ Object filler 40 bytes
- st.print_cr("filler " SIZE_FORMAT " bytes", byte_size);
+ st.print_cr("filler %zu bytes", byte_size);
} else {
ShouldNotReachHere();
}
@@ -1409,7 +1347,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
print_oop_info_cr(&st, obj);
}
} else {
- st.print_cr(" - fields (" SIZE_FORMAT " words):", source_oop->size());
+ st.print_cr(" - fields (%zu words):", source_oop->size());
ArchivedFieldPrinter print_field(heap_info, &st, source_oop, buffered_addr);
InstanceKlass::cast(source_klass)->print_nonstatic_fields(&print_field);
@@ -1634,12 +1572,12 @@ void ArchiveBuilder::print_region_stats(FileMapInfo *mapinfo, ArchiveHeapInfo* h
print_heap_region_stats(heap_info, total_reserved);
}
- log_debug(cds)("total : " SIZE_FORMAT_W(9) " [100.0%% of total] out of " SIZE_FORMAT_W(9) " bytes [%5.1f%% used]",
+ log_debug(cds)("total : %9zu [100.0%% of total] out of %9zu bytes [%5.1f%% used]",
total_bytes, total_reserved, total_u_perc);
}
void ArchiveBuilder::print_bitmap_region_stats(size_t size, size_t total_size) {
- log_debug(cds)("bm space: " SIZE_FORMAT_W(9) " [ %4.1f%% of total] out of " SIZE_FORMAT_W(9) " bytes [100.0%% used]",
+ log_debug(cds)("bm space: %9zu [ %4.1f%% of total] out of %9zu bytes [100.0%% used]",
size, size/double(total_size)*100.0, size);
}
@@ -1647,7 +1585,7 @@ void ArchiveBuilder::print_heap_region_stats(ArchiveHeapInfo *info, size_t total
char* start = info->buffer_start();
size_t size = info->buffer_byte_size();
char* top = start + size;
- log_debug(cds)("hp space: " SIZE_FORMAT_W(9) " [ %4.1f%% of total] out of " SIZE_FORMAT_W(9) " bytes [100.0%% used] at " INTPTR_FORMAT,
+ log_debug(cds)("hp space: %9zu [ %4.1f%% of total] out of %9zu bytes [100.0%% used] at " INTPTR_FORMAT,
size, size/double(total_size)*100.0, size, p2i(start));
}
diff --git a/src/hotspot/share/cds/archiveBuilder.hpp b/src/hotspot/share/cds/archiveBuilder.hpp
index 0c5262321d086..e3efedd46f14c 100644
--- a/src/hotspot/share/cds/archiveBuilder.hpp
+++ b/src/hotspot/share/cds/archiveBuilder.hpp
@@ -96,9 +96,7 @@ class ArchiveBuilder : public StackObj {
protected:
DumpRegion* _current_dump_region;
address _buffer_bottom; // for writing the contents of rw/ro regions
- address _last_verified_top;
int _num_dump_regions_used;
- size_t _other_region_used_bytes;
// These are the addresses where we will request the static and dynamic archives to be
// mapped at run time. If the request fails (due to ASLR), we will map the archives at
@@ -273,16 +271,9 @@ class ArchiveBuilder : public StackObj {
protected:
virtual void iterate_roots(MetaspaceClosure* it) = 0;
- // Conservative estimate for number of bytes needed for:
- size_t _estimated_metaspaceobj_bytes; // all archived MetaspaceObj's.
- size_t _estimated_hashtable_bytes; // symbol table and dictionaries
-
static const int _total_dump_regions = 2;
- size_t estimate_archive_size();
-
void start_dump_region(DumpRegion* next);
- void verify_estimate_size(size_t estimate, const char* which);
public:
address reserve_buffer();
diff --git a/src/hotspot/share/cds/archiveHeapLoader.cpp b/src/hotspot/share/cds/archiveHeapLoader.cpp
index b05fd20f4f59f..68015e319c3f8 100644
--- a/src/hotspot/share/cds/archiveHeapLoader.cpp
+++ b/src/hotspot/share/cds/archiveHeapLoader.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveHeapLoader.inline.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/heapShared.hpp"
@@ -308,7 +307,7 @@ bool ArchiveHeapLoader::load_heap_region_impl(FileMapInfo* mapinfo, LoadedArchiv
}
assert(r->mapped_base() == (char*)load_address, "sanity");
log_info(cds)("Loaded heap region #%d at base " INTPTR_FORMAT " top " INTPTR_FORMAT
- " size " SIZE_FORMAT_W(6) " delta " INTX_FORMAT,
+ " size %6zu delta %zd",
loaded_region->_region_index, load_address, load_address + loaded_region->_region_size,
loaded_region->_region_size, loaded_region->_runtime_offset);
diff --git a/src/hotspot/share/cds/archiveHeapWriter.cpp b/src/hotspot/share/cds/archiveHeapWriter.cpp
index be821044a96ba..c71d99984e0ab 100644
--- a/src/hotspot/share/cds/archiveHeapWriter.cpp
+++ b/src/hotspot/share/cds/archiveHeapWriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,12 +22,12 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveHeapWriter.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/filemap.hpp"
#include "cds/heapShared.hpp"
#include "classfile/javaClasses.hpp"
+#include "classfile/modules.hpp"
#include "classfile/systemDictionary.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "memory/iterator.inline.hpp"
@@ -217,7 +217,7 @@ void ArchiveHeapWriter::copy_roots_to_buffer(GrowableArrayCHeapat(root_index++));
}
- log_info(cds, heap)("archived obj root segment [%d] = " SIZE_FORMAT " bytes, obj = " PTR_FORMAT,
+ log_info(cds, heap)("archived obj root segment [%d] = %zu bytes, obj = " PTR_FORMAT,
size_elems, size_bytes, p2i(seg_oop));
}
@@ -323,9 +323,13 @@ void ArchiveHeapWriter::copy_source_objs_to_buffer(GrowableArrayCHeapput_when_absent(buffer_offset, src_obj);
_buffer_offset_to_source_obj_table->maybe_grow();
+
+ if (java_lang_Module::is_instance(src_obj)) {
+ Modules::check_archived_module_oop(src_obj);
+ }
}
- log_info(cds)("Size of heap region = " SIZE_FORMAT " bytes, %d objects, %d roots, %d native ptrs",
+ log_info(cds)("Size of heap region = %zu bytes, %d objects, %d roots, %d native ptrs",
_buffer_used, _source_objs->length() + 1, roots->length(), _num_native_ptrs);
}
@@ -391,7 +395,7 @@ void ArchiveHeapWriter::maybe_fill_gc_region_gap(size_t required_byte_size) {
ensure_buffer_space(filler_end);
int array_length = filler_array_length(fill_bytes);
- log_info(cds, heap)("Inserting filler obj array of %d elements (" SIZE_FORMAT " bytes total) @ buffer offset " SIZE_FORMAT,
+ log_info(cds, heap)("Inserting filler obj array of %d elements (%zu bytes total) @ buffer offset %zu",
array_length, fill_bytes, _buffer_used);
HeapWord* filler = init_filler_array_at_buffer_top(array_length, fill_bytes);
_buffer_used = filler_end;
@@ -622,7 +626,7 @@ static void log_bitmap_usage(const char* which, BitMap* bitmap, size_t total_bit
// The whole heap is covered by total_bits, but there are only non-zero bits within [start ... end).
size_t start = bitmap->find_first_set_bit(0);
size_t end = bitmap->size();
- log_info(cds)("%s = " SIZE_FORMAT_W(7) " ... " SIZE_FORMAT_W(7) " (%3zu%% ... %3zu%% = %3zu%%)", which,
+ log_info(cds)("%s = %7zu ... %7zu (%3zu%% ... %3zu%% = %3zu%%)", which,
start, end,
start * 100 / total_bits,
end * 100 / total_bits,
@@ -749,7 +753,7 @@ void ArchiveHeapWriter::compute_ptrmap(ArchiveHeapInfo* heap_info) {
}
heap_info->ptrmap()->resize(max_idx + 1);
- log_info(cds, heap)("calculate_ptrmap: marked %d non-null native pointers for heap region (" SIZE_FORMAT " bits)",
+ log_info(cds, heap)("calculate_ptrmap: marked %d non-null native pointers for heap region (%zu bits)",
num_non_null_ptrs, size_t(heap_info->ptrmap()->size()));
}
diff --git a/src/hotspot/share/cds/archiveHeapWriter.hpp b/src/hotspot/share/cds/archiveHeapWriter.hpp
index 70c1207bb91f7..1e1319cccc34a 100644
--- a/src/hotspot/share/cds/archiveHeapWriter.hpp
+++ b/src/hotspot/share/cds/archiveHeapWriter.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -72,8 +72,9 @@ class ArchiveHeapWriter : AllStatic {
// - "source objects" are regular Java objects allocated during the execution
// of "java -Xshare:dump". They can be used as regular oops.
//
- // HeapShared::archive_objects() recursively searches for the oops that need to be
- // stored into the CDS archive. These are entered into HeapShared::archived_object_cache().
+ // Between HeapShared::start_scanning_for_oops() and HeapShared::end_scanning_for_oops(),
+ // we recursively search for the oops that need to be stored into the CDS archive.
+ // These are entered into HeapShared::archived_object_cache().
//
// - "buffered objects" are copies of the "source objects", and are stored in into
// ArchiveHeapWriter::_buffer, which is a GrowableArray that sits outside of
diff --git a/src/hotspot/share/cds/archiveUtils.cpp b/src/hotspot/share/cds/archiveUtils.cpp
index 3530fcff2b3f9..90eefd13d469a 100644
--- a/src/hotspot/share/cds/archiveUtils.cpp
+++ b/src/hotspot/share/cds/archiveUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.inline.hpp"
#include "cds/archiveUtils.hpp"
@@ -124,7 +123,7 @@ void ArchivePtrMarker::mark_pointer(address* ptr_loc) {
}
assert(idx < _ptrmap->size(), "must be");
_ptrmap->set_bit(idx);
- //tty->print_cr("Marking pointer [" PTR_FORMAT "] -> " PTR_FORMAT " @ " SIZE_FORMAT_W(5), p2i(ptr_loc), p2i(*ptr_loc), idx);
+ //tty->print_cr("Marking pointer [" PTR_FORMAT "] -> " PTR_FORMAT " @ %5zu", p2i(ptr_loc), p2i(*ptr_loc), idx);
}
}
}
@@ -138,7 +137,7 @@ void ArchivePtrMarker::clear_pointer(address* ptr_loc) {
size_t idx = ptr_loc - ptr_base();
assert(idx < _ptrmap->size(), "cannot clear pointers that have not been marked");
_ptrmap->clear_bit(idx);
- //tty->print_cr("Clearing pointer [" PTR_FORMAT "] -> " PTR_FORMAT " @ " SIZE_FORMAT_W(5), p2i(ptr_loc), p2i(*ptr_loc), idx);
+ //tty->print_cr("Clearing pointer [" PTR_FORMAT "] -> " PTR_FORMAT " @ %5zu", p2i(ptr_loc), p2i(*ptr_loc), idx);
}
class ArchivePtrBitmapCleaner: public BitMapClosure {
@@ -163,7 +162,7 @@ class ArchivePtrBitmapCleaner: public BitMapClosure {
}
} else {
_ptrmap->clear_bit(offset);
- DEBUG_ONLY(log_trace(cds, reloc)("Clearing pointer [" PTR_FORMAT "] -> null @ " SIZE_FORMAT_W(9), p2i(ptr_loc), offset));
+ DEBUG_ONLY(log_trace(cds, reloc)("Clearing pointer [" PTR_FORMAT "] -> null @ %9zu", p2i(ptr_loc), offset));
}
return true;
@@ -228,7 +227,7 @@ void DumpRegion::commit_to(char* newtop) {
assert(commit <= uncommitted, "sanity");
if (!_vs->expand_by(commit, false)) {
- log_error(cds)("Failed to expand shared space to " SIZE_FORMAT " bytes",
+ log_error(cds)("Failed to expand shared space to %zu bytes",
need_committed_size);
MetaspaceShared::unrecoverable_writing_error();
}
@@ -239,7 +238,7 @@ void DumpRegion::commit_to(char* newtop) {
} else {
which = "shared";
}
- log_debug(cds)("Expanding %s spaces by " SIZE_FORMAT_W(7) " bytes [total " SIZE_FORMAT_W(9) " bytes ending at %p]",
+ log_debug(cds)("Expanding %s spaces by %7zu bytes [total %9zu bytes ending at %p]",
which, commit, _vs->actual_committed_size(), _vs->high());
}
@@ -265,7 +264,7 @@ void DumpRegion::append_intptr_t(intptr_t n, bool need_to_mark) {
}
void DumpRegion::print(size_t total_bytes) const {
- log_debug(cds)("%s space: " SIZE_FORMAT_W(9) " [ %4.1f%% of total] out of " SIZE_FORMAT_W(9) " bytes [%5.1f%% used] at " INTPTR_FORMAT,
+ log_debug(cds)("%s space: %9zu [ %4.1f%% of total] out of %9zu bytes [%5.1f%% used] at " INTPTR_FORMAT,
_name, used(), percent_of(used(), total_bytes), reserved(), percent_of(used(), reserved()),
p2i(ArchiveBuilder::current()->to_requested(_base)));
}
diff --git a/src/hotspot/share/cds/cdsConfig.cpp b/src/hotspot/share/cds/cdsConfig.cpp
index 6ab77bf000746..a86995adb2ded 100644
--- a/src/hotspot/share/cds/cdsConfig.cpp
+++ b/src/hotspot/share/cds/cdsConfig.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveHeapLoader.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/classListWriter.hpp"
diff --git a/src/hotspot/share/cds/cdsConstants.cpp b/src/hotspot/share/cds/cdsConstants.cpp
index 6dbacb2774f12..364f6d74c43e5 100644
--- a/src/hotspot/share/cds/cdsConstants.cpp
+++ b/src/hotspot/share/cds/cdsConstants.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConstants.hpp"
#include "cds/dynamicArchive.hpp"
#include "cds/filemap.hpp"
diff --git a/src/hotspot/share/cds/cdsEnumKlass.cpp b/src/hotspot/share/cds/cdsEnumKlass.cpp
index 17438428c8092..ffce9fb269a89 100644
--- a/src/hotspot/share/cds/cdsEnumKlass.cpp
+++ b/src/hotspot/share/cds/cdsEnumKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveHeapLoader.hpp"
#include "cds/cdsEnumKlass.hpp"
#include "cds/heapShared.hpp"
@@ -37,7 +36,6 @@
bool CDSEnumKlass::is_enum_obj(oop orig_obj) {
Klass* k = orig_obj->klass();
- Klass* buffered_k = ArchiveBuilder::get_buffered_klass(k);
return k->is_instance_klass() &&
InstanceKlass::cast(k)->is_enum_subclass();
}
@@ -73,7 +71,6 @@ void CDSEnumKlass::handle_enum_obj(int level,
}
ik->set_has_archived_enum_objs();
- ArchiveBuilder::get_buffered_klass(ik)->set_has_archived_enum_objs();
oop mirror = ik->java_mirror();
for (JavaFieldStream fs(ik); !fs.done(); fs.next()) {
diff --git a/src/hotspot/share/cds/cdsHeapVerifier.cpp b/src/hotspot/share/cds/cdsHeapVerifier.cpp
index fbc58e503ca36..f9e613a74cee8 100644
--- a/src/hotspot/share/cds/cdsHeapVerifier.cpp
+++ b/src/hotspot/share/cds/cdsHeapVerifier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotClassInitializer.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/cdsHeapVerifier.hpp"
@@ -258,20 +257,19 @@ void CDSHeapVerifier::add_static_obj_field(InstanceKlass* ik, oop field, Symbol*
_table.put(field, info);
}
+// This function is called once for every archived heap object. Warn if this object is referenced by
+// a static field of a class that's not aot-initialized.
inline bool CDSHeapVerifier::do_entry(oop& orig_obj, HeapShared::CachedOopInfo& value) {
_archived_objs++;
+ if (java_lang_String::is_instance(orig_obj) && HeapShared::is_dumped_interned_string(orig_obj)) {
+ // It's quite often for static fields to have interned strings. These are most likely not
+ // problematic (and are hard to filter). So we will ignore them.
+ return true; /* keep on iterating */
+ }
+
StaticFieldInfo* info = _table.get(orig_obj);
if (info != nullptr) {
- if (value.orig_referrer() == nullptr && java_lang_String::is_instance(orig_obj)) {
- // This string object is not referenced by any of the archived object graphs. It's archived
- // only because it's in the interned string table. So we are not in a condition that
- // should be flagged by CDSHeapVerifier.
- return true; /* keep on iterating */
- }
- if (info->_holder->is_hidden()) {
- return true;
- }
ResourceMark rm;
char* class_name = info->_holder->name()->as_C_string();
char* field_name = info->_name->as_C_string();
diff --git a/src/hotspot/share/cds/cdsProtectionDomain.cpp b/src/hotspot/share/cds/cdsProtectionDomain.cpp
index 2eb47ff2788d9..49152753a831d 100644
--- a/src/hotspot/share/cds/cdsProtectionDomain.cpp
+++ b/src/hotspot/share/cds/cdsProtectionDomain.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/cdsProtectionDomain.hpp"
#include "classfile/classLoader.hpp"
diff --git a/src/hotspot/share/cds/classListParser.cpp b/src/hotspot/share/cds/classListParser.cpp
index 47925f578ea1f..ed2a3c61b9c4b 100644
--- a/src/hotspot/share/cds/classListParser.cpp
+++ b/src/hotspot/share/cds/classListParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotConstantPoolResolver.hpp"
#include "cds/archiveUtils.hpp"
#include "cds/classListParser.hpp"
diff --git a/src/hotspot/share/cds/classListWriter.cpp b/src/hotspot/share/cds/classListWriter.cpp
index 78a6857ff73a7..2a3513c45f5f4 100644
--- a/src/hotspot/share/cds/classListWriter.cpp
+++ b/src/hotspot/share/cds/classListWriter.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cds_globals.hpp"
#include "cds/classListWriter.hpp"
#include "cds/lambdaFormInvokers.inline.hpp"
diff --git a/src/hotspot/share/cds/cppVtables.cpp b/src/hotspot/share/cds/cppVtables.cpp
index 3de858d32997a..155bc08dc2de6 100644
--- a/src/hotspot/share/cds/cppVtables.cpp
+++ b/src/hotspot/share/cds/cppVtables.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveUtils.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp"
diff --git a/src/hotspot/share/cds/dumpAllocStats.cpp b/src/hotspot/share/cds/dumpAllocStats.cpp
index e88a77de7adb7..5587ac2fac82a 100644
--- a/src/hotspot/share/cds/dumpAllocStats.cpp
+++ b/src/hotspot/share/cds/dumpAllocStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/dumpAllocStats.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/cds/dumpTimeClassInfo.cpp b/src/hotspot/share/cds/dumpTimeClassInfo.cpp
index 6ee18c17a57da..18136d6eeec66 100644
--- a/src/hotspot/share/cds/dumpTimeClassInfo.cpp
+++ b/src/hotspot/share/cds/dumpTimeClassInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/dumpTimeClassInfo.inline.hpp"
#include "cds/runTimeClassInfo.hpp"
diff --git a/src/hotspot/share/cds/dumpTimeClassInfo.hpp b/src/hotspot/share/cds/dumpTimeClassInfo.hpp
index c060601f1fb01..79ede224bb6e7 100644
--- a/src/hotspot/share/cds/dumpTimeClassInfo.hpp
+++ b/src/hotspot/share/cds/dumpTimeClassInfo.hpp
@@ -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
@@ -42,8 +42,6 @@ class DumpTimeClassInfo: public CHeapObj {
bool _excluded;
bool _is_early_klass;
bool _has_checked_exclusion;
- bool _is_required_hidden_class;
- bool _has_scanned_constant_pool;
class DTLoaderConstraint {
Symbol* _name;
char _loader_type1;
@@ -123,7 +121,7 @@ class DumpTimeClassInfo: public CHeapObj {
InstanceKlass* _klass;
InstanceKlass* _nest_host;
bool _failed_verification;
- bool _is_archived_lambda_proxy;
+ bool _is_registered_lambda_proxy;
int _id;
int _clsfile_size;
int _clsfile_crc32;
@@ -136,10 +134,8 @@ class DumpTimeClassInfo: public CHeapObj {
_klass = nullptr;
_nest_host = nullptr;
_failed_verification = false;
- _is_archived_lambda_proxy = false;
+ _is_registered_lambda_proxy = false;
_has_checked_exclusion = false;
- _is_required_hidden_class = false;
- _has_scanned_constant_pool = false;
_id = -1;
_clsfile_size = -1;
_clsfile_crc32 = -1;
@@ -217,11 +213,6 @@ class DumpTimeClassInfo: public CHeapObj {
InstanceKlass* nest_host() const { return _nest_host; }
void set_nest_host(InstanceKlass* nest_host) { _nest_host = nest_host; }
- bool is_required_hidden_class() const { return _is_required_hidden_class; }
- void set_is_required_hidden_class() { _is_required_hidden_class = true; }
- bool has_scanned_constant_pool() const { return _has_scanned_constant_pool; }
- void set_has_scanned_constant_pool() { _has_scanned_constant_pool = true; }
-
size_t runtime_info_bytesize() const;
};
diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp
index f102282f68201..acdb330d91bcc 100644
--- a/src/hotspot/share/cds/dynamicArchive.cpp
+++ b/src/hotspot/share/cds/dynamicArchive.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,7 @@
*
*/
-#include "precompiled.hpp"
+#include "cds/aotArtifactFinder.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapWriter.hpp"
@@ -112,7 +112,6 @@ class DynamicArchiveBuilder : public ArchiveBuilder {
// Block concurrent class unloading from changing the _dumptime_table
MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
- SystemDictionaryShared::find_all_archivable_classes();
if (SystemDictionaryShared::is_dumptime_table_empty()) {
log_warning(cds, dynamic)("There is no class to be included in the dynamic archive.");
@@ -133,8 +132,6 @@ class DynamicArchiveBuilder : public ArchiveBuilder {
dump_ro_metadata();
relocate_metaspaceobj_embedded_pointers();
- verify_estimate_size(_estimated_metaspaceobj_bytes, "MetaspaceObjs");
-
sort_methods();
log_info(cds)("Make classes shareable");
@@ -159,8 +156,6 @@ class DynamicArchiveBuilder : public ArchiveBuilder {
ArchiveBuilder::serialize_dynamic_archivable_items(&wc);
}
- verify_estimate_size(_estimated_hashtable_bytes, "Hashtables");
-
log_info(cds)("Adjust lambda proxy class dictionary");
SystemDictionaryShared::adjust_lambda_proxy_class_dictionary();
@@ -178,6 +173,7 @@ class DynamicArchiveBuilder : public ArchiveBuilder {
virtual void iterate_roots(MetaspaceClosure* it) {
FileMapInfo::metaspace_pointers_do(it);
+ AOTArtifactFinder::all_cached_classes_do(it);
SystemDictionaryShared::dumptime_classes_do(it);
iterate_primitive_array_klasses(it);
}
@@ -355,7 +351,7 @@ void DynamicArchiveBuilder::write_archive(char* serialized_data) {
size_t file_size = pointer_delta(top, base, sizeof(char));
log_info(cds, dynamic)("Written dynamic archive " PTR_FORMAT " - " PTR_FORMAT
- " [" UINT32_FORMAT " bytes header, " SIZE_FORMAT " bytes total]",
+ " [" UINT32_FORMAT " bytes header, %zu bytes total]",
p2i(base), p2i(top), _header->header_size(), file_size);
log_info(cds, dynamic)("%d klasses; %d symbols", klasses()->length(), symbols()->length());
@@ -509,12 +505,9 @@ void DynamicArchive::dump_at_exit(JavaThread* current, const char* archive_name)
JavaThread* THREAD = current; // For TRAPS processing related to link_shared_classes
MetaspaceShared::link_shared_classes(false/*not from jcmd*/, THREAD);
if (!HAS_PENDING_EXCEPTION) {
- // copy shared path table to saved.
- if (!HAS_PENDING_EXCEPTION) {
- VM_PopulateDynamicDumpSharedSpace op(archive_name);
- VMThread::execute(&op);
- return;
- }
+ VM_PopulateDynamicDumpSharedSpace op(archive_name);
+ VMThread::execute(&op);
+ return;
}
// One of the prepatory steps failed
diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp
index c87081d9d14e6..e82313bb84d92 100644
--- a/src/hotspot/share/cds/filemap.cpp
+++ b/src/hotspot/share/cds/filemap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.inline.hpp"
#include "cds/archiveHeapWriter.hpp"
@@ -279,23 +278,23 @@ void FileMapHeader::print(outputStream* st) {
}
st->print_cr("============ end regions ======== ");
- st->print_cr("- core_region_alignment: " SIZE_FORMAT, _core_region_alignment);
+ st->print_cr("- core_region_alignment: %zu", _core_region_alignment);
st->print_cr("- obj_alignment: %d", _obj_alignment);
st->print_cr("- narrow_oop_base: " INTPTR_FORMAT, p2i(_narrow_oop_base));
st->print_cr("- narrow_oop_shift %d", _narrow_oop_shift);
st->print_cr("- compact_strings: %d", _compact_strings);
st->print_cr("- compact_headers: %d", _compact_headers);
- st->print_cr("- max_heap_size: " UINTX_FORMAT, _max_heap_size);
+ st->print_cr("- max_heap_size: %zu", _max_heap_size);
st->print_cr("- narrow_oop_mode: %d", _narrow_oop_mode);
st->print_cr("- compressed_oops: %d", _compressed_oops);
st->print_cr("- compressed_class_ptrs: %d", _compressed_class_ptrs);
st->print_cr("- narrow_klass_pointer_bits: %d", _narrow_klass_pointer_bits);
st->print_cr("- narrow_klass_shift: %d", _narrow_klass_shift);
- st->print_cr("- cloned_vtables_offset: " SIZE_FORMAT_X, _cloned_vtables_offset);
- st->print_cr("- early_serialized_data_offset: " SIZE_FORMAT_X, _early_serialized_data_offset);
- st->print_cr("- serialized_data_offset: " SIZE_FORMAT_X, _serialized_data_offset);
+ st->print_cr("- cloned_vtables_offset: 0x%zx", _cloned_vtables_offset);
+ st->print_cr("- early_serialized_data_offset: 0x%zx", _early_serialized_data_offset);
+ st->print_cr("- serialized_data_offset: 0x%zx", _serialized_data_offset);
st->print_cr("- jvm_ident: %s", _jvm_ident);
- st->print_cr("- shared_path_table_offset: " SIZE_FORMAT_X, _shared_path_table_offset);
+ st->print_cr("- shared_path_table_offset: 0x%zx", _shared_path_table_offset);
st->print_cr("- app_class_paths_start_index: %d", _app_class_paths_start_index);
st->print_cr("- app_module_paths_start_index: %d", _app_module_paths_start_index);
st->print_cr("- num_module_paths: %d", _num_module_paths);
@@ -307,14 +306,14 @@ void FileMapHeader::print(outputStream* st) {
st->print_cr("- requested_base_address: " INTPTR_FORMAT, p2i(_requested_base_address));
st->print_cr("- mapped_base_address: " INTPTR_FORMAT, p2i(_mapped_base_address));
st->print_cr("- heap_root_segments.roots_count: %d" , _heap_root_segments.roots_count());
- st->print_cr("- heap_root_segments.base_offset: " SIZE_FORMAT_X, _heap_root_segments.base_offset());
- st->print_cr("- heap_root_segments.count: " SIZE_FORMAT, _heap_root_segments.count());
+ st->print_cr("- heap_root_segments.base_offset: 0x%zx", _heap_root_segments.base_offset());
+ st->print_cr("- heap_root_segments.count: %zu", _heap_root_segments.count());
st->print_cr("- heap_root_segments.max_size_elems: %d", _heap_root_segments.max_size_in_elems());
st->print_cr("- heap_root_segments.max_size_bytes: %d", _heap_root_segments.max_size_in_bytes());
- st->print_cr("- _heap_oopmap_start_pos: " SIZE_FORMAT, _heap_oopmap_start_pos);
- st->print_cr("- _heap_ptrmap_start_pos: " SIZE_FORMAT, _heap_ptrmap_start_pos);
- st->print_cr("- _rw_ptrmap_start_pos: " SIZE_FORMAT, _rw_ptrmap_start_pos);
- st->print_cr("- _ro_ptrmap_start_pos: " SIZE_FORMAT, _ro_ptrmap_start_pos);
+ st->print_cr("- _heap_oopmap_start_pos: %zu", _heap_oopmap_start_pos);
+ st->print_cr("- _heap_ptrmap_start_pos: %zu", _heap_ptrmap_start_pos);
+ st->print_cr("- _rw_ptrmap_start_pos: %zu", _rw_ptrmap_start_pos);
+ st->print_cr("- _ro_ptrmap_start_pos: %zu", _ro_ptrmap_start_pos);
st->print_cr("- allow_archiving_with_java_agent:%d", _allow_archiving_with_java_agent);
st->print_cr("- use_optimized_module_handling: %d", _use_optimized_module_handling);
st->print_cr("- has_full_module_graph %d", _has_full_module_graph);
@@ -1420,7 +1419,7 @@ bool FileMapInfo::init_from_file(int fd) {
void FileMapInfo::seek_to_position(size_t pos) {
if (os::lseek(_fd, (long)pos, SEEK_SET) < 0) {
- log_error(cds)("Unable to seek to position " SIZE_FORMAT, pos);
+ log_error(cds)("Unable to seek to position %zu", pos);
MetaspaceShared::unrecoverable_loading_error();
}
}
@@ -1508,6 +1507,7 @@ void FileMapRegion::init(int region_index, size_t mapping_offset, size_t size, b
_crc = crc;
_mapped_from_file = false;
_mapped_base = nullptr;
+ _in_reserved_space = false;
}
void FileMapRegion::init_oopmap(size_t offset, size_t size_in_bits) {
@@ -1554,7 +1554,7 @@ BitMapView FileMapInfo::bitmap_view(int region_index, bool is_oopmap) {
bitmap_base += is_oopmap ? r->oopmap_offset() : r->ptrmap_offset();
size_t size_in_bits = is_oopmap ? r->oopmap_size_in_bits() : r->ptrmap_size_in_bits();
- log_debug(cds, reloc)("mapped %s relocation %smap @ " INTPTR_FORMAT " (" SIZE_FORMAT " bits)",
+ log_debug(cds, reloc)("mapped %s relocation %smap @ " INTPTR_FORMAT " (%zu bits)",
region_name(region_index), is_oopmap ? "oop" : "ptr",
p2i(bitmap_base), size_in_bits);
@@ -1577,13 +1577,13 @@ void FileMapRegion::print(outputStream* st, int region_index) {
st->print_cr("- is_heap_region: %d", _is_heap_region);
st->print_cr("- is_bitmap_region: %d", _is_bitmap_region);
st->print_cr("- mapped_from_file: %d", _mapped_from_file);
- st->print_cr("- file_offset: " SIZE_FORMAT_X, _file_offset);
- st->print_cr("- mapping_offset: " SIZE_FORMAT_X, _mapping_offset);
- st->print_cr("- used: " SIZE_FORMAT, _used);
- st->print_cr("- oopmap_offset: " SIZE_FORMAT_X, _oopmap_offset);
- st->print_cr("- oopmap_size_in_bits: " SIZE_FORMAT, _oopmap_size_in_bits);
- st->print_cr("- ptrmap_offset: " SIZE_FORMAT_X, _ptrmap_offset);
- st->print_cr("- ptrmap_size_in_bits: " SIZE_FORMAT, _ptrmap_size_in_bits);
+ st->print_cr("- file_offset: 0x%zx", _file_offset);
+ st->print_cr("- mapping_offset: 0x%zx", _mapping_offset);
+ st->print_cr("- used: %zu", _used);
+ st->print_cr("- oopmap_offset: 0x%zx", _oopmap_offset);
+ st->print_cr("- oopmap_size_in_bits: %zu", _oopmap_size_in_bits);
+ st->print_cr("- ptrmap_offset: 0x%zx", _ptrmap_offset);
+ st->print_cr("- ptrmap_size_in_bits: %zu", _ptrmap_size_in_bits);
st->print_cr("- mapped_base: " INTPTR_FORMAT, p2i(_mapped_base));
}
@@ -1622,7 +1622,7 @@ void FileMapInfo::write_region(int region, char* base, size_t size,
r->set_file_offset(_file_offset);
int crc = ClassLoader::crc32(0, base, (jint)size);
if (size > 0) {
- log_info(cds)("Shared file region (%s) %d: " SIZE_FORMAT_W(8)
+ log_info(cds)("Shared file region (%s) %d: %8zu"
" bytes, addr " INTPTR_FORMAT " file offset 0x%08" PRIxPTR
" crc 0x%08x",
region_name(region), region, size, p2i(requested_base), _file_offset, crc);
@@ -1889,10 +1889,11 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
FileMapRegion* r = region_at(i);
size_t size = r->used_aligned();
char *requested_addr = mapped_base_address + r->mapping_offset();
- assert(r->mapped_base() == nullptr, "must be not mapped yet");
+ assert(!is_mapped(), "must be not mapped yet");
assert(requested_addr != nullptr, "must be specified");
r->set_mapped_from_file(false);
+ r->set_in_reserved_space(false);
if (MetaspaceShared::use_windows_memory_mapping()) {
// Windows cannot remap read-only shared memory to read-write when required for
@@ -1917,7 +1918,6 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
return MAP_ARCHIVE_OTHER_FAILURE; // oom or I/O error.
} else {
assert(r->mapped_base() != nullptr, "must be initialized");
- return MAP_ARCHIVE_SUCCESS;
}
} else {
// Note that this may either be a "fresh" mapping into unreserved address
@@ -1939,9 +1939,16 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
r->set_mapped_from_file(true);
r->set_mapped_base(requested_addr);
+ }
- return MAP_ARCHIVE_SUCCESS;
+ if (rs.is_reserved()) {
+ char* mapped_base = r->mapped_base();
+ assert(rs.base() <= mapped_base && mapped_base + size <= rs.end(),
+ PTR_FORMAT " <= " PTR_FORMAT " < " PTR_FORMAT " <= " PTR_FORMAT,
+ p2i(rs.base()), p2i(mapped_base), p2i(mapped_base + size), p2i(rs.end()));
+ r->set_in_reserved_space(rs.is_reserved());
}
+ return MAP_ARCHIVE_SUCCESS;
}
// The return value is the location of the archive relocation bitmap.
@@ -2101,7 +2108,7 @@ MemRegion FileMapInfo::get_heap_region_requested_range() {
address start = heap_region_requested_address();
address end = start + size;
- log_info(cds)("Requested heap region [" INTPTR_FORMAT " - " INTPTR_FORMAT "] = " SIZE_FORMAT_W(8) " bytes",
+ log_info(cds)("Requested heap region [" INTPTR_FORMAT " - " INTPTR_FORMAT "] = %8zu bytes",
p2i(start), p2i(end), size);
return MemRegion((HeapWord*)start, (HeapWord*)end);
@@ -2163,13 +2170,13 @@ bool FileMapInfo::can_use_heap_region() {
const int archive_narrow_klass_pointer_bits = header()->narrow_klass_pointer_bits();
const int archive_narrow_klass_shift = header()->narrow_klass_shift();
- log_info(cds)("CDS archive was created with max heap size = " SIZE_FORMAT "M, and the following configuration:",
+ log_info(cds)("CDS archive was created with max heap size = %zuM, and the following configuration:",
max_heap_size()/M);
log_info(cds)(" narrow_klass_base at mapping start address, narrow_klass_pointer_bits = %d, narrow_klass_shift = %d",
archive_narrow_klass_pointer_bits, archive_narrow_klass_shift);
log_info(cds)(" narrow_oop_mode = %d, narrow_oop_base = " PTR_FORMAT ", narrow_oop_shift = %d",
narrow_oop_mode(), p2i(narrow_oop_base()), narrow_oop_shift());
- log_info(cds)("The current max heap size = " SIZE_FORMAT "M, G1HeapRegion::GrainBytes = " SIZE_FORMAT,
+ log_info(cds)("The current max heap size = %zuM, G1HeapRegion::GrainBytes = %zu",
MaxHeapSize/M, G1HeapRegion::GrainBytes);
log_info(cds)(" narrow_klass_base = " PTR_FORMAT ", arrow_klass_pointer_bits = %d, narrow_klass_shift = %d",
p2i(CompressedKlassPointers::base()), CompressedKlassPointers::narrow_klass_pointer_bits(), CompressedKlassPointers::shift());
@@ -2326,7 +2333,7 @@ bool FileMapInfo::map_heap_region_impl() {
if (base == nullptr || base != addr) {
dealloc_heap_region();
log_info(cds)("UseSharedSpaces: Unable to map at required address in java heap. "
- INTPTR_FORMAT ", size = " SIZE_FORMAT " bytes",
+ INTPTR_FORMAT ", size = %zu bytes",
p2i(addr), _mapped_heap_memregion.byte_size());
return false;
}
@@ -2359,14 +2366,13 @@ bool FileMapInfo::map_heap_region_impl() {
if (bitmap_base == nullptr) {
log_info(cds)("CDS heap cannot be used because bitmap region cannot be mapped");
dealloc_heap_region();
- unmap_region(MetaspaceShared::hp);
_heap_pointers_need_patching = false;
return false;
}
}
- log_info(cds)("Heap data mapped at " INTPTR_FORMAT ", size = " SIZE_FORMAT_W(8) " bytes",
+ log_info(cds)("Heap data mapped at " INTPTR_FORMAT ", size = %8zu bytes",
p2i(mapped_start), _mapped_heap_memregion.byte_size());
- log_info(cds)("CDS heap data relocation delta = " INTX_FORMAT " bytes", delta);
+ log_info(cds)("CDS heap data relocation delta = %zd bytes", delta);
return true;
}
@@ -2428,8 +2434,14 @@ void FileMapInfo::unmap_region(int i) {
if (size > 0 && r->mapped_from_file()) {
log_info(cds)("Unmapping region #%d at base " INTPTR_FORMAT " (%s)", i, p2i(mapped_base),
shared_region_name[i]);
- if (!os::unmap_memory(mapped_base, size)) {
- fatal("os::unmap_memory failed");
+ if (r->in_reserved_space()) {
+ // This region was mapped inside a ReservedSpace. Its memory will be freed when the ReservedSpace
+ // is released. Zero it so that we don't accidentally read its content.
+ log_info(cds)("Region #%d (%s) is in a reserved space, it will be freed when the space is released", i, shared_region_name[i]);
+ } else {
+ if (!os::unmap_memory(mapped_base, size)) {
+ fatal("os::unmap_memory failed");
+ }
}
}
r->set_mapped_base(nullptr);
diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp
index d097cb0eda6c9..ae11c6c81cc17 100644
--- a/src/hotspot/share/cds/filemap.hpp
+++ b/src/hotspot/share/cds/filemap.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -163,11 +163,13 @@ class FileMapRegion: private CDSFileMapRegion {
size_t oopmap_size_in_bits() const { assert_is_heap_region(); return _oopmap_size_in_bits; }
size_t ptrmap_offset() const { return _ptrmap_offset; }
size_t ptrmap_size_in_bits() const { return _ptrmap_size_in_bits; }
+ bool in_reserved_space() const { return _in_reserved_space; }
void set_file_offset(size_t s) { _file_offset = s; }
void set_read_only(bool v) { _read_only = v; }
void set_mapped_base(char* p) { _mapped_base = p; }
void set_mapped_from_file(bool v) { _mapped_from_file = v; }
+ void set_in_reserved_space(bool is_reserved) { _in_reserved_space = is_reserved; }
void init(int region_index, size_t mapping_offset, size_t size, bool read_only,
bool allow_exec, int crc);
void init_oopmap(size_t offset, size_t size_in_bits);
diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp
index d2ab109cc7267..96adf8d240dd9 100644
--- a/src/hotspot/share/cds/heapShared.cpp
+++ b/src/hotspot/share/cds/heapShared.cpp
@@ -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
@@ -22,7 +22,7 @@
*
*/
-#include "precompiled.hpp"
+#include "cds/aotArtifactFinder.hpp"
#include "cds/aotClassInitializer.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.hpp"
@@ -220,7 +220,9 @@ bool HeapShared::has_been_archived(oop obj) {
int HeapShared::append_root(oop obj) {
assert(CDSConfig::is_dumping_heap(), "dump-time only");
-
+ if (obj != nullptr) {
+ assert(has_been_archived(obj), "must be");
+ }
// No GC should happen since we aren't scanning _pending_roots.
assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
@@ -290,7 +292,7 @@ void HeapShared::clear_root(int index) {
}
}
-bool HeapShared::archive_object(oop obj) {
+bool HeapShared::archive_object(oop obj, KlassSubGraphInfo* subgraph_info) {
assert(CDSConfig::is_dumping_heap(), "dump-time only");
assert(!obj->is_stackChunk(), "do not archive stack chunks");
@@ -299,7 +301,7 @@ bool HeapShared::archive_object(oop obj) {
}
if (ArchiveHeapWriter::is_too_large_to_archive(obj->size())) {
- log_debug(cds, heap)("Cannot archive, object (" PTR_FORMAT ") is too large: " SIZE_FORMAT,
+ log_debug(cds, heap)("Cannot archive, object (" PTR_FORMAT ") is too large: %zu",
p2i(obj), obj->size());
debug_trace();
return false;
@@ -311,6 +313,36 @@ bool HeapShared::archive_object(oop obj) {
archived_object_cache()->maybe_grow();
mark_native_pointers(obj);
+ Klass* k = obj->klass();
+ if (k->is_instance_klass()) {
+ // Whenever we see a non-array Java object of type X, we mark X to be aot-initialized.
+ // This ensures that during the production run, whenever Java code sees a cached object
+ // of type X, we know that X is already initialized. (see TODO comment below ...)
+
+ if (InstanceKlass::cast(k)->is_enum_subclass()
+ // We can't rerun of enum classes (see cdsEnumKlass.cpp) so
+ // we must store them as AOT-initialized.
+ || (subgraph_info == _dump_time_special_subgraph))
+ // TODO: we do this only for the special subgraph for now. Extending this to
+ // other subgraphs would require more refactoring of the core library (such as
+ // move some initialization logic into runtimeSetup()).
+ //
+ // For the other subgraphs, we have a weaker mechanism to ensure that
+ // all classes in a subgraph are initialized before the subgraph is programmatically
+ // returned from jdk.internal.misc.CDS::initializeFromArchive().
+ // See HeapShared::initialize_from_archived_subgraph().
+ {
+ AOTArtifactFinder::add_aot_inited_class(InstanceKlass::cast(k));
+ }
+
+ if (java_lang_Class::is_instance(obj)) {
+ Klass* mirror_k = java_lang_Class::as_Klass(obj);
+ if (mirror_k != nullptr) {
+ AOTArtifactFinder::add_cached_class(mirror_k);
+ }
+ }
+ }
+
if (log_is_enabled(Debug, cds, heap)) {
ResourceMark rm;
LogTarget(Debug, cds, heap) log;
@@ -328,10 +360,6 @@ bool HeapShared::archive_object(oop obj) {
out.cr();
}
- if (java_lang_Module::is_instance(obj) && Modules::check_archived_module_oop(obj)) {
- Modules::update_oops_in_archived_module(obj, append_root(obj));
- }
-
return true;
}
}
@@ -367,7 +395,9 @@ class MetaspaceObjToOopHandleTable: public ResourceHashtableset_oop(src, dest);
+ if (SystemDictionaryShared::is_builtin_loader(src->pool_holder()->class_loader_data())) {
+ _scratch_references_table->set_oop(src, dest);
+ }
}
objArrayOop HeapShared::scratch_resolved_references(ConstantPool* src) {
@@ -466,11 +496,15 @@ bool HeapShared::is_archivable_hidden_klass(InstanceKlass* ik) {
(is_lambda_form_klass(ik) || is_lambda_proxy_klass(ik) || is_string_concat_klass(ik));
}
-void HeapShared::copy_aot_initialized_mirror(Klass* orig_k, oop orig_mirror, oop m) {
- assert(orig_k->is_instance_klass(), "sanity");
- InstanceKlass* ik = InstanceKlass::cast(orig_k);
- InstanceKlass* buffered_ik = ArchiveBuilder::current()->get_buffered_addr(ik);
+void HeapShared::copy_and_rescan_aot_inited_mirror(InstanceKlass* ik) {
+ ik->set_has_aot_initialized_mirror();
+ if (AOTClassInitializer::is_runtime_setup_required(ik)) {
+ ik->set_is_runtime_setup_required();
+ }
+
+ oop orig_mirror = ik->java_mirror();
+ oop m = scratch_java_mirror(ik);
assert(ik->is_initialized(), "must be");
int nfields = 0;
@@ -481,7 +515,19 @@ void HeapShared::copy_aot_initialized_mirror(Klass* orig_k, oop orig_mirror, oop
switch (fd.field_type()) {
case T_OBJECT:
case T_ARRAY:
- m->obj_field_put(offset, orig_mirror->obj_field(offset));
+ {
+ oop field_obj = orig_mirror->obj_field(offset);
+ if (offset == java_lang_Class::reflection_data_offset()) {
+ // Class::reflectData use SoftReference, which cannot be archived. Set it
+ // to null and it will be recreated at runtime.
+ field_obj = nullptr;
+ }
+ m->obj_field_put(offset, field_obj);
+ if (field_obj != nullptr) {
+ bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, field_obj);
+ assert(success, "sanity");
+ }
+ }
break;
case T_BOOLEAN:
m->bool_field_put(offset, orig_mirror->bool_field(offset));
@@ -514,16 +560,18 @@ void HeapShared::copy_aot_initialized_mirror(Klass* orig_k, oop orig_mirror, oop
}
}
- java_lang_Class::set_class_data(m, java_lang_Class::class_data(orig_mirror));
-
- // Class::reflectData use SoftReference, which cannot be archived. Set it
- // to null and it will be recreated at runtime.
- java_lang_Class::set_reflection_data(m, nullptr);
+ oop class_data = java_lang_Class::class_data(orig_mirror);
+ java_lang_Class::set_class_data(m, class_data);
+ if (class_data != nullptr) {
+ bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, class_data);
+ assert(success, "sanity");
+ }
if (log_is_enabled(Info, cds, init)) {
ResourceMark rm;
- log_debug(cds, init)("copied %3d field(s) in aot-initialized mirror %s%s", nfields, ik->external_name(),
- ik->is_hidden() ? " (hidden)" : "");
+ log_debug(cds, init)("copied %3d field(s) in aot-initialized mirror %s%s%s", nfields, ik->external_name(),
+ ik->is_hidden() ? " (hidden)" : "",
+ ik->is_enum_subclass() ? " (enum)" : "");
}
}
@@ -546,10 +594,7 @@ static void copy_java_mirror_hashcode(oop orig_mirror, oop scratch_m) {
}
static objArrayOop get_archived_resolved_references(InstanceKlass* src_ik) {
- InstanceKlass* buffered_ik = ArchiveBuilder::current()->get_buffered_addr(src_ik);
- if (buffered_ik->is_shared_boot_class() ||
- buffered_ik->is_shared_platform_class() ||
- buffered_ik->is_shared_app_class()) {
+ if (SystemDictionaryShared::is_builtin_loader(src_ik->class_loader_data())) {
objArrayOop rr = src_ik->constants()->resolved_references_or_null();
if (rr != nullptr && !ArchiveHeapWriter::is_too_large_to_archive(rr)) {
return HeapShared::scratch_resolved_references(src_ik->constants());
@@ -558,68 +603,8 @@ static objArrayOop get_archived_resolved_references(InstanceKlass* src_ik) {
return nullptr;
}
-void HeapShared::archive_java_mirrors() {
- for (int i = T_BOOLEAN; i < T_VOID+1; i++) {
- BasicType bt = (BasicType)i;
- if (!is_reference_type(bt)) {
- oop orig_mirror = Universe::java_mirror(bt);
- oop m = _scratch_basic_type_mirrors[i].resolve();
- assert(m != nullptr, "sanity");
- copy_java_mirror_hashcode(orig_mirror, m);
- bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, m);
- assert(success, "sanity");
-
- log_trace(cds, heap, mirror)(
- "Archived %s mirror object from " PTR_FORMAT,
- type2name(bt), p2i(m));
-
- Universe::set_archived_basic_type_mirror_index(bt, append_root(m));
- }
- }
-
- GrowableArray* klasses = ArchiveBuilder::current()->klasses();
- assert(klasses != nullptr, "sanity");
-
- for (int i = 0; i < klasses->length(); i++) {
- Klass* orig_k = klasses->at(i);
- oop orig_mirror = orig_k->java_mirror();
- oop m = scratch_java_mirror(orig_k);
- if (m != nullptr) {
- copy_java_mirror_hashcode(orig_mirror, m);
- }
- }
-
- for (int i = 0; i < klasses->length(); i++) {
- Klass* orig_k = klasses->at(i);
- oop orig_mirror = orig_k->java_mirror();
- oop m = scratch_java_mirror(orig_k);
- if (m != nullptr) {
- Klass* buffered_k = ArchiveBuilder::get_buffered_klass(orig_k);
- bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, m);
- guarantee(success, "scratch mirrors must point to only archivable objects");
- buffered_k->set_archived_java_mirror(append_root(m));
- ResourceMark rm;
- log_trace(cds, heap, mirror)(
- "Archived %s mirror object from " PTR_FORMAT,
- buffered_k->external_name(), p2i(m));
-
- // archive the resolved_referenes array
- if (buffered_k->is_instance_klass()) {
- InstanceKlass* ik = InstanceKlass::cast(buffered_k);
- objArrayOop rr = get_archived_resolved_references(InstanceKlass::cast(orig_k));
- if (rr != nullptr) {
- bool success = HeapShared::archive_reachable_objects_from(1, _dump_time_special_subgraph, rr);
- assert(success, "must be");
- int root_index = append_root(rr);
- ik->constants()->cache()->set_archived_references(root_index);
- }
- }
- }
- }
-}
-
void HeapShared::archive_strings() {
- oop shared_strings_array = StringTable::init_shared_table(_dumped_interned_strings);
+ oop shared_strings_array = StringTable::init_shared_strings_array(_dumped_interned_strings);
bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, shared_strings_array);
// We must succeed because:
// - _dumped_interned_strings do not contain any large strings.
@@ -656,115 +641,9 @@ void HeapShared::set_has_native_pointers(oop src_obj) {
info->set_has_native_pointers();
}
-void HeapShared::start_finding_required_hidden_classes() {
- if (!CDSConfig::is_dumping_invokedynamic()) {
- return;
- }
- NoSafepointVerifier nsv;
-
- init_seen_objects_table();
-
- // We first scan the objects that are known to be archived (from the archive_subgraph
- // tables)
- find_required_hidden_classes_helper(archive_subgraph_entry_fields);
- if (CDSConfig::is_dumping_full_module_graph()) {
- find_required_hidden_classes_helper(fmg_archive_subgraph_entry_fields);
- }
-
- // Later, SystemDictionaryShared::find_all_archivable_classes_impl() will start
- // scanning the constant pools of all classes that it decides to archive.
-}
-
-void HeapShared::end_finding_required_hidden_classes() {
- if (!CDSConfig::is_dumping_invokedynamic()) {
- return;
- }
- NoSafepointVerifier nsv;
-
- delete_seen_objects_table();
-}
-
-void HeapShared::find_required_hidden_classes_helper(ArchivableStaticFieldInfo fields[]) {
- if (!CDSConfig::is_dumping_heap()) {
- return;
- }
- for (int i = 0; fields[i].valid(); i++) {
- ArchivableStaticFieldInfo* f = &fields[i];
- InstanceKlass* k = f->klass;
- oop m = k->java_mirror();
- oop o = m->obj_field(f->offset);
- if (o != nullptr) {
- find_required_hidden_classes_in_object(o);
- }
- }
-}
-
-class HeapShared::FindRequiredHiddenClassesOopClosure: public BasicOopIterateClosure {
- GrowableArray _stack;
- template void do_oop_work(T *p) {
- // Recurse on a GrowableArray to avoid overflowing the C stack.
- oop o = RawAccess<>::oop_load(p);
- if (o != nullptr) {
- _stack.append(o);
- }
- }
-
- public:
-
- void do_oop(narrowOop *p) { FindRequiredHiddenClassesOopClosure::do_oop_work(p); }
- void do_oop( oop *p) { FindRequiredHiddenClassesOopClosure::do_oop_work(p); }
-
- FindRequiredHiddenClassesOopClosure(oop o) {
- _stack.append(o);
- }
- oop pop() {
- if (_stack.length() == 0) {
- return nullptr;
- } else {
- return _stack.pop();
- }
- }
-};
-
-static void mark_required_if_hidden_class(Klass* k) {
- if (k != nullptr && k->is_instance_klass()) {
- InstanceKlass* ik = InstanceKlass::cast(k);
- if (ik->is_hidden()) {
- SystemDictionaryShared::mark_required_hidden_class(ik);
- }
- }
-}
-
-
-void HeapShared::find_required_hidden_classes_in_object(oop root) {
- ResourceMark rm;
- FindRequiredHiddenClassesOopClosure c(root);
- oop o;
- while ((o = c.pop()) != nullptr) {
- if (!has_been_seen_during_subgraph_recording(o)) {
- set_has_been_seen_during_subgraph_recording(o);
-
- // Mark the klass of this object
- mark_required_if_hidden_class(o->klass());
-
- // For special objects, mark the klass that they contain information about.
- // - a Class that refers to an hidden class
- // - a ResolvedMethodName that refers to a method declared in a hidden class
- if (java_lang_Class::is_instance(o)) {
- mark_required_if_hidden_class(java_lang_Class::as_Klass(o));
- } else if (java_lang_invoke_ResolvedMethodName::is_instance(o)) {
- Method* m = java_lang_invoke_ResolvedMethodName::vmtarget(o);
- if (m != nullptr) {
- mark_required_if_hidden_class(m->method_holder());
- }
- }
-
- o->oop_iterate(&c);
- }
- }
-}
-
-void HeapShared::archive_objects(ArchiveHeapInfo *heap_info) {
+// Between start_scanning_for_oops() and end_scanning_for_oops(), we discover all Java heap objects that
+// should be stored in the AOT cache. The scanning is coordinated by AOTArtifactFinder.
+void HeapShared::start_scanning_for_oops() {
{
NoSafepointVerifier nsv;
@@ -782,62 +661,61 @@ void HeapShared::archive_objects(ArchiveHeapInfo *heap_info) {
UseCompressedOops ? p2i(CompressedOops::end()) :
p2i((address)G1CollectedHeap::heap()->reserved().end()));
}
- copy_objects();
- CDSHeapVerifier::verify();
- check_special_subgraph_classes();
+ archive_subgraphs();
}
- ArchiveHeapWriter::write(_pending_roots, heap_info);
-}
-
-void HeapShared::copy_interned_strings() {
init_seen_objects_table();
+ Universe::archive_exception_instances();
+}
- auto copier = [&] (oop s, bool value_ignored) {
- assert(s != nullptr, "sanity");
- assert(!ArchiveHeapWriter::is_string_too_large_to_archive(s), "large strings must have been filtered");
- bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, s);
- assert(success, "must be");
- // Prevent string deduplication from changing the value field to
- // something not in the archive.
- java_lang_String::set_deduplication_forbidden(s);
- };
- _dumped_interned_strings->iterate_all(copier);
-
+void HeapShared::end_scanning_for_oops() {
+ archive_strings();
delete_seen_objects_table();
}
-void HeapShared::copy_special_subgraph() {
- copy_interned_strings();
-
- init_seen_objects_table();
+void HeapShared::write_heap(ArchiveHeapInfo *heap_info) {
{
- archive_java_mirrors();
- archive_strings();
- Universe::archive_exception_instances();
+ NoSafepointVerifier nsv;
+ CDSHeapVerifier::verify();
+ check_special_subgraph_classes();
}
- delete_seen_objects_table();
+
+ StringTable::write_shared_table(_dumped_interned_strings);
+ ArchiveHeapWriter::write(_pending_roots, heap_info);
+
+ ArchiveBuilder::OtherROAllocMark mark;
+ write_subgraph_info_table();
}
-void HeapShared::prepare_resolved_references() {
- GrowableArray* klasses = ArchiveBuilder::current()->klasses();
- for (int i = 0; i < klasses->length(); i++) {
- Klass* src_k = klasses->at(i);
- if (src_k->is_instance_klass()) {
- InstanceKlass* buffered_ik = ArchiveBuilder::current()->get_buffered_addr(InstanceKlass::cast(src_k));
- buffered_ik->constants()->prepare_resolved_references_for_archiving();
+void HeapShared::scan_java_mirror(oop orig_mirror) {
+ oop m = scratch_java_mirror(orig_mirror);
+ if (m != nullptr) { // nullptr if for custom class loader
+ copy_java_mirror_hashcode(orig_mirror, m);
+ bool success = archive_reachable_objects_from(1, _dump_time_special_subgraph, m);
+ assert(success, "sanity");
+ }
+}
+
+void HeapShared::scan_java_class(Klass* orig_k) {
+ scan_java_mirror(orig_k->java_mirror());
+
+ if (orig_k->is_instance_klass()) {
+ InstanceKlass* orig_ik = InstanceKlass::cast(orig_k);
+ orig_ik->constants()->prepare_resolved_references_for_archiving();
+ objArrayOop rr = get_archived_resolved_references(orig_ik);
+ if (rr != nullptr) {
+ bool success = HeapShared::archive_reachable_objects_from(1, _dump_time_special_subgraph, rr);
+ assert(success, "must be");
}
+
+ orig_ik->constants()->add_dumped_interned_strings();
}
}
-void HeapShared::copy_objects() {
+void HeapShared::archive_subgraphs() {
assert(HeapShared::can_write(), "must be");
- prepare_resolved_references();
- find_all_aot_initialized_classes();
- copy_special_subgraph();
-
archive_object_subgraphs(archive_subgraph_entry_fields,
false /* is_full_module_graph */);
@@ -848,198 +726,6 @@ void HeapShared::copy_objects() {
}
}
-// Closure used by HeapShared::scan_for_aot_initialized_classes() to look for all objects
-// that are reachable from a given root.
-class HeapShared::AOTInitializedClassScanner : public BasicOopIterateClosure {
- bool _made_progress;
-
- template void check(T *p) {
- oop obj = HeapAccess<>::oop_load(p);
- if (!java_lang_Class::is_instance(obj)) {
- // Don't scan the mirrors, as we may see an orig_mirror while scanning
- // the object graph, .... TODO more info
- _made_progress |= HeapShared::scan_for_aot_initialized_classes(obj);
- }
- }
-
-public:
- AOTInitializedClassScanner() : _made_progress(false) {}
- void do_oop(narrowOop *p) { check(p); }
- void do_oop( oop *p) { check(p); }
- bool made_progress() { return _made_progress; }
-};
-
-// If has been initialized during the assembly phase, mark its
-// has_aot_initialized_mirror bit. And then do the same for all supertypes of
-// .
-//
-// Note: a super interface of may not have been initialized, if
-// has not declared any default methods.
-//
-// Note: this function doesn not call InstanceKlass::initialize() -- we are inside
-// a safepoint.
-//
-// Returns true if one or more classes have been newly marked.
-static bool mark_for_aot_initialization(InstanceKlass* buffered_ik) {
- assert(SafepointSynchronize::is_at_safepoint(), "sanity");
- assert(ArchiveBuilder::current()->is_in_buffer_space(buffered_ik), "sanity");
-
- if (buffered_ik->has_aot_initialized_mirror()) { // already marked
- return false;
- }
-
- bool made_progress = false;
- if (buffered_ik->is_initialized()) {
- if (log_is_enabled(Info, cds, init)) {
- ResourceMark rm;
- log_info(cds, init)("Mark class for aot-init: %s", buffered_ik->external_name());
- }
-
- InstanceKlass* src_ik = ArchiveBuilder::current()->get_source_addr(buffered_ik);
-
- // If we get here with a "wild" user class, which may have
- // uncontrolled code, exit with an error. Obviously
- // filtering logic upstream needs to detect APP classes and not mark
- // them for aot-init in the first place, but this will be the final
- // firewall.
-
-#ifndef PRODUCT
- // ArchiveHeapTestClass is used for a very small number of internal regression
- // tests (non-product builds only). It may initialize some unexpected classes.
- if (ArchiveHeapTestClass == nullptr)
-#endif
- {
- if (!src_ik->in_javabase_module()) {
- // Class/interface types in the boot loader may have been initialized as side effects
- // of JVM bootstrap code, so they are fine. But we need to check all other classes.
- if (buffered_ik->is_interface()) {
- // This probably means a bug in AOTConstantPoolResolver.::is_indy_resolution_deterministic()
- guarantee(!buffered_ik->interface_needs_clinit_execution_as_super(),
- "should not have initialized an interface whose might have unpredictable side effects");
- } else {
- // "normal" classes
- guarantee(HeapShared::is_archivable_hidden_klass(buffered_ik),
- "should not have initialized any non-interface, non-hidden classes outside of java.base");
- }
- }
- }
-
- buffered_ik->set_has_aot_initialized_mirror();
- if (AOTClassInitializer::is_runtime_setup_required(src_ik)) {
- buffered_ik->set_is_runtime_setup_required();
- }
- made_progress = true;
-
- InstanceKlass* super = buffered_ik->java_super();
- if (super != nullptr) {
- mark_for_aot_initialization(super);
- }
-
- Array* interfaces = buffered_ik->transitive_interfaces();
- for (int i = 0; i < interfaces->length(); i++) {
- InstanceKlass* intf = interfaces->at(i);
- mark_for_aot_initialization(intf);
- if (!intf->is_initialized()) {
- assert(!intf->interface_needs_clinit_execution_as_super(/*also_check_supers*/false), "sanity");
- assert(!intf->has_aot_initialized_mirror(), "must not be marked");
- }
- }
- }
-
- return made_progress;
-}
-
-void HeapShared::find_all_aot_initialized_classes() {
- if (!CDSConfig::is_dumping_aot_linked_classes()) {
- return;
- }
-
- init_seen_objects_table();
- find_all_aot_initialized_classes_helper();
- delete_seen_objects_table();
-}
-
-// Recursively find all class that should be aot-initialized:
-// - the class has at least one instance that can be reachable from the special subgraph; or
-// - the class is hard-coded in AOTClassInitializer::can_archive_initialized_mirror()
-void HeapShared::find_all_aot_initialized_classes_helper() {
- GrowableArray* klasses = ArchiveBuilder::current()->klasses();
- assert(klasses != nullptr, "sanity");
-
- // First scan all resolved constant pools references.
- for (int i = 0; i < klasses->length(); i++) {
- Klass* src_k = klasses->at(i);
- if (src_k->is_instance_klass()) {
- InstanceKlass* src_ik = InstanceKlass::cast(src_k);
- InstanceKlass* buffered_ik = ArchiveBuilder::current()->get_buffered_addr(src_ik);
- objArrayOop rr = get_archived_resolved_references(src_ik);
- if (rr != nullptr) {
- objArrayOop scratch_rr = scratch_resolved_references(src_ik->constants());
- for (int i = 0; i < scratch_rr->length(); i++) {
- scan_for_aot_initialized_classes(scratch_rr->obj_at(i));
- }
- }
-
- // If a class is hard-coded to be aot-initialize, mark it as such.
- if (AOTClassInitializer::can_archive_initialized_mirror(src_ik)) {
- mark_for_aot_initialization(buffered_ik);
- }
- }
- }
-
- // These objects also belong to the special subgraph
- scan_for_aot_initialized_classes(Universe::null_ptr_exception_instance());
- scan_for_aot_initialized_classes(Universe::arithmetic_exception_instance());
- scan_for_aot_initialized_classes(Universe::internal_error_instance());
- scan_for_aot_initialized_classes(Universe::array_index_out_of_bounds_exception_instance());
- scan_for_aot_initialized_classes(Universe::array_store_exception_instance());
- scan_for_aot_initialized_classes(Universe::class_cast_exception_instance());
-
- bool made_progress;
- do {
- // In each pass, we copy the scratch mirrors of the classes that were marked
- // as aot-init in the previous pass. We then scan these mirrors, which may
- // mark more classes. Keep iterating until no more progress can be made.
- made_progress = false;
- for (int i = 0; i < klasses->length(); i++) {
- Klass* orig_k = klasses->at(i);
- if (orig_k->is_instance_klass()) {
- InstanceKlass* orig_ik = InstanceKlass::cast(orig_k);
- if (ArchiveBuilder::current()->get_buffered_addr(orig_ik)->has_aot_initialized_mirror()) {
- oop orig_mirror = orig_ik->java_mirror();
- oop scratch_mirror = scratch_java_mirror(orig_k);
- if (!has_been_seen_during_subgraph_recording(scratch_mirror)) {
- // Scan scratch_mirror instead of orig_mirror (which has fields like ClassLoader that
- // are not archived).
- copy_aot_initialized_mirror(orig_k, orig_mirror, scratch_mirror);
- made_progress |= scan_for_aot_initialized_classes(scratch_mirror);
- }
- }
- }
- }
- } while (made_progress);
-}
-
-bool HeapShared::scan_for_aot_initialized_classes(oop obj) {
- if (obj == nullptr || has_been_seen_during_subgraph_recording(obj)) {
- return false;
- }
- set_has_been_seen_during_subgraph_recording(obj);
-
- bool made_progress = false;
- Klass* k = obj->klass();
- if (k->is_instance_klass()) {
- InstanceKlass* orig_ik = InstanceKlass::cast(k);
- InstanceKlass* buffered_ik = ArchiveBuilder::current()->get_buffered_addr(orig_ik);
- made_progress = mark_for_aot_initialization(buffered_ik);
- }
-
- AOTInitializedClassScanner scanner;
- obj->oop_iterate(&scanner);
- made_progress |= scanner.made_progress();
- return made_progress;
-}
-
//
// Subgraph archiving support
//
@@ -1052,9 +738,8 @@ HeapShared::RunTimeKlassSubGraphInfoTable HeapShared::_run_time_subgraph_info_
KlassSubGraphInfo* HeapShared::init_subgraph_info(Klass* k, bool is_full_module_graph) {
assert(CDSConfig::is_dumping_heap(), "dump time only");
bool created;
- Klass* buffered_k = ArchiveBuilder::get_buffered_klass(k);
KlassSubGraphInfo* info =
- _dump_time_subgraph_info_table->put_if_absent(k, KlassSubGraphInfo(buffered_k, is_full_module_graph),
+ _dump_time_subgraph_info_table->put_if_absent(k, KlassSubGraphInfo(k, is_full_module_graph),
&created);
assert(created, "must not initialize twice");
return info;
@@ -1082,30 +767,29 @@ void KlassSubGraphInfo::add_subgraph_entry_field(int static_field_offset, oop v)
// Only objects of boot classes can be included in sub-graph.
void KlassSubGraphInfo::add_subgraph_object_klass(Klass* orig_k) {
assert(CDSConfig::is_dumping_heap(), "dump time only");
- Klass* buffered_k = ArchiveBuilder::get_buffered_klass(orig_k);
if (_subgraph_object_klasses == nullptr) {
_subgraph_object_klasses =
new (mtClass) GrowableArray(50, mtClass);
}
- assert(ArchiveBuilder::current()->is_in_buffer_space(buffered_k), "must be a shared class");
-
- if (_k == buffered_k) {
+ if (_k == orig_k) {
// Don't add the Klass containing the sub-graph to it's own klass
// initialization list.
return;
}
- if (buffered_k->is_instance_klass()) {
+ if (orig_k->is_instance_klass()) {
+#ifdef ASSERT
+ InstanceKlass* ik = InstanceKlass::cast(orig_k);
if (CDSConfig::is_dumping_invokedynamic()) {
- assert(InstanceKlass::cast(buffered_k)->is_shared_boot_class() ||
- HeapShared::is_lambda_proxy_klass(InstanceKlass::cast(buffered_k)),
+ assert(ik->class_loader() == nullptr ||
+ HeapShared::is_lambda_proxy_klass(ik),
"we can archive only instances of boot classes or lambda proxy classes");
} else {
- assert(InstanceKlass::cast(buffered_k)->is_shared_boot_class(),
- "must be boot class");
+ assert(ik->class_loader() == nullptr, "must be boot class");
}
+#endif
// vmClasses::xxx_klass() are not updated, need to check
// the original Klass*
if (orig_k == vmClasses::String_klass() ||
@@ -1114,37 +798,33 @@ void KlassSubGraphInfo::add_subgraph_object_klass(Klass* orig_k) {
// to the sub-graph object class list.
return;
}
- if (buffered_k->has_aot_initialized_mirror()) {
- // No need to add to the runtime-init list.
- return;
- }
check_allowed_klass(InstanceKlass::cast(orig_k));
- } else if (buffered_k->is_objArray_klass()) {
- Klass* abk = ObjArrayKlass::cast(buffered_k)->bottom_klass();
+ } else if (orig_k->is_objArray_klass()) {
+ Klass* abk = ObjArrayKlass::cast(orig_k)->bottom_klass();
if (abk->is_instance_klass()) {
assert(InstanceKlass::cast(abk)->is_shared_boot_class(),
"must be boot class");
check_allowed_klass(InstanceKlass::cast(ObjArrayKlass::cast(orig_k)->bottom_klass()));
}
- if (buffered_k == Universe::objectArrayKlass()) {
+ if (orig_k == Universe::objectArrayKlass()) {
// Initialized early during Universe::genesis. No need to be added
// to the list.
return;
}
} else {
- assert(buffered_k->is_typeArray_klass(), "must be");
+ assert(orig_k->is_typeArray_klass(), "must be");
// Primitive type arrays are created early during Universe::genesis.
return;
}
if (log_is_enabled(Debug, cds, heap)) {
- if (!_subgraph_object_klasses->contains(buffered_k)) {
+ if (!_subgraph_object_klasses->contains(orig_k)) {
ResourceMark rm;
log_debug(cds, heap)("Adding klass %s", orig_k->external_name());
}
}
- _subgraph_object_klasses->append_if_missing(buffered_k);
+ _subgraph_object_klasses->append_if_missing(orig_k);
_has_non_early_klasses |= is_non_early_klass(orig_k);
}
@@ -1200,7 +880,7 @@ bool KlassSubGraphInfo::is_non_early_klass(Klass* k) {
// Initialize an archived subgraph_info_record from the given KlassSubGraphInfo.
void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) {
- _k = info->klass();
+ _k = ArchiveBuilder::get_buffered_klass(info->klass());
_entry_field_records = nullptr;
_subgraph_object_klasses = nullptr;
_is_full_module_graph = info->is_full_module_graph();
@@ -1233,15 +913,28 @@ void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) {
}
}
- // the Klasses of the objects in the sub-graphs
- GrowableArray* subgraph_object_klasses = info->subgraph_object_klasses();
- if (subgraph_object_klasses != nullptr) {
- int num_subgraphs_klasses = subgraph_object_klasses->length();
- _subgraph_object_klasses =
- ArchiveBuilder::new_ro_array(num_subgraphs_klasses);
+ // has the Klasses of all the objects that are referenced by this subgraph.
+ // Copy those that need to be explicitly initialized into <_subgraph_object_klasses>.
+ GrowableArray* recorded_klasses = info->subgraph_object_klasses();
+ if (recorded_klasses != nullptr) {
+ // AOT-inited classes are automatically marked as "initialized" during bootstrap. When
+ // programmatically loading a subgraph, we only need to explicitly initialize the classes
+ // that are not aot-inited.
+ int num_to_copy = 0;
+ for (int i = 0; i < recorded_klasses->length(); i++) {
+ Klass* subgraph_k = ArchiveBuilder::get_buffered_klass(recorded_klasses->at(i));
+ if (!subgraph_k->has_aot_initialized_mirror()) {
+ num_to_copy ++;
+ }
+ }
+
+ _subgraph_object_klasses = ArchiveBuilder::new_ro_array(num_to_copy);
bool is_special = (_k == ArchiveBuilder::get_buffered_klass(vmClasses::Object_klass()));
- for (int i = 0; i < num_subgraphs_klasses; i++) {
- Klass* subgraph_k = subgraph_object_klasses->at(i);
+ for (int i = 0, n = 0; i < recorded_klasses->length(); i++) {
+ Klass* subgraph_k = ArchiveBuilder::get_buffered_klass(recorded_klasses->at(i));
+ if (subgraph_k->has_aot_initialized_mirror()) {
+ continue;
+ }
if (log_is_enabled(Info, cds, heap)) {
ResourceMark rm;
const char* owner_name = is_special ? "" : _k->external_name();
@@ -1250,10 +943,11 @@ void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) {
}
log_info(cds, heap)(
"Archived object klass %s (%2d) => %s",
- owner_name, i, subgraph_k->external_name());
+ owner_name, n, subgraph_k->external_name());
}
- _subgraph_object_klasses->at_put(i, subgraph_k);
- ArchivePtrMarker::mark_pointer(_subgraph_object_klasses->adr_at(i));
+ _subgraph_object_klasses->at_put(n, subgraph_k);
+ ArchivePtrMarker::mark_pointer(_subgraph_object_klasses->adr_at(n));
+ n++;
}
}
@@ -1693,7 +1387,7 @@ class WalkOopAndArchiveClosure: public BasicOopIterateClosure {
if (!_record_klasses_only && log_is_enabled(Debug, cds, heap)) {
ResourceMark rm;
- log_debug(cds, heap)("(%d) %s[" SIZE_FORMAT "] ==> " PTR_FORMAT " size " SIZE_FORMAT " %s", _level,
+ log_debug(cds, heap)("(%d) %s[%zu] ==> " PTR_FORMAT " size %zu %s", _level,
_referencing_obj->klass()->external_name(), field_delta,
p2i(obj), obj->size() * HeapWordSize, obj->klass()->external_name());
if (log_is_enabled(Trace, cds, heap)) {
@@ -1831,12 +1525,12 @@ bool HeapShared::archive_reachable_objects_from(int level,
bool record_klasses_only = already_archived;
if (!already_archived) {
++_num_new_archived_objs;
- if (!archive_object(orig_obj)) {
+ if (!archive_object(orig_obj, subgraph_info)) {
// Skip archiving the sub-graph referenced from the current entry field.
ResourceMark rm;
log_error(cds, heap)(
"Cannot archive the sub-graph referenced from %s object ("
- PTR_FORMAT ") size " SIZE_FORMAT ", skipped.",
+ PTR_FORMAT ") size %zu, skipped.",
orig_obj->klass()->external_name(), p2i(orig_obj), orig_obj->size() * HeapWordSize);
if (level == 1) {
// Don't archive a subgraph root that's too big. For archives static fields, that's OK
@@ -2011,7 +1705,7 @@ void HeapShared::check_special_subgraph_classes() {
int num = klasses->length();
for (int i = 0; i < num; i++) {
Klass* subgraph_k = klasses->at(i);
- Symbol* name = ArchiveBuilder::current()->get_source_addr(subgraph_k->name());
+ Symbol* name = subgraph_k->name();
if (subgraph_k->is_instance_klass() &&
name != vmSymbols::java_lang_Class() &&
name != vmSymbols::java_lang_String() &&
@@ -2337,10 +2031,17 @@ void HeapShared::add_to_dumped_interned_strings(oop string) {
bool created;
_dumped_interned_strings->put_if_absent(string, true, &created);
if (created) {
+ // Prevent string deduplication from changing the value field to
+ // something not in the archive.
+ java_lang_String::set_deduplication_forbidden(string);
_dumped_interned_strings->maybe_grow();
}
}
+bool HeapShared::is_dumped_interned_string(oop o) {
+ return _dumped_interned_strings->get(o) != nullptr;
+}
+
void HeapShared::debug_trace() {
ResourceMark rm;
WalkOopAndArchiveClosure* walker = WalkOopAndArchiveClosure::current();
@@ -2417,18 +2118,18 @@ void HeapShared::print_stats() {
size_t byte_size_limit = (size_t(1) << i) * HeapWordSize;
size_t count = _alloc_count[i];
size_t size = _alloc_size[i];
- log_info(cds, heap)(SIZE_FORMAT_W(8) " objects are <= " SIZE_FORMAT_W(-6)
- " bytes (total " SIZE_FORMAT_W(8) " bytes, avg %8.1f bytes)",
+ log_info(cds, heap)("%8zu objects are <= %-6zu"
+ " bytes (total %8zu bytes, avg %8.1f bytes)",
count, byte_size_limit, size * HeapWordSize, avg_size(size, count));
huge_count -= count;
huge_size -= size;
}
- log_info(cds, heap)(SIZE_FORMAT_W(8) " huge objects (total " SIZE_FORMAT_W(8) " bytes"
+ log_info(cds, heap)("%8zu huge objects (total %8zu bytes"
", avg %8.1f bytes)",
huge_count, huge_size * HeapWordSize,
avg_size(huge_size, huge_count));
- log_info(cds, heap)(SIZE_FORMAT_W(8) " total objects (total " SIZE_FORMAT_W(8) " bytes"
+ log_info(cds, heap)("%8zu total objects (total %8zu bytes"
", avg %8.1f bytes)",
_total_obj_count, _total_obj_size * HeapWordSize,
avg_size(_total_obj_size, _total_obj_count));
diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp
index 618adeb308f94..08541a273e6b7 100644
--- a/src/hotspot/share/cds/heapShared.hpp
+++ b/src/hotspot/share/cds/heapShared.hpp
@@ -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
@@ -171,11 +171,6 @@ class HeapShared: AllStatic {
static oop scratch_java_mirror(oop java_mirror) NOT_CDS_JAVA_HEAP_RETURN_(nullptr);
static bool is_archived_boot_layer_available(JavaThread* current) NOT_CDS_JAVA_HEAP_RETURN_(false);
- // Look for all hidden classes that are referenced by archived objects.
- static void start_finding_required_hidden_classes() NOT_CDS_JAVA_HEAP_RETURN;
- static void find_required_hidden_classes_in_object(oop o) NOT_CDS_JAVA_HEAP_RETURN;
- static void end_finding_required_hidden_classes() NOT_CDS_JAVA_HEAP_RETURN;
-
private:
#if INCLUDE_CDS_JAVA_HEAP
static bool _disable_writing;
@@ -260,9 +255,6 @@ class HeapShared: AllStatic {
static DumpTimeKlassSubGraphInfoTable* _dump_time_subgraph_info_table;
static RunTimeKlassSubGraphInfoTable _run_time_subgraph_info_table;
- class FindRequiredHiddenClassesOopClosure;
- static void find_required_hidden_classes_helper(ArchivableStaticFieldInfo fields[]);
-
static CachedOopInfo make_cached_oop_info(oop obj);
static ArchivedKlassSubGraphInfoRecord* archive_subgraph_info(KlassSubGraphInfo* info);
static void archive_object_subgraphs(ArchivableStaticFieldInfo fields[],
@@ -344,9 +336,7 @@ class HeapShared: AllStatic {
static bool has_been_seen_during_subgraph_recording(oop obj);
static void set_has_been_seen_during_subgraph_recording(oop obj);
- static bool archive_object(oop obj);
- static void copy_aot_initialized_mirror(Klass* orig_k, oop orig_mirror, oop m);
- static void copy_interned_strings();
+ static bool archive_object(oop obj, KlassSubGraphInfo* subgraph_info);
static void resolve_classes_for_subgraphs(JavaThread* current, ArchivableStaticFieldInfo fields[]);
static void resolve_classes_for_subgraph_of(JavaThread* current, Klass* k);
@@ -369,14 +359,8 @@ class HeapShared: AllStatic {
static void mark_native_pointers(oop orig_obj);
static bool has_been_archived(oop orig_obj);
static void prepare_resolved_references();
- static void archive_java_mirrors();
static void archive_strings();
- static void copy_special_subgraph();
-
- class AOTInitializedClassScanner;
- static void find_all_aot_initialized_classes();
- static void find_all_aot_initialized_classes_helper();
- static bool scan_for_aot_initialized_classes(oop obj);
+ static void archive_subgraphs();
public:
static void reset_archived_object_states(TRAPS);
@@ -393,14 +377,14 @@ class HeapShared: AllStatic {
}
static int archive_exception_instance(oop exception);
- static void archive_objects(ArchiveHeapInfo* heap_info);
- static void copy_objects();
+ static void write_heap(ArchiveHeapInfo* heap_info);
static bool archive_reachable_objects_from(int level,
KlassSubGraphInfo* subgraph_info,
oop orig_obj);
static void add_to_dumped_interned_strings(oop string);
+ static bool is_dumped_interned_string(oop o);
// Scratch objects for archiving Klass::java_mirror()
static void set_scratch_java_mirror(Klass* k, oop mirror);
@@ -470,6 +454,13 @@ class HeapShared: AllStatic {
static bool is_lambda_proxy_klass(InstanceKlass* ik) NOT_CDS_JAVA_HEAP_RETURN_(false);
static bool is_string_concat_klass(InstanceKlass* ik) NOT_CDS_JAVA_HEAP_RETURN_(false);
static bool is_archivable_hidden_klass(InstanceKlass* ik) NOT_CDS_JAVA_HEAP_RETURN_(false);
+
+ // Used by AOTArtifactFinder
+ static void start_scanning_for_oops();
+ static void end_scanning_for_oops();
+ static void scan_java_class(Klass* k);
+ static void scan_java_mirror(oop orig_mirror);
+ static void copy_and_rescan_aot_inited_mirror(InstanceKlass* ik);
};
#if INCLUDE_CDS_JAVA_HEAP
diff --git a/src/hotspot/share/cds/lambdaFormInvokers.cpp b/src/hotspot/share/cds/lambdaFormInvokers.cpp
index 7765bc26aa3ec..ee3e9cff782ae 100644
--- a/src/hotspot/share/cds/lambdaFormInvokers.cpp
+++ b/src/hotspot/share/cds/lambdaFormInvokers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/lambdaFormInvokers.hpp"
#include "cds/metaspaceShared.hpp"
diff --git a/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp b/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp
index b8220a34047e3..91f677055a68d 100644
--- a/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp
+++ b/src/hotspot/share/cds/lambdaProxyClassDictionary.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/lambdaProxyClassDictionary.hpp"
#include "classfile/systemDictionaryShared.hpp"
diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp
index 753160e7ec126..2020a477d73a8 100644
--- a/src/hotspot/share/cds/metaspaceShared.cpp
+++ b/src/hotspot/share/cds/metaspaceShared.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,7 @@
*
*/
-#include "precompiled.hpp"
+#include "cds/aotArtifactFinder.hpp"
#include "cds/aotClassLinker.hpp"
#include "cds/aotConstantPoolResolver.hpp"
#include "cds/aotLinkedClassBulkLoader.hpp"
@@ -122,7 +122,7 @@ bool MetaspaceShared::_use_optimized_module_handling = true;
// [5] SymbolTable, StringTable, SystemDictionary, and a few other read-only data
// are copied into the ro region as read-only tables.
//
-// The heap region is populated by HeapShared::archive_objects.
+// The heap region is written by HeapShared::write_heap().
//
// The bitmap region is used to relocate the ro/rw/hp regions.
@@ -264,7 +264,7 @@ static char* compute_shared_base(size_t cds_max) {
void MetaspaceShared::initialize_for_static_dump() {
assert(CDSConfig::is_dumping_static_archive(), "sanity");
- log_info(cds)("Core region alignment: " SIZE_FORMAT, core_region_alignment());
+ log_info(cds)("Core region alignment: %zu", core_region_alignment());
// The max allowed size for CDS archive. We use this to limit SharedBaseAddress
// to avoid address space wrap around.
size_t cds_max;
@@ -285,7 +285,7 @@ void MetaspaceShared::initialize_for_static_dump() {
size_t symbol_rs_size = LP64_ONLY(3 * G) NOT_LP64(128 * M);
_symbol_rs = MemoryReserver::reserve(symbol_rs_size, mtClassShared);
if (!_symbol_rs.is_reserved()) {
- log_error(cds)("Unable to reserve memory for symbols: " SIZE_FORMAT " bytes.", symbol_rs_size);
+ log_error(cds)("Unable to reserve memory for symbols: %zu bytes.", symbol_rs_size);
MetaspaceShared::unrecoverable_writing_error();
}
_symbol_region.init(&_symbol_rs, &_symbol_vs);
@@ -544,6 +544,7 @@ class StaticArchiveBuilder : public ArchiveBuilder {
virtual void iterate_roots(MetaspaceClosure* it) {
FileMapInfo::metaspace_pointers_do(it);
+ AOTArtifactFinder::all_cached_classes_do(it);
SystemDictionaryShared::dumptime_classes_do(it);
Universe::metaspace_pointers_do(it);
vmSymbols::metaspace_pointers_do(it);
@@ -614,7 +615,15 @@ void VM_PopulateDumpSharedSpace::doit() {
// Block concurrent class unloading from changing the _dumptime_table
MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
- SystemDictionaryShared::find_all_archivable_classes();
+
+#if INCLUDE_CDS_JAVA_HEAP
+ if (HeapShared::can_write() && _extra_interned_strings != nullptr) {
+ for (int i = 0; i < _extra_interned_strings->length(); i ++) {
+ OopHandle string = _extra_interned_strings->at(i);
+ HeapShared::add_to_dumped_interned_strings(string.resolve());
+ }
+ }
+#endif
_builder.gather_source_objs();
_builder.reserve_buffer();
@@ -626,13 +635,13 @@ void VM_PopulateDumpSharedSpace::doit() {
_builder.dump_ro_metadata();
_builder.relocate_metaspaceobj_embedded_pointers();
- dump_java_heap_objects(_builder.klasses());
- dump_shared_symbol_table(_builder.symbols());
-
log_info(cds)("Make classes shareable");
_builder.make_klasses_shareable();
MetaspaceShared::make_method_handle_intrinsics_shareable();
+ dump_java_heap_objects(_builder.klasses());
+ dump_shared_symbol_table(_builder.symbols());
+
char* early_serialized_data = dump_early_read_only_tables();
char* serialized_data = dump_read_only_tables();
@@ -759,7 +768,7 @@ void MetaspaceShared::preload_and_dump(TRAPS) {
if (HAS_PENDING_EXCEPTION) {
if (PENDING_EXCEPTION->is_a(vmClasses::OutOfMemoryError_klass())) {
log_error(cds)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
- SIZE_FORMAT "M", MaxHeapSize/M);
+ "%zuM", MaxHeapSize/M);
MetaspaceShared::writing_error();
} else {
log_error(cds)("%s: %s", PENDING_EXCEPTION->klass()->external_name(),
@@ -788,15 +797,15 @@ void MetaspaceShared::adjust_heap_sizes_for_dumping() {
julong max_heap_size = (julong)(4 * G);
if (MinHeapSize > max_heap_size) {
- log_debug(cds)("Setting MinHeapSize to 4G for CDS dumping, original size = " SIZE_FORMAT "M", MinHeapSize/M);
+ log_debug(cds)("Setting MinHeapSize to 4G for CDS dumping, original size = %zuM", MinHeapSize/M);
FLAG_SET_ERGO(MinHeapSize, max_heap_size);
}
if (InitialHeapSize > max_heap_size) {
- log_debug(cds)("Setting InitialHeapSize to 4G for CDS dumping, original size = " SIZE_FORMAT "M", InitialHeapSize/M);
+ log_debug(cds)("Setting InitialHeapSize to 4G for CDS dumping, original size = %zuM", InitialHeapSize/M);
FLAG_SET_ERGO(InitialHeapSize, max_heap_size);
}
if (MaxHeapSize > max_heap_size) {
- log_debug(cds)("Setting MaxHeapSize to 4G for CDS dumping, original size = " SIZE_FORMAT "M", MaxHeapSize/M);
+ log_debug(cds)("Setting MaxHeapSize to 4G for CDS dumping, original size = %zuM", MaxHeapSize/M);
FLAG_SET_ERGO(MaxHeapSize, max_heap_size);
}
}
@@ -987,8 +996,10 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
ik->external_name());
CLEAR_PENDING_EXCEPTION;
SystemDictionaryShared::set_class_has_failed_verification(ik);
+ } else {
+ assert(!SystemDictionaryShared::has_class_failed_verification(ik), "sanity");
+ ik->compute_has_loops_flag_for_methods();
}
- ik->compute_has_loops_flag_for_methods();
BytecodeVerificationLocal = saved;
return true;
} else {
@@ -998,7 +1009,7 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
#if INCLUDE_CDS_JAVA_HEAP
void VM_PopulateDumpSharedSpace::dump_java_heap_objects(GrowableArray* klasses) {
- if(!HeapShared::can_write()) {
+ if (!HeapShared::can_write()) {
log_info(cds)(
"Archived java heap is not supported as UseG1GC "
"and UseCompressedClassPointers are required."
@@ -1006,25 +1017,7 @@ void VM_PopulateDumpSharedSpace::dump_java_heap_objects(GrowableArray* k
BOOL_TO_STR(UseG1GC), BOOL_TO_STR(UseCompressedClassPointers));
return;
}
- // Find all the interned strings that should be dumped.
- int i;
- for (i = 0; i < klasses->length(); i++) {
- Klass* k = klasses->at(i);
- if (k->is_instance_klass()) {
- InstanceKlass* ik = InstanceKlass::cast(k);
- ik->constants()->add_dumped_interned_strings();
- }
- }
- if (_extra_interned_strings != nullptr) {
- for (i = 0; i < _extra_interned_strings->length(); i ++) {
- OopHandle string = _extra_interned_strings->at(i);
- HeapShared::add_to_dumped_interned_strings(string.resolve());
- }
- }
-
- HeapShared::archive_objects(&_heap_info);
- ArchiveBuilder::OtherROAllocMark mark;
- HeapShared::write_subgraph_info_table();
+ HeapShared::write_heap(&_heap_info);
}
#endif // INCLUDE_CDS_JAVA_HEAP
@@ -1088,7 +1081,7 @@ void MetaspaceShared::initialize_runtime_shared_and_meta_spaces() {
FileMapInfo* dynamic_mapinfo = nullptr;
if (static_mapinfo != nullptr) {
- log_info(cds)("Core region alignment: " SIZE_FORMAT, static_mapinfo->core_region_alignment());
+ log_info(cds)("Core region alignment: %zu", static_mapinfo->core_region_alignment());
dynamic_mapinfo = open_dynamic_archive();
// First try to map at the requested address
@@ -1242,9 +1235,9 @@ MapArchiveResult MetaspaceShared::map_archives(FileMapInfo* static_mapinfo, File
}
#endif // ASSERT
- log_info(cds)("Reserved archive_space_rs [" INTPTR_FORMAT " - " INTPTR_FORMAT "] (" SIZE_FORMAT ") bytes",
+ log_info(cds)("Reserved archive_space_rs [" INTPTR_FORMAT " - " INTPTR_FORMAT "] (%zu) bytes",
p2i(archive_space_rs.base()), p2i(archive_space_rs.end()), archive_space_rs.size());
- log_info(cds)("Reserved class_space_rs [" INTPTR_FORMAT " - " INTPTR_FORMAT "] (" SIZE_FORMAT ") bytes",
+ log_info(cds)("Reserved class_space_rs [" INTPTR_FORMAT " - " INTPTR_FORMAT "] (%zu) bytes",
p2i(class_space_rs.base()), p2i(class_space_rs.end()), class_space_rs.size());
if (MetaspaceShared::use_windows_memory_mapping()) {
@@ -1473,8 +1466,7 @@ char* MetaspaceShared::reserve_address_space_for_archives(FileMapInfo* static_ma
size_t class_space_size = CompressedClassSpaceSize;
assert(CompressedClassSpaceSize > 0 &&
is_aligned(CompressedClassSpaceSize, class_space_alignment),
- "CompressedClassSpaceSize malformed: "
- SIZE_FORMAT, CompressedClassSpaceSize);
+ "CompressedClassSpaceSize malformed: %zu", CompressedClassSpaceSize);
const size_t ccs_begin_offset = align_up(archive_space_size, class_space_alignment);
const size_t gap_size = ccs_begin_offset - archive_space_size;
@@ -1484,7 +1476,7 @@ char* MetaspaceShared::reserve_address_space_for_archives(FileMapInfo* static_ma
guarantee(archive_space_size < max_encoding_range_size - class_space_alignment, "Archive too large");
if ((archive_space_size + gap_size + class_space_size) > max_encoding_range_size) {
class_space_size = align_down(max_encoding_range_size - archive_space_size - gap_size, class_space_alignment);
- log_info(metaspace)("CDS initialization: reducing class space size from " SIZE_FORMAT " to " SIZE_FORMAT,
+ log_info(metaspace)("CDS initialization: reducing class space size from %zu to %zu",
CompressedClassSpaceSize, class_space_size);
FLAG_SET_ERGO(CompressedClassSpaceSize, class_space_size);
}
@@ -1606,8 +1598,8 @@ MapArchiveResult MetaspaceShared::map_archive(FileMapInfo* mapinfo, char* mapped
mapinfo->set_is_mapped(false);
if (mapinfo->core_region_alignment() != (size_t)core_region_alignment()) {
- log_info(cds)("Unable to map CDS archive -- core_region_alignment() expected: " SIZE_FORMAT
- " actual: " SIZE_FORMAT, mapinfo->core_region_alignment(), core_region_alignment());
+ log_info(cds)("Unable to map CDS archive -- core_region_alignment() expected: %zu"
+ " actual: %zu", mapinfo->core_region_alignment(), core_region_alignment());
return MAP_ARCHIVE_OTHER_FAILURE;
}
@@ -1776,7 +1768,7 @@ void MetaspaceShared::print_on(outputStream* st) {
address static_top = (address)_shared_metaspace_static_top;
address top = (address)MetaspaceObj::shared_metaspace_top();
st->print("[" PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "), ", p2i(base), p2i(static_top), p2i(top));
- st->print("size " SIZE_FORMAT ", ", top - base);
+ st->print("size %zu, ", top - base);
st->print("SharedBaseAddress: " PTR_FORMAT ", ArchiveRelocationMode: %d.", SharedBaseAddress, ArchiveRelocationMode);
} else {
st->print("CDS archive(s) not mapped");
diff --git a/src/hotspot/share/cds/metaspaceShared.hpp b/src/hotspot/share/cds/metaspaceShared.hpp
index 8c20378649187..6d5f273041a83 100644
--- a/src/hotspot/share/cds/metaspaceShared.hpp
+++ b/src/hotspot/share/cds/metaspaceShared.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -41,7 +41,6 @@ class SerializeClosure;
class StaticArchiveBuilder;
template class Array;
-template class GrowableArray;
enum MapArchiveResult {
MAP_ARCHIVE_SUCCESS,
diff --git a/src/hotspot/share/cds/regeneratedClasses.cpp b/src/hotspot/share/cds/regeneratedClasses.cpp
index 6c7be18edd90b..37d5e89598a7c 100644
--- a/src/hotspot/share/cds/regeneratedClasses.cpp
+++ b/src/hotspot/share/cds/regeneratedClasses.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/regeneratedClasses.hpp"
#include "memory/universe.hpp"
diff --git a/src/hotspot/share/cds/runTimeClassInfo.cpp b/src/hotspot/share/cds/runTimeClassInfo.cpp
index e2d41cd1de261..3d237e6759aaf 100644
--- a/src/hotspot/share/cds/runTimeClassInfo.cpp
+++ b/src/hotspot/share/cds/runTimeClassInfo.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/dumpTimeClassInfo.hpp"
#include "cds/runTimeClassInfo.hpp"
diff --git a/src/hotspot/share/cds/unregisteredClasses.cpp b/src/hotspot/share/cds/unregisteredClasses.cpp
index 2aeb2fc94e77f..ca52eb1ea70ff 100644
--- a/src/hotspot/share/cds/unregisteredClasses.cpp
+++ b/src/hotspot/share/cds/unregisteredClasses.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/unregisteredClasses.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoader.inline.hpp"
diff --git a/src/hotspot/share/ci/bcEscapeAnalyzer.cpp b/src/hotspot/share/ci/bcEscapeAnalyzer.cpp
index 16ecab7dfac05..cf7b839c98241 100644
--- a/src/hotspot/share/ci/bcEscapeAnalyzer.cpp
+++ b/src/hotspot/share/ci/bcEscapeAnalyzer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmIntrinsics.hpp"
#include "ci/bcEscapeAnalyzer.hpp"
#include "ci/ciConstant.hpp"
diff --git a/src/hotspot/share/ci/ciArray.cpp b/src/hotspot/share/ci/ciArray.cpp
index 6f601c87ff2de..6b1a30fec6aa8 100644
--- a/src/hotspot/share/ci/ciArray.cpp
+++ b/src/hotspot/share/ci/ciArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciArray.hpp"
#include "ci/ciArrayKlass.hpp"
#include "ci/ciConstant.hpp"
diff --git a/src/hotspot/share/ci/ciArrayKlass.cpp b/src/hotspot/share/ci/ciArrayKlass.cpp
index 6bcb2526cd693..947cc0cb6fcb2 100644
--- a/src/hotspot/share/ci/ciArrayKlass.cpp
+++ b/src/hotspot/share/ci/ciArrayKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciArrayKlass.hpp"
#include "ci/ciObjArrayKlass.hpp"
#include "ci/ciTypeArrayKlass.hpp"
diff --git a/src/hotspot/share/ci/ciBaseObject.cpp b/src/hotspot/share/ci/ciBaseObject.cpp
index aeeaad73fbf82..8c4a9c5cb122f 100644
--- a/src/hotspot/share/ci/ciBaseObject.cpp
+++ b/src/hotspot/share/ci/ciBaseObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciBaseObject.hpp"
#include "ci/ciUtilities.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/share/ci/ciCallSite.cpp b/src/hotspot/share/ci/ciCallSite.cpp
index 8b67d9ec6ac59..3271e4ea7c7a5 100644
--- a/src/hotspot/share/ci/ciCallSite.cpp
+++ b/src/hotspot/share/ci/ciCallSite.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "ci/ciCallSite.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciConstant.cpp b/src/hotspot/share/ci/ciConstant.cpp
index 62ff0ab08c914..234cd8171c46b 100644
--- a/src/hotspot/share/ci/ciConstant.cpp
+++ b/src/hotspot/share/ci/ciConstant.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciConstant.hpp"
#include "ci/ciUtilities.hpp"
#include "memory/allocation.hpp"
diff --git a/src/hotspot/share/ci/ciConstantPoolCache.cpp b/src/hotspot/share/ci/ciConstantPoolCache.cpp
index e831516b0f70b..cfb031aff60b5 100644
--- a/src/hotspot/share/ci/ciConstantPoolCache.cpp
+++ b/src/hotspot/share/ci/ciConstantPoolCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciConstantPoolCache.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "memory/allocation.hpp"
diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp
index eb7d1eaf64dd4..e87c5ba08e95e 100644
--- a/src/hotspot/share/ci/ciEnv.cpp
+++ b/src/hotspot/share/ci/ciEnv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciConstant.hpp"
#include "ci/ciEnv.hpp"
#include "ci/ciField.hpp"
diff --git a/src/hotspot/share/ci/ciExceptionHandler.cpp b/src/hotspot/share/ci/ciExceptionHandler.cpp
index 6c30e71596545..1896ada69fc3a 100644
--- a/src/hotspot/share/ci/ciExceptionHandler.cpp
+++ b/src/hotspot/share/ci/ciExceptionHandler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciExceptionHandler.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "runtime/handles.inline.hpp"
diff --git a/src/hotspot/share/ci/ciField.cpp b/src/hotspot/share/ci/ciField.cpp
index 0eddd87200ae0..44d7fa3796051 100644
--- a/src/hotspot/share/ci/ciField.cpp
+++ b/src/hotspot/share/ci/ciField.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciField.hpp"
#include "ci/ciInstanceKlass.hpp"
#include "ci/ciSymbols.hpp"
diff --git a/src/hotspot/share/ci/ciFlags.cpp b/src/hotspot/share/ci/ciFlags.cpp
index 1401a432a9e18..5eade4a12c168 100644
--- a/src/hotspot/share/ci/ciFlags.cpp
+++ b/src/hotspot/share/ci/ciFlags.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciFlags.hpp"
// ciFlags
@@ -92,5 +91,5 @@ void ciFlags::print_member_flags(outputStream* st) {
// ------------------------------------------------------------------
// ciFlags::print
void ciFlags::print(outputStream* st) {
- st->print(" flags=%x", _flags);
+ st->print(" flags=%x", _flags.as_unsigned_short());
}
diff --git a/src/hotspot/share/ci/ciFlags.hpp b/src/hotspot/share/ci/ciFlags.hpp
index dd1df622487f3..426f953611fee 100644
--- a/src/hotspot/share/ci/ciFlags.hpp
+++ b/src/hotspot/share/ci/ciFlags.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,7 +26,6 @@
#define SHARE_CI_CIFLAGS_HPP
#include "ci/ciClassList.hpp"
-#include "jvm_constants.h"
#include "utilities/accessFlags.hpp"
#include "utilities/ostream.hpp"
@@ -39,37 +38,37 @@ class ciFlags {
friend class ciField;
friend class ciMethod;
- jint _flags;
+ AccessFlags _flags;
bool _stable;
- bool _intialized_final_update;
+ bool _initialized_final_update;
- ciFlags() :_flags(0), _stable(false), _intialized_final_update(false) { }
+ ciFlags() :_flags(0), _stable(false), _initialized_final_update(false) { }
ciFlags(AccessFlags flags, bool is_stable = false, bool is_initialized_final_update = false) :
- _flags(flags.as_int()), _stable(is_stable), _intialized_final_update(is_initialized_final_update) { }
+ _flags(flags), _stable(is_stable), _initialized_final_update(is_initialized_final_update) { }
public:
// Java access flags
- bool is_public () const { return (_flags & JVM_ACC_PUBLIC ) != 0; }
- bool is_private () const { return (_flags & JVM_ACC_PRIVATE ) != 0; }
- bool is_protected () const { return (_flags & JVM_ACC_PROTECTED ) != 0; }
- bool is_static () const { return (_flags & JVM_ACC_STATIC ) != 0; }
- bool is_final () const { return (_flags & JVM_ACC_FINAL ) != 0; }
- bool is_synchronized () const { return (_flags & JVM_ACC_SYNCHRONIZED ) != 0; }
- bool is_super () const { return (_flags & JVM_ACC_SUPER ) != 0; }
- bool is_volatile () const { return (_flags & JVM_ACC_VOLATILE ) != 0; }
- bool is_transient () const { return (_flags & JVM_ACC_TRANSIENT ) != 0; }
- bool is_native () const { return (_flags & JVM_ACC_NATIVE ) != 0; }
- bool is_interface () const { return (_flags & JVM_ACC_INTERFACE ) != 0; }
- bool is_abstract () const { return (_flags & JVM_ACC_ABSTRACT ) != 0; }
+ bool is_public () const { return _flags.is_public(); }
+ bool is_private () const { return _flags.is_private(); }
+ bool is_protected () const { return _flags.is_protected(); }
+ bool is_static () const { return _flags.is_static(); }
+ bool is_final () const { return _flags.is_final(); }
+ bool is_synchronized () const { return _flags.is_synchronized(); }
+ bool is_super () const { return _flags.is_super(); }
+ bool is_volatile () const { return _flags.is_volatile(); }
+ bool is_transient () const { return _flags.is_transient(); }
+ bool is_native () const { return _flags.is_native(); }
+ bool is_interface () const { return _flags.is_interface(); }
+ bool is_abstract () const { return _flags.is_abstract(); }
bool is_stable () const { return _stable; }
// In case the current object represents a field, return true if
// the field is modified outside of instance initializer methods
// (or class/initializer methods if the field is static) and false
// otherwise.
- bool has_initialized_final_update() const { return _intialized_final_update; };
+ bool has_initialized_final_update() const { return _initialized_final_update; };
// Conversion
- jint as_int() { return _flags; }
+ jint as_int() { return _flags.as_unsigned_short(); }
void print_klass_flags(outputStream* st = tty);
void print_member_flags(outputStream* st = tty);
diff --git a/src/hotspot/share/ci/ciInstance.cpp b/src/hotspot/share/ci/ciInstance.cpp
index 6ede59dd72309..edd8f8b0f4067 100644
--- a/src/hotspot/share/ci/ciInstance.cpp
+++ b/src/hotspot/share/ci/ciInstance.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "ci/ciConstant.hpp"
#include "ci/ciField.hpp"
diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp
index a9342eeada48b..94655e017ca14 100644
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciField.hpp"
#include "ci/ciInstance.hpp"
#include "ci/ciInstanceKlass.hpp"
diff --git a/src/hotspot/share/ci/ciKlass.cpp b/src/hotspot/share/ci/ciKlass.cpp
index f65d4a0311c82..f3e49634d2984 100644
--- a/src/hotspot/share/ci/ciKlass.cpp
+++ b/src/hotspot/share/ci/ciKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciKlass.hpp"
#include "ci/ciSymbol.hpp"
#include "ci/ciUtilities.inline.hpp"
@@ -222,7 +221,7 @@ jint ciKlass::modifier_flags() {
jint ciKlass::access_flags() {
assert(is_loaded(), "not loaded");
GUARDED_VM_ENTRY(
- return get_Klass()->access_flags().as_int();
+ return get_Klass()->access_flags().as_unsigned_short();
)
}
diff --git a/src/hotspot/share/ci/ciMemberName.cpp b/src/hotspot/share/ci/ciMemberName.cpp
index 4306e6e649ee2..aec4d4c4d19c1 100644
--- a/src/hotspot/share/ci/ciMemberName.cpp
+++ b/src/hotspot/share/ci/ciMemberName.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciClassList.hpp"
#include "ci/ciMemberName.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciMetadata.cpp b/src/hotspot/share/ci/ciMetadata.cpp
index f0d1fcf4357e0..a2c21289a2cb6 100644
--- a/src/hotspot/share/ci/ciMetadata.cpp
+++ b/src/hotspot/share/ci/ciMetadata.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciObject.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/share/ci/ciMethod.cpp b/src/hotspot/share/ci/ciMethod.cpp
index 80277b91d2264..96cb0bb904094 100644
--- a/src/hotspot/share/ci/ciMethod.cpp
+++ b/src/hotspot/share/ci/ciMethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciCallProfile.hpp"
#include "ci/ciExceptionHandler.hpp"
#include "ci/ciInstanceKlass.hpp"
diff --git a/src/hotspot/share/ci/ciMethodBlocks.cpp b/src/hotspot/share/ci/ciMethodBlocks.cpp
index 03dd2c31f993a..ea2ea04e8c072 100644
--- a/src/hotspot/share/ci/ciMethodBlocks.cpp
+++ b/src/hotspot/share/ci/ciMethodBlocks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethodBlocks.hpp"
#include "ci/ciStreams.hpp"
#include "interpreter/bytecode.hpp"
diff --git a/src/hotspot/share/ci/ciMethodData.cpp b/src/hotspot/share/ci/ciMethodData.cpp
index 5abb342d03119..a37e4ba75e6f5 100644
--- a/src/hotspot/share/ci/ciMethodData.cpp
+++ b/src/hotspot/share/ci/ciMethodData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMetadata.hpp"
#include "ci/ciMethodData.hpp"
#include "ci/ciReplay.hpp"
@@ -785,7 +784,7 @@ void ciMethodData::dump_replay_data(outputStream* out) {
// We could use INTPTR_FORMAT here but that's zero justified
// which makes comparing it with the SA version of this output
// harder. data()'s element type is intptr_t.
- out->print(" " INTX_FORMAT_X, data()[i]);
+ out->print(" 0x%zx", data()[i]);
}
// The MDO contained oop references as ciObjects, so scan for those
diff --git a/src/hotspot/share/ci/ciMethodHandle.cpp b/src/hotspot/share/ci/ciMethodHandle.cpp
index 49de75353a63f..2e2a57036a687 100644
--- a/src/hotspot/share/ci/ciMethodHandle.cpp
+++ b/src/hotspot/share/ci/ciMethodHandle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciClassList.hpp"
#include "ci/ciMethodHandle.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciMethodType.cpp b/src/hotspot/share/ci/ciMethodType.cpp
index f9cd22001a310..3051dbeeddd8f 100644
--- a/src/hotspot/share/ci/ciMethodType.cpp
+++ b/src/hotspot/share/ci/ciMethodType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciInstance.hpp"
#include "ci/ciMethodType.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciNullObject.cpp b/src/hotspot/share/ci/ciNullObject.cpp
index e79b8dc5ecea0..c030d9f57371f 100644
--- a/src/hotspot/share/ci/ciNullObject.cpp
+++ b/src/hotspot/share/ci/ciNullObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciNullObject.hpp"
#include "ci/ciUtilities.hpp"
diff --git a/src/hotspot/share/ci/ciObjArray.cpp b/src/hotspot/share/ci/ciObjArray.cpp
index d06665d616393..2a485fb26182d 100644
--- a/src/hotspot/share/ci/ciObjArray.cpp
+++ b/src/hotspot/share/ci/ciObjArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciNullObject.hpp"
#include "ci/ciObjArray.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciObjArrayKlass.cpp b/src/hotspot/share/ci/ciObjArrayKlass.cpp
index 1b47702599b53..191e4e67522ac 100644
--- a/src/hotspot/share/ci/ciObjArrayKlass.cpp
+++ b/src/hotspot/share/ci/ciObjArrayKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciInstanceKlass.hpp"
#include "ci/ciObjArrayKlass.hpp"
#include "ci/ciSymbol.hpp"
diff --git a/src/hotspot/share/ci/ciObject.cpp b/src/hotspot/share/ci/ciObject.cpp
index 2fe8b91b8215f..23696b6b70a8d 100644
--- a/src/hotspot/share/ci/ciObject.cpp
+++ b/src/hotspot/share/ci/ciObject.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciObject.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/share/ci/ciObjectFactory.cpp b/src/hotspot/share/ci/ciObjectFactory.cpp
index bf8e561d1a298..bbda155a2a515 100644
--- a/src/hotspot/share/ci/ciObjectFactory.cpp
+++ b/src/hotspot/share/ci/ciObjectFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciCallSite.hpp"
#include "ci/ciInstance.hpp"
#include "ci/ciInstanceKlass.hpp"
diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp
index c4127263df1cf..1385bb637a99d 100644
--- a/src/hotspot/share/ci/ciReplay.cpp
+++ b/src/hotspot/share/ci/ciReplay.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethodData.hpp"
#include "ci/ciReplay.hpp"
#include "ci/ciSymbol.hpp"
diff --git a/src/hotspot/share/ci/ciSignature.cpp b/src/hotspot/share/ci/ciSignature.cpp
index efa056ef985f2..973e96b93ba2b 100644
--- a/src/hotspot/share/ci/ciSignature.cpp
+++ b/src/hotspot/share/ci/ciSignature.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethodType.hpp"
#include "ci/ciSignature.hpp"
#include "ci/ciStreams.hpp"
diff --git a/src/hotspot/share/ci/ciStreams.cpp b/src/hotspot/share/ci/ciStreams.cpp
index 18d2a46a6862c..259e72a341259 100644
--- a/src/hotspot/share/ci/ciStreams.cpp
+++ b/src/hotspot/share/ci/ciStreams.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciConstant.hpp"
#include "ci/ciField.hpp"
#include "ci/ciKlass.hpp"
diff --git a/src/hotspot/share/ci/ciSymbol.cpp b/src/hotspot/share/ci/ciSymbol.cpp
index 40b23deaa7f9d..c3e2b8d53e4b0 100644
--- a/src/hotspot/share/ci/ciSymbol.cpp
+++ b/src/hotspot/share/ci/ciSymbol.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciSymbol.hpp"
#include "ci/ciSymbols.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciType.cpp b/src/hotspot/share/ci/ciType.cpp
index 05645478086c1..9340f1cda3db2 100644
--- a/src/hotspot/share/ci/ciType.cpp
+++ b/src/hotspot/share/ci/ciType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciEnv.hpp"
#include "ci/ciType.hpp"
#include "ci/ciUtilities.inline.hpp"
diff --git a/src/hotspot/share/ci/ciTypeArray.cpp b/src/hotspot/share/ci/ciTypeArray.cpp
index fb7c2b04646b1..5182cfef53676 100644
--- a/src/hotspot/share/ci/ciTypeArray.cpp
+++ b/src/hotspot/share/ci/ciTypeArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciTypeArray.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "oops/typeArrayOop.inline.hpp"
diff --git a/src/hotspot/share/ci/ciTypeArrayKlass.cpp b/src/hotspot/share/ci/ciTypeArrayKlass.cpp
index 6a5d5faadc6fd..59b687ccb8bc7 100644
--- a/src/hotspot/share/ci/ciTypeArrayKlass.cpp
+++ b/src/hotspot/share/ci/ciTypeArrayKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciTypeArrayKlass.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "memory/universe.hpp"
diff --git a/src/hotspot/share/ci/ciTypeFlow.cpp b/src/hotspot/share/ci/ciTypeFlow.cpp
index 36b4a2991cc9e..3caca6424bc98 100644
--- a/src/hotspot/share/ci/ciTypeFlow.cpp
+++ b/src/hotspot/share/ci/ciTypeFlow.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciConstant.hpp"
#include "ci/ciField.hpp"
#include "ci/ciMethod.hpp"
diff --git a/src/hotspot/share/ci/ciUtilities.cpp b/src/hotspot/share/ci/ciUtilities.cpp
index 931a1c75d605a..1a91ded937142 100644
--- a/src/hotspot/share/ci/ciUtilities.cpp
+++ b/src/hotspot/share/ci/ciUtilities.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciUtilities.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/cardTable.hpp"
diff --git a/src/hotspot/share/classfile/altHashing.cpp b/src/hotspot/share/classfile/altHashing.cpp
index 1d43d6ebf1ed0..1f7a84f745c2b 100644
--- a/src/hotspot/share/classfile/altHashing.cpp
+++ b/src/hotspot/share/classfile/altHashing.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -43,7 +43,6 @@
.
*/
-#include "precompiled.hpp"
#include "classfile/altHashing.hpp"
#include "classfile/vmClasses.hpp"
#include "oops/klass.inline.hpp"
diff --git a/src/hotspot/share/classfile/bytecodeAssembler.cpp b/src/hotspot/share/classfile/bytecodeAssembler.cpp
index e1e54b56e412b..6c34d160042ba 100644
--- a/src/hotspot/share/classfile/bytecodeAssembler.cpp
+++ b/src/hotspot/share/classfile/bytecodeAssembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/bytecodeAssembler.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/share/classfile/classFileError.cpp b/src/hotspot/share/classfile/classFileError.cpp
index 634a1fbeafbae..b0a61e8cbd5d0 100644
--- a/src/hotspot/share/classfile/classFileError.cpp
+++ b/src/hotspot/share/classfile/classFileError.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classFileParser.hpp"
#include "classfile/stackMapTable.hpp"
#include "classfile/verifier.hpp"
diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp
index 5c58f20000616..92d31c48ca814 100644
--- a/src/hotspot/share/classfile/classFileParser.cpp
+++ b/src/hotspot/share/classfile/classFileParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/classFileParser.hpp"
#include "classfile/classFileStream.hpp"
@@ -2127,7 +2126,7 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
// access_flags, name_index, descriptor_index, attributes_count
cfs->guarantee_more(8, CHECK_NULL);
- int flags = cfs->get_u2_fast();
+ u2 flags = cfs->get_u2_fast();
const u2 name_index = cfs->get_u2_fast();
const int cp_size = cp->length();
guarantee_property(
@@ -2981,7 +2980,7 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea
"Class is both outer and inner class in class file %s", CHECK_0);
}
// Access flags
- jint flags;
+ u2 flags;
// JVM_ACC_MODULE is defined in JDK-9 and later.
if (_major_version >= JAVA_9_VERSION) {
flags = cfs->get_u2_fast() & (RECOGNIZED_INNER_CLASS_MODIFIERS | JVM_ACC_MODULE);
@@ -2998,7 +2997,7 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea
inner_classes->at_put(index++, inner_class_info_index);
inner_classes->at_put(index++, outer_class_info_index);
inner_classes->at_put(index++, inner_name_index);
- inner_classes->at_put(index++, inner_access_flags.as_short());
+ inner_classes->at_put(index++, inner_access_flags.as_unsigned_short());
}
// Check for circular and duplicate entries.
@@ -3750,7 +3749,7 @@ void ClassFileParser::apply_parsed_class_metadata(
// Initialize cached modifier_flags to support Class.getModifiers().
// This must follow setting inner_class attributes.
- int computed_modifiers = this_klass->compute_modifier_flags();
+ u2 computed_modifiers = this_klass->compute_modifier_flags();
this_klass->set_modifier_flags(computed_modifiers);
// Delay the setting of _local_interfaces and _transitive_interfaces until after
@@ -5336,7 +5335,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
assert(_stream != nullptr, "invariant");
assert(_stream->buffer() == _stream->current(), "invariant");
assert(_class_name != nullptr, "invariant");
- assert(0 == _access_flags.as_int(), "invariant");
+ assert(0 == _access_flags.as_unsigned_short(), "invariant");
// Figure out whether we can skip format checking (matching classic VM behavior)
_need_verify = Verifier::should_verify_for(_loader_data->class_loader());
@@ -5488,7 +5487,7 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
stream->guarantee_more(8, CHECK); // flags, this_class, super_class, infs_len
// Access flags
- jint flags;
+ u2 flags;
// JVM_ACC_MODULE is defined in JDK-9 and later.
if (_major_version >= JAVA_9_VERSION) {
flags = stream->get_u2_fast() & (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_MODULE);
@@ -5663,7 +5662,7 @@ void ClassFileParser::mangle_hidden_class_name(InstanceKlass* const ik) {
static volatile size_t counter = 0;
Atomic::cmpxchg(&counter, (size_t)0, Arguments::default_SharedBaseAddress()); // initialize it
size_t new_id = Atomic::add(&counter, (size_t)1);
- jio_snprintf(addr_buf, 20, SIZE_FORMAT_X, new_id);
+ jio_snprintf(addr_buf, 20, "0x%zx", new_id);
} else {
jio_snprintf(addr_buf, 20, INTPTR_FORMAT, p2i(ik));
}
diff --git a/src/hotspot/share/classfile/classFileStream.cpp b/src/hotspot/share/classfile/classFileStream.cpp
index a934cbafa45dd..0fc3e5b390c03 100644
--- a/src/hotspot/share/classfile/classFileStream.cpp
+++ b/src/hotspot/share/classfile/classFileStream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp
index 83d0e803ee10e..fa003756685ea 100644
--- a/src/hotspot/share/classfile/classLoader.cpp
+++ b/src/hotspot/share/classfile/classLoader.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cds_globals.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/filemap.hpp"
diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp
index de0b16a907afb..825072cb13bef 100644
--- a/src/hotspot/share/classfile/classLoaderData.cpp
+++ b/src/hotspot/share/classfile/classLoaderData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -46,7 +46,6 @@
// The bootstrap loader (represented by null) also has a ClassLoaderData,
// the singleton class the_null_class_loader_data().
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.inline.hpp"
#include "classfile/dictionary.hpp"
diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.cpp b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
index c7051cd58e7d6..fca6a9e74ad31 100644
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.inline.hpp"
#include "classfile/dictionary.hpp"
diff --git a/src/hotspot/share/classfile/classLoaderDataShared.cpp b/src/hotspot/share/classfile/classLoaderDataShared.cpp
index 8abe469ea2531..16a16b3a16ffe 100644
--- a/src/hotspot/share/classfile/classLoaderDataShared.cpp
+++ b/src/hotspot/share/classfile/classLoaderDataShared.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/serializeClosure.hpp"
#include "classfile/classLoaderData.inline.hpp"
diff --git a/src/hotspot/share/classfile/classLoaderExt.cpp b/src/hotspot/share/classfile/classLoaderExt.cpp
index f7b2906394d54..dc38c84f4c219 100644
--- a/src/hotspot/share/classfile/classLoaderExt.cpp
+++ b/src/hotspot/share/classfile/classLoaderExt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cds_globals.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/dynamicArchive.hpp"
diff --git a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp
index 8a8113db4036d..2eadb813d7eee 100644
--- a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp
+++ b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp
@@ -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.
* Copyright (c) 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
diff --git a/src/hotspot/share/classfile/classLoaderStats.cpp b/src/hotspot/share/classfile/classLoaderStats.cpp
index 5fbd4ce00d922..d74e8c1deba2e 100644
--- a/src/hotspot/share/classfile/classLoaderStats.cpp
+++ b/src/hotspot/share/classfile/classLoaderStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classLoaderStats.hpp"
@@ -112,7 +111,7 @@ bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats const& c
Klass* class_loader_klass = (cls._class_loader == nullptr ? nullptr : cls._class_loader->klass());
Klass* parent_klass = (cls._parent == nullptr ? nullptr : cls._parent->klass());
- _out->print(INTPTR_FORMAT " " INTPTR_FORMAT " " INTPTR_FORMAT " " UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " ",
+ _out->print(INTPTR_FORMAT " " INTPTR_FORMAT " " INTPTR_FORMAT " %6zu %8zu %8zu ",
p2i(class_loader_klass), p2i(parent_klass), p2i(cls._cld),
cls._classes_count,
cls._chunk_sz, cls._block_sz);
@@ -123,7 +122,7 @@ bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats const& c
}
_out->cr();
if (cls._hidden_classes_count > 0) {
- _out->print_cr(SPACE SPACE SPACE " " UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " + hidden classes",
+ _out->print_cr(SPACE SPACE SPACE " %6zu %8zu %8zu + hidden classes",
"", "", "",
cls._hidden_classes_count,
cls._hidden_chunk_sz, cls._hidden_block_sz);
@@ -135,9 +134,9 @@ bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats const& c
void ClassLoaderStatsClosure::print() {
_out->print_cr("ClassLoader" SPACE " Parent" SPACE " CLD*" SPACE " Classes ChunkSz BlockSz Type", "", "", "");
_stats->iterate(this);
- _out->print("Total = " UINTX_FORMAT_W(-6), _total_loaders);
+ _out->print("Total = %-6zu", _total_loaders);
_out->print(SPACE SPACE SPACE " ", "", "", "");
- _out->print_cr(UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " ",
+ _out->print_cr("%6zu %8zu %8zu ",
_total_classes,
_total_chunk_sz,
_total_block_sz);
diff --git a/src/hotspot/share/classfile/classPrinter.cpp b/src/hotspot/share/classfile/classPrinter.cpp
index 45a1eff4aed7b..c4b6a024242e7 100644
--- a/src/hotspot/share/classfile/classPrinter.cpp
+++ b/src/hotspot/share/classfile/classPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classPrinter.hpp"
diff --git a/src/hotspot/share/classfile/compactHashtable.cpp b/src/hotspot/share/classfile/compactHashtable.cpp
index 2df8d47a3f4cb..5a3c6998904db 100644
--- a/src/hotspot/share/classfile/compactHashtable.cpp
+++ b/src/hotspot/share/classfile/compactHashtable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/cds_globals.hpp"
#include "cds/cdsConfig.hpp"
diff --git a/src/hotspot/share/classfile/defaultMethods.cpp b/src/hotspot/share/classfile/defaultMethods.cpp
index 58d24c16ad3d8..75bc33a308307 100644
--- a/src/hotspot/share/classfile/defaultMethods.cpp
+++ b/src/hotspot/share/classfile/defaultMethods.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/bytecodeAssembler.hpp"
#include "classfile/defaultMethods.hpp"
diff --git a/src/hotspot/share/classfile/dictionary.cpp b/src/hotspot/share/classfile/dictionary.cpp
index a6df19ef91598..0f79e7a5a69b5 100644
--- a/src/hotspot/share/classfile/dictionary.cpp
+++ b/src/hotspot/share/classfile/dictionary.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/dictionary.hpp"
@@ -46,7 +45,7 @@ Dictionary::Dictionary(ClassLoaderData* loader_data, size_t table_size)
size_t start_size_log_2 = MAX2(log2i_ceil(table_size), 2); // 2 is minimum size even though some dictionaries only have one entry
size_t current_size = ((size_t)1) << start_size_log_2;
- log_info(class, loader, data)("Dictionary start size: " SIZE_FORMAT " (" SIZE_FORMAT ")",
+ log_info(class, loader, data)("Dictionary start size: %zu (%zu)",
current_size, start_size_log_2);
_table = new ConcurrentTable(start_size_log_2, END_SIZE, REHASH_LEN);
}
diff --git a/src/hotspot/share/classfile/fieldLayoutBuilder.cpp b/src/hotspot/share/classfile/fieldLayoutBuilder.cpp
index f9353465ca7c4..1af9bb8336194 100644
--- a/src/hotspot/share/classfile/fieldLayoutBuilder.cpp
+++ b/src/hotspot/share/classfile/fieldLayoutBuilder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classFileParser.hpp"
#include "classfile/fieldLayoutBuilder.hpp"
#include "jvm.h"
diff --git a/src/hotspot/share/classfile/javaAssertions.cpp b/src/hotspot/share/classfile/javaAssertions.cpp
index cf51bfb21d676..2a8f94d81b95b 100644
--- a/src/hotspot/share/classfile/javaAssertions.cpp
+++ b/src/hotspot/share/classfile/javaAssertions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaAssertions.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/symbolTable.hpp"
diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp
index 1aedb43973c57..4c698170079ba 100644
--- a/src/hotspot/share/classfile/javaClasses.cpp
+++ b/src/hotspot/share/classfile/javaClasses.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.hpp"
#include "cds/cdsConfig.hpp"
@@ -1242,8 +1241,8 @@ void java_lang_Class::fixup_module_field(Klass* k, Handle module) {
void java_lang_Class::set_oop_size(HeapWord* java_class, size_t size) {
assert(_oop_size_offset != 0, "must be set");
- assert(size > 0, "Oop size must be greater than zero, not " SIZE_FORMAT, size);
- assert(size <= INT_MAX, "Lossy conversion: " SIZE_FORMAT, size);
+ assert(size > 0, "Oop size must be greater than zero, not %zu", size);
+ assert(size <= INT_MAX, "Lossy conversion: %zu", size);
*(int*)(((char*)java_class) + _oop_size_offset) = (int)size;
}
@@ -3169,7 +3168,7 @@ void java_lang_ClassFrameInfo::serialize_offsets(SerializeClosure* f) {
#endif
static int get_flags(const methodHandle& m) {
- int flags = (jushort)( m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS );
+ int flags = m->access_flags().as_method_flags();
if (m->is_object_initializer()) {
flags |= java_lang_invoke_MemberName::MN_IS_CONSTRUCTOR;
} else {
@@ -5537,7 +5536,7 @@ int InjectedField::compute_offset() {
ik->print();
tty->print_cr("all fields:");
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
- tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
+ tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_field_flags());
}
#endif //PRODUCT
vm_exit_during_initialization("Invalid layout of well-known class: use -Xlog:class+load=info to see the origin of the problem class");
diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp
index 0d0fa5954b1e7..c75261981cffa 100644
--- a/src/hotspot/share/classfile/javaClasses.hpp
+++ b/src/hotspot/share/classfile/javaClasses.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -321,12 +321,12 @@ class java_lang_Class : AllStatic {
set_init_lock(java_class, nullptr);
}
static oop component_mirror(oop java_class);
+ static int component_mirror_offset() { return _component_mirror_offset; }
static objArrayOop signers(oop java_class);
static oop class_data(oop java_class);
static void set_class_data(oop java_class, oop classData);
static void set_reflection_data(oop java_class, oop reflection_data);
-
- static int component_mirror_offset() { return _component_mirror_offset; }
+ static int reflection_data_offset() { return _reflectionData_offset; }
static oop class_loader(oop java_class);
static void set_module(oop java_class, oop module);
diff --git a/src/hotspot/share/classfile/klassFactory.cpp b/src/hotspot/share/classfile/klassFactory.cpp
index 493fc27dd4308..52da747d8b6e9 100644
--- a/src/hotspot/share/classfile/klassFactory.cpp
+++ b/src/hotspot/share/classfile/klassFactory.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/filemap.hpp"
#include "classfile/classFileParser.hpp"
diff --git a/src/hotspot/share/classfile/loaderConstraints.cpp b/src/hotspot/share/classfile/loaderConstraints.cpp
index 99d0c07ed42d4..21161f443260c 100644
--- a/src/hotspot/share/classfile/loaderConstraints.cpp
+++ b/src/hotspot/share/classfile/loaderConstraints.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/dictionary.hpp"
diff --git a/src/hotspot/share/classfile/metadataOnStackMark.cpp b/src/hotspot/share/classfile/metadataOnStackMark.cpp
index faf1053dd87e8..51ce2c263a357 100644
--- a/src/hotspot/share/classfile/metadataOnStackMark.cpp
+++ b/src/hotspot/share/classfile/metadataOnStackMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/metadataOnStackMark.hpp"
#include "code/codeCache.hpp"
#include "compiler/compileBroker.hpp"
diff --git a/src/hotspot/share/classfile/moduleEntry.cpp b/src/hotspot/share/classfile/moduleEntry.cpp
index 3283e9705b3c4..a0f9afdc98272 100644
--- a/src/hotspot/share/classfile/moduleEntry.cpp
+++ b/src/hotspot/share/classfile/moduleEntry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveUtils.hpp"
#include "cds/cdsConfig.hpp"
@@ -400,7 +399,12 @@ ModuleEntry* ModuleEntry::allocate_archived_entry() const {
assert(is_named(), "unnamed packages/modules are not archived");
ModuleEntry* archived_entry = (ModuleEntry*)ArchiveBuilder::rw_region_alloc(sizeof(ModuleEntry));
memcpy((void*)archived_entry, (void*)this, sizeof(ModuleEntry));
- archived_entry->_archived_module_index = -1;
+
+ if (CDSConfig::is_dumping_full_module_graph()) {
+ archived_entry->_archived_module_index = HeapShared::append_root(module());
+ } else {
+ archived_entry->_archived_module_index = -1;
+ }
if (_archive_modules_entries == nullptr) {
_archive_modules_entries = new (mtClass)ArchivedModuleEntries();
@@ -409,6 +413,14 @@ ModuleEntry* ModuleEntry::allocate_archived_entry() const {
_archive_modules_entries->put(this, archived_entry);
DEBUG_ONLY(_num_archived_module_entries++);
+ assert(archived_entry->shared_protection_domain() == nullptr, "never set during -Xshare:dump");
+ // Clear handles and restore at run time. Handles cannot be archived.
+ OopHandle null_handle;
+ archived_entry->_module = null_handle;
+
+ // For verify_archived_module_entries()
+ DEBUG_ONLY(_num_inited_module_entries++);
+
if (log_is_enabled(Info, cds, module)) {
ResourceMark rm;
LogStream ls(Log(cds, module)::info());
@@ -489,22 +501,6 @@ void ModuleEntry::init_as_archived_entry() {
ArchivePtrMarker::mark_pointer((address*)&_location);
}
-void ModuleEntry::update_oops_in_archived_module(int root_oop_index) {
- assert(CDSConfig::is_dumping_full_module_graph(), "sanity");
- assert(_archived_module_index == -1, "must be set exactly once");
- assert(root_oop_index >= 0, "sanity");
-
- _archived_module_index = root_oop_index;
-
- assert(shared_protection_domain() == nullptr, "never set during -Xshare:dump");
- // Clear handles and restore at run time. Handles cannot be archived.
- OopHandle null_handle;
- _module = null_handle;
-
- // For verify_archived_module_entries()
- DEBUG_ONLY(_num_inited_module_entries++);
-}
-
#ifndef PRODUCT
void ModuleEntry::verify_archived_module_entries() {
assert(_num_archived_module_entries == _num_inited_module_entries,
diff --git a/src/hotspot/share/classfile/modules.cpp b/src/hotspot/share/classfile/modules.cpp
index 7e26febda89f2..950ca699a8e92 100644
--- a/src/hotspot/share/classfile/modules.cpp
+++ b/src/hotspot/share/classfile/modules.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp"
@@ -483,9 +482,7 @@ static bool _seen_platform_unnamed_module = false;
static bool _seen_system_unnamed_module = false;
// Validate the states of an java.lang.Module oop to be archived.
-//
-// Returns true iff the oop has an archived ModuleEntry.
-bool Modules::check_archived_module_oop(oop orig_module_obj) {
+void Modules::check_archived_module_oop(oop orig_module_obj) {
assert(CDSConfig::is_dumping_full_module_graph(), "must be");
assert(java_lang_Module::is_instance(orig_module_obj), "must be");
@@ -498,7 +495,6 @@ bool Modules::check_archived_module_oop(oop orig_module_obj) {
// jdk.internal.loader.ClassLoaders$BootClassLoader::unnamedModule
log_info(cds, module)("Archived java.lang.Module oop " PTR_FORMAT " with no ModuleEntry*", p2i(orig_module_obj));
assert(java_lang_Module::name(orig_module_obj) == nullptr, "must be unnamed");
- return false;
} else {
// This java.lang.Module oop has an ModuleEntry*. Check if the latter is archived.
if (log_is_enabled(Info, cds, module)) {
@@ -516,7 +512,6 @@ bool Modules::check_archived_module_oop(oop orig_module_obj) {
if (orig_module_ent->name() != nullptr) {
// For each named module, we archive both the java.lang.Module oop and the ModuleEntry.
assert(orig_module_ent->has_been_archived(), "sanity");
- return true;
} else {
// We only archive two unnamed module oops (for platform and system loaders). These do NOT have an archived
// ModuleEntry.
@@ -538,24 +533,10 @@ bool Modules::check_archived_module_oop(oop orig_module_obj) {
// not in the archived module graph. These are always allocated at runtime.
ShouldNotReachHere();
}
- return false;
}
}
}
-void Modules::update_oops_in_archived_module(oop orig_module_obj, int archived_module_root_index) {
- // This java.lang.Module oop must have an archived ModuleEntry
- assert(check_archived_module_oop(orig_module_obj) == true, "sanity");
-
- // We remember the oop inside the ModuleEntry::_archived_module_index. At runtime, we use
- // this index to reinitialize the ModuleEntry inside ModuleEntry::restore_archived_oops().
- //
- // ModuleEntry::verify_archived_module_entries(), called below, ensures that every archived
- // ModuleEntry has been assigned an _archived_module_index.
- ModuleEntry* orig_module_ent = java_lang_Module::module_entry_raw(orig_module_obj);
- ModuleEntry::get_archived_entry(orig_module_ent)->update_oops_in_archived_module(archived_module_root_index);
-}
-
void Modules::verify_archived_modules() {
ModuleEntry::verify_archived_module_entries();
}
@@ -628,12 +609,14 @@ void Modules::serialize(SerializeClosure* soc) {
}
void Modules::dump_native_access_flag() {
+ ResourceMark rm;
const char* native_access_names = get_native_access_flags_as_sorted_string();
if (native_access_names != nullptr) {
_archived_native_access_flags = ArchiveBuilder::current()->ro_strdup(native_access_names);
}
}
+// Caller needs ResourceMark
const char* Modules::get_native_access_flags_as_sorted_string() {
return get_numbered_property_as_sorted_string("jdk.module.enable.native.access");
}
@@ -641,6 +624,7 @@ const char* Modules::get_native_access_flags_as_sorted_string() {
void Modules::serialize_native_access_flags(SerializeClosure* soc) {
soc->do_ptr(&_archived_native_access_flags);
if (soc->reading()) {
+ ResourceMark rm;
check_archived_flag_consistency(_archived_native_access_flags, get_native_access_flags_as_sorted_string(), "jdk.module.enable.native.access");
// Don't hold onto the pointer, in case we might decide to unmap the archive.
@@ -649,12 +633,14 @@ void Modules::serialize_native_access_flags(SerializeClosure* soc) {
}
void Modules::dump_addmods_names() {
+ ResourceMark rm;
const char* addmods_names = get_addmods_names_as_sorted_string();
if (addmods_names != nullptr) {
_archived_addmods_names = ArchiveBuilder::current()->ro_strdup(addmods_names);
}
}
+// Caller needs ResourceMark
const char* Modules::get_addmods_names_as_sorted_string() {
return get_numbered_property_as_sorted_string("jdk.module.addmods");
}
@@ -662,6 +648,7 @@ const char* Modules::get_addmods_names_as_sorted_string() {
void Modules::serialize_addmods_names(SerializeClosure* soc) {
soc->do_ptr(&_archived_addmods_names);
if (soc->reading()) {
+ ResourceMark rm;
check_archived_flag_consistency(_archived_addmods_names, get_addmods_names_as_sorted_string(), "jdk.module.addmods");
// Don't hold onto the pointer, in case we might decide to unmap the archive.
@@ -669,8 +656,8 @@ void Modules::serialize_addmods_names(SerializeClosure* soc) {
}
}
+// Caller needs ResourceMark
const char* Modules::get_numbered_property_as_sorted_string(const char* property) {
- ResourceMark rm;
// theoretical string size limit for decimal int, but the following loop will end much sooner due to
// OS command-line size limit.
const int max_digits = 10;
@@ -723,7 +710,7 @@ const char* Modules::get_numbered_property_as_sorted_string(const char* property
}
}
- return (st.size() > 0) ? os::strdup(st.as_string()) : nullptr; // Example: "java.base,java.compiler"
+ return (st.size() > 0) ? st.as_string() : nullptr; // Example: "java.base,java.compiler"
}
void Modules::define_archived_modules(Handle h_platform_loader, Handle h_system_loader, TRAPS) {
diff --git a/src/hotspot/share/classfile/modules.hpp b/src/hotspot/share/classfile/modules.hpp
index 03069bd345209..2c23ab5f6ea65 100644
--- a/src/hotspot/share/classfile/modules.hpp
+++ b/src/hotspot/share/classfile/modules.hpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 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
@@ -53,9 +53,7 @@ class Modules : AllStatic {
static void define_module(Handle module, jboolean is_open, jstring version,
jstring location, jobjectArray packages, TRAPS);
- static bool check_archived_module_oop(oop orig_module_obj) NOT_CDS_JAVA_HEAP_RETURN_(false);
- static void update_oops_in_archived_module(oop orig_module_obj, int archived_module_root_index)
- NOT_CDS_JAVA_HEAP_RETURN;
+ static void check_archived_module_oop(oop orig_module_obj) NOT_CDS_JAVA_HEAP_RETURN;
static void define_archived_modules(Handle h_platform_loader, Handle h_system_loader,
TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
static void verify_archived_modules() NOT_CDS_JAVA_HEAP_RETURN;
diff --git a/src/hotspot/share/classfile/packageEntry.cpp b/src/hotspot/share/classfile/packageEntry.cpp
index 052960e1735dd..eaa311c4bd386 100644
--- a/src/hotspot/share/classfile/packageEntry.cpp
+++ b/src/hotspot/share/classfile/packageEntry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveUtils.hpp"
#include "cds/cdsConfig.hpp"
diff --git a/src/hotspot/share/classfile/placeholders.cpp b/src/hotspot/share/classfile/placeholders.cpp
index 38d359efcc245..6ee421fa023e9 100644
--- a/src/hotspot/share/classfile/placeholders.cpp
+++ b/src/hotspot/share/classfile/placeholders.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/placeholders.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/classfile/resolutionErrors.cpp b/src/hotspot/share/classfile/resolutionErrors.cpp
index 1f2e75e92571f..03af71bc26f71 100644
--- a/src/hotspot/share/classfile/resolutionErrors.cpp
+++ b/src/hotspot/share/classfile/resolutionErrors.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/resolutionErrors.hpp"
#include "memory/allocation.hpp"
#include "oops/constantPool.hpp"
diff --git a/src/hotspot/share/classfile/stackMapFrame.cpp b/src/hotspot/share/classfile/stackMapFrame.cpp
index d9a5fa5ce93cf..c71a278e0b8d0 100644
--- a/src/hotspot/share/classfile/stackMapFrame.cpp
+++ b/src/hotspot/share/classfile/stackMapFrame.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/stackMapFrame.hpp"
#include "classfile/verifier.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/share/classfile/stackMapTable.cpp b/src/hotspot/share/classfile/stackMapTable.cpp
index fa2a57f96b473..b66416ff1bf7f 100644
--- a/src/hotspot/share/classfile/stackMapTable.cpp
+++ b/src/hotspot/share/classfile/stackMapTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/stackMapTable.hpp"
#include "classfile/verifier.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/classfile/stringTable.cpp b/src/hotspot/share/classfile/stringTable.cpp
index d6aedcbb157fb..7aa6f044bd585 100644
--- a/src/hotspot/share/classfile/stringTable.cpp
+++ b/src/hotspot/share/classfile/stringTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.inline.hpp"
#include "cds/archiveHeapWriter.hpp"
@@ -311,7 +310,7 @@ class StringTableLookupOop : public StringTableLookup {
void StringTable::create_table() {
size_t start_size_log_2 = log2i_ceil(StringTableSize);
_current_size = ((size_t)1) << start_size_log_2;
- log_trace(stringtable)("Start size: " SIZE_FORMAT " (" SIZE_FORMAT ")",
+ log_trace(stringtable)("Start size: %zu (%zu)",
_current_size, start_size_log_2);
_local_table = new StringTableHash(start_size_log_2, END_SIZE, REHASH_LEN, true);
_oop_storage = OopStorageSet::create_weak("StringTable Weak", mtSymbol);
@@ -582,7 +581,7 @@ void StringTable::grow(JavaThread* jt) {
}
gt.done(jt);
_current_size = table_size();
- log_debug(stringtable)("Grown to size:" SIZE_FORMAT, _current_size);
+ log_debug(stringtable)("Grown to size:%zu", _current_size);
}
struct StringTableDoDelete : StackObj {
@@ -631,7 +630,7 @@ void StringTable::clean_dead_entries(JavaThread* jt) {
}
void StringTable::gc_notification(size_t num_dead) {
- log_trace(stringtable)("Uncleaned items:" SIZE_FORMAT, num_dead);
+ log_trace(stringtable)("Uncleaned items:%zu", num_dead);
if (has_work()) {
return;
@@ -1012,20 +1011,14 @@ void StringTable::verify_secondary_array_index_bits() {
// For each shared string:
// [1] Store it into _shared_strings_array. Encode its position as a 32-bit index.
// [2] Store the index and hashcode into _shared_table.
-oop StringTable::init_shared_table(const DumpedInternedStrings* dumped_interned_strings) {
+oop StringTable::init_shared_strings_array(const DumpedInternedStrings* dumped_interned_strings) {
assert(HeapShared::can_write(), "must be");
objArrayOop array = (objArrayOop)(_shared_strings_array.resolve());
verify_secondary_array_index_bits();
- _shared_table.reset();
- CompactHashtableWriter writer((int)_items_count, ArchiveBuilder::string_stats());
-
int index = 0;
auto copy_into_array = [&] (oop string, bool value_ignored) {
- unsigned int hash = java_lang_String::hash_code(string);
- writer.add(hash, index);
-
if (!_is_two_dimensional_shared_strings_array) {
assert(index < array->length(), "no strings should have been added");
array->obj_at_put(index, string);
@@ -1045,11 +1038,24 @@ oop StringTable::init_shared_table(const DumpedInternedStrings* dumped_interned_
};
dumped_interned_strings->iterate_all(copy_into_array);
- writer.dump(&_shared_table, "string");
-
return array;
}
+void StringTable::write_shared_table(const DumpedInternedStrings* dumped_interned_strings) {
+ _shared_table.reset();
+ CompactHashtableWriter writer((int)_items_count, ArchiveBuilder::string_stats());
+
+ int index = 0;
+ auto copy_into_shared_table = [&] (oop string, bool value_ignored) {
+ unsigned int hash = java_lang_String::hash_code(string);
+ writer.add(hash, index);
+ index ++;
+ };
+ dumped_interned_strings->iterate_all(copy_into_shared_table);
+
+ writer.dump(&_shared_table, "string");
+}
+
void StringTable::set_shared_strings_array_index(int root_index) {
_shared_strings_array_root_index = root_index;
}
diff --git a/src/hotspot/share/classfile/stringTable.hpp b/src/hotspot/share/classfile/stringTable.hpp
index 38abb9c875c8d..0d58e09f2083a 100644
--- a/src/hotspot/share/classfile/stringTable.hpp
+++ b/src/hotspot/share/classfile/stringTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -148,7 +148,8 @@ class StringTable : AllStatic {
static oop lookup_shared(const jchar* name, int len) NOT_CDS_JAVA_HEAP_RETURN_(nullptr);
static size_t shared_entry_count() NOT_CDS_JAVA_HEAP_RETURN_(0);
static void allocate_shared_strings_array(TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
- static oop init_shared_table(const DumpedInternedStrings* dumped_interned_strings) NOT_CDS_JAVA_HEAP_RETURN_(nullptr);
+ static oop init_shared_strings_array(const DumpedInternedStrings* dumped_interned_strings) NOT_CDS_JAVA_HEAP_RETURN_(nullptr);
+ static void write_shared_table(const DumpedInternedStrings* dumped_interned_strings) NOT_CDS_JAVA_HEAP_RETURN;
static void set_shared_strings_array_index(int root_index) NOT_CDS_JAVA_HEAP_RETURN;
static void serialize_shared_table_header(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp
index 040ba4795e45a..84c0a5a39dee0 100644
--- a/src/hotspot/share/classfile/symbolTable.cpp
+++ b/src/hotspot/share/classfile/symbolTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/dynamicArchive.hpp"
@@ -214,7 +213,7 @@ class SymbolTableConfig : public AllStatic {
void SymbolTable::create_table () {
size_t start_size_log_2 = log2i_ceil(SymbolTableSize);
_current_size = ((size_t)1) << start_size_log_2;
- log_trace(symboltable)("Start size: " SIZE_FORMAT " (" SIZE_FORMAT ")",
+ log_trace(symboltable)("Start size: %zu (%zu)",
_current_size, start_size_log_2);
_local_table = new SymbolTableHash(start_size_log_2, END_SIZE, REHASH_LEN, true);
@@ -749,7 +748,7 @@ void SymbolTable::grow(JavaThread* jt) {
}
gt.done(jt);
_current_size = table_size();
- log_debug(symboltable)("Grown to size:" SIZE_FORMAT, _current_size);
+ log_debug(symboltable)("Grown to size:%zu", _current_size);
}
struct SymbolTableDoDelete : StackObj {
@@ -798,7 +797,7 @@ void SymbolTable::clean_dead_entries(JavaThread* jt) {
Atomic::add(&_symbols_counted, stdc._processed);
- log_debug(symboltable)("Cleaned " SIZE_FORMAT " of " SIZE_FORMAT,
+ log_debug(symboltable)("Cleaned %zu of %zu",
stdd._deleted, stdc._processed);
}
@@ -931,29 +930,29 @@ void SymbolTable::print_histogram() {
HistogramIterator hi;
_local_table->do_scan(Thread::current(), hi);
tty->print_cr("Symbol Table Histogram:");
- tty->print_cr(" Total number of symbols " SIZE_FORMAT_W(7), hi.total_count);
- tty->print_cr(" Total size in memory " SIZE_FORMAT_W(7) "K", (hi.total_size * wordSize) / K);
- tty->print_cr(" Total counted " SIZE_FORMAT_W(7), _symbols_counted);
- tty->print_cr(" Total removed " SIZE_FORMAT_W(7), _symbols_removed);
+ tty->print_cr(" Total number of symbols %7zu", hi.total_count);
+ tty->print_cr(" Total size in memory %7zuK", (hi.total_size * wordSize) / K);
+ tty->print_cr(" Total counted %7zu", _symbols_counted);
+ tty->print_cr(" Total removed %7zu", _symbols_removed);
if (_symbols_counted > 0) {
tty->print_cr(" Percent removed %3.2f",
((double)_symbols_removed / (double)_symbols_counted) * 100);
}
- tty->print_cr(" Reference counts " SIZE_FORMAT_W(7), Symbol::_total_count);
- tty->print_cr(" Symbol arena used " SIZE_FORMAT_W(7) "K", arena()->used() / K);
- tty->print_cr(" Symbol arena size " SIZE_FORMAT_W(7) "K", arena()->size_in_bytes() / K);
- tty->print_cr(" Total symbol length " SIZE_FORMAT_W(7), hi.total_length);
- tty->print_cr(" Maximum symbol length " SIZE_FORMAT_W(7), hi.max_length);
+ tty->print_cr(" Reference counts %7zu", Symbol::_total_count);
+ tty->print_cr(" Symbol arena used %7zuK", arena()->used() / K);
+ tty->print_cr(" Symbol arena size %7zuK", arena()->size_in_bytes() / K);
+ tty->print_cr(" Total symbol length %7zu", hi.total_length);
+ tty->print_cr(" Maximum symbol length %7zu", hi.max_length);
tty->print_cr(" Average symbol length %7.2f", ((double)hi.total_length / (double)hi.total_count));
tty->print_cr(" Symbol length histogram:");
tty->print_cr(" %6s %10s %10s", "Length", "#Symbols", "Size");
for (size_t i = 0; i < hi.results_length; i++) {
if (hi.counts[i] > 0) {
- tty->print_cr(" " SIZE_FORMAT_W(6) " " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) "K",
+ tty->print_cr(" %6zu %10zu %10zuK",
i, hi.counts[i], (hi.sizes[i] * wordSize) / K);
}
}
- tty->print_cr(" >=" SIZE_FORMAT_W(6) " " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) "K\n",
+ tty->print_cr(" >= %6zu %10zu %10zuK\n",
hi.results_length, hi.out_of_range_count, (hi.out_of_range_size*wordSize) / K);
}
#endif // PRODUCT
diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index 0cd9886bd0160..b51cfc03e7835 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/heapShared.hpp"
#include "classfile/classFileParser.hpp"
diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp
index 180ba73e68144..28fd53eedcd7f 100644
--- a/src/hotspot/share/classfile/systemDictionaryShared.cpp
+++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveBuilder.hpp"
#include "cds/archiveHeapLoader.hpp"
#include "cds/archiveUtils.hpp"
@@ -205,15 +204,6 @@ DumpTimeClassInfo* SystemDictionaryShared::get_info_locked(InstanceKlass* k) {
return info;
}
-void SystemDictionaryShared::mark_required_hidden_class(InstanceKlass* k) {
- assert(k->is_hidden(), "sanity");
- DumpTimeClassInfo* info = _dumptime_table->get(k);
- ResourceMark rm;
- if (info != nullptr) {
- info->set_is_required_hidden_class();
- }
-}
-
bool SystemDictionaryShared::check_for_exclusion(InstanceKlass* k, DumpTimeClassInfo* info) {
if (MetaspaceShared::is_in_shared_metaspace(k)) {
// We have reached a super type that's already in the base archive. Treat it
@@ -256,13 +246,17 @@ bool SystemDictionaryShared::is_jfr_event_class(InstanceKlass *k) {
bool SystemDictionaryShared::is_registered_lambda_proxy_class(InstanceKlass* ik) {
DumpTimeClassInfo* info = _dumptime_table->get(ik);
- return (info != nullptr) ? info->_is_archived_lambda_proxy : false;
+ bool result = (info != nullptr) ? info->_is_registered_lambda_proxy : false;
+ if (result) {
+ assert(!CDSConfig::is_dumping_invokedynamic(), "only used in legacy lambda proxy support");
+ }
+ return result;
}
void SystemDictionaryShared::reset_registered_lambda_proxy_class(InstanceKlass* ik) {
DumpTimeClassInfo* info = _dumptime_table->get(ik);
if (info != nullptr) {
- info->_is_archived_lambda_proxy = false;
+ info->_is_registered_lambda_proxy = false;
info->set_excluded();
}
}
@@ -340,11 +334,6 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
}
}
- if (k->is_hidden() && !should_hidden_class_be_archived(k)) {
- log_info(cds)("Skipping %s: Hidden class", k->name()->as_C_string());
- return true;
- }
-
InstanceKlass* super = k->java_super();
if (super != nullptr && check_for_exclusion(super, nullptr)) {
ResourceMark rm;
@@ -601,9 +590,7 @@ void SystemDictionaryShared::validate_before_archiving(InstanceKlass* k) {
guarantee(!info->is_excluded(), "Should not attempt to archive excluded class %s", name);
if (is_builtin(k)) {
if (k->is_hidden()) {
- if (CDSConfig::is_dumping_invokedynamic()) {
- assert(should_hidden_class_be_archived(k), "unexpected hidden class %s", name);
- } else {
+ if (!CDSConfig::is_dumping_invokedynamic()) {
assert(is_registered_lambda_proxy_class(k), "unexpected hidden class %s", name);
}
}
@@ -657,29 +644,6 @@ class UnregisteredClassesDuplicationChecker : StackObj {
}
};
-void SystemDictionaryShared::scan_constant_pool(InstanceKlass* k) {
- if (CDSConfig::is_dumping_invokedynamic()) {
- k->constants()->find_required_hidden_classes();
- }
-}
-
-bool SystemDictionaryShared::should_hidden_class_be_archived(InstanceKlass* k) {
- assert(k->is_hidden(), "sanity");
- if (is_registered_lambda_proxy_class(k)) {
- return true;
- }
-
- if (CDSConfig::is_dumping_invokedynamic()) {
- DumpTimeClassInfo* info = _dumptime_table->get(k);
- if (info != nullptr && info->is_required_hidden_class()) {
- guarantee(HeapShared::is_archivable_hidden_klass(k), "required hidden class must be archivable");
- return true;
- }
- }
-
- return false;
-}
-
// Returns true if the class should be excluded. This can be called by
// AOTConstantPoolResolver before or after we enter the CDS safepoint.
// When called before the safepoint, we need to link the class so that
@@ -729,24 +693,7 @@ bool SystemDictionaryShared::should_be_excluded(Klass* k) {
}
}
-void SystemDictionaryShared::find_all_archivable_classes() {
- HeapShared::start_finding_required_hidden_classes();
- find_all_archivable_classes_impl();
- HeapShared::end_finding_required_hidden_classes();
-}
-
-// Iterate over all the classes in _dumptime_table, marking the ones that must be
-// excluded from the archive. Those that are not excluded will be archivable.
-//
-// (a) Non-hidden classes are easy. They are only check by the rules in
-// SystemDictionaryShared::check_for_exclusion().
-// (b) For hidden classes, we only archive those that are required (i.e., they are
-// referenced by Java objects (such as CallSites) that are reachable from
-// ConstantPools). This needs help from HeapShared.
-void SystemDictionaryShared::find_all_archivable_classes_impl() {
- assert(!class_loading_may_happen(), "class loading must be disabled");
- assert_lock_strong(DumpTimeTable_lock);
-
+void SystemDictionaryShared::finish_exclusion_checks() {
if (CDSConfig::is_dumping_dynamic_archive()) {
// Do this first -- if a base class is excluded due to duplication,
// all of its subclasses will also be excluded.
@@ -756,58 +703,11 @@ void SystemDictionaryShared::find_all_archivable_classes_impl() {
dup_checker.mark_duplicated_classes();
}
- ResourceMark rm;
+ _dumptime_table->iterate_all_live_classes([&] (InstanceKlass* k, DumpTimeClassInfo& info) {
+ SystemDictionaryShared::check_for_exclusion(k, &info);
+ });
- // First, scan all non-hidden classes
- auto check_non_hidden = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
- if (!k->is_hidden()) {
- SystemDictionaryShared::check_for_exclusion(k, &info);
- if (!info.is_excluded() && !info.has_scanned_constant_pool()) {
- scan_constant_pool(k);
- info.set_has_scanned_constant_pool();
- }
- }
- };
- _dumptime_table->iterate_all_live_classes(check_non_hidden);
-
- // Then, scan all the hidden classes that have been marked as required to
- // discover more hidden classes. Stop when we cannot make progress anymore.
- bool made_progress;
- do {
- made_progress = false;
- auto check_hidden = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
- if (k->is_hidden() && should_hidden_class_be_archived(k)) {
- SystemDictionaryShared::check_for_exclusion(k, &info);
- if (info.is_excluded()) {
- guarantee(!info.is_required_hidden_class(), "A required hidden class cannot be marked as excluded");
- } else if (!info.has_scanned_constant_pool()) {
- scan_constant_pool(k);
- info.set_has_scanned_constant_pool();
- // The CP entries in k *MAY* refer to other hidden classes, so scan
- // every hidden class again.
- made_progress = true;
- }
- }
- };
- _dumptime_table->iterate_all_live_classes(check_hidden);
- } while (made_progress);
-
- // Now, all hidden classes that have not yet been scanned must be marked as excluded
- auto exclude_remaining_hidden = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
- if (k->is_hidden()) {
- SystemDictionaryShared::check_for_exclusion(k, &info);
- if (CDSConfig::is_dumping_invokedynamic()) {
- if (should_hidden_class_be_archived(k)) {
- guarantee(!info.is_excluded(), "Must be");
- } else {
- guarantee(info.is_excluded(), "Must be");
- }
- }
- }
- };
- _dumptime_table->iterate_all_live_classes(exclude_remaining_hidden);
_dumptime_table->update_counts();
-
cleanup_lambda_proxy_class_dictionary();
}
@@ -936,9 +836,9 @@ void SystemDictionaryShared::add_lambda_proxy_class(InstanceKlass* caller_ik,
if (info != nullptr && !lambda_ik->is_non_strong_hidden() && is_builtin(lambda_ik) && is_builtin(caller_ik)
// Don't include the lambda proxy if its nest host is not in the "linked" state.
&& nest_host->is_linked()) {
- // Set _is_archived_lambda_proxy in DumpTimeClassInfo so that the lambda_ik
- // won't be excluded during dumping of shared archive. See ExcludeDumpTimeSharedClasses.
- info->_is_archived_lambda_proxy = true;
+ // Set _is_registered_lambda_proxy in DumpTimeClassInfo so that the lambda_ik
+ // won't be excluded during dumping of shared archive.
+ info->_is_registered_lambda_proxy = true;
info->set_nest_host(nest_host);
LambdaProxyClassKey key(caller_ik,
@@ -1347,13 +1247,6 @@ class CopyLambdaProxyClassInfoToArchive : StackObj {
bool do_entry(LambdaProxyClassKey& key, DumpTimeLambdaProxyClassInfo& info) {
// In static dump, info._proxy_klasses->at(0) is already relocated to point to the archived class
// (not the original class).
- //
- // The following check has been moved to SystemDictionaryShared::find_all_archivable_classes(), which
- // happens before the classes are copied.
- //
- // if (SystemDictionaryShared::is_excluded_class(info._proxy_klasses->at(0))) {
- // return true;
- //}
ResourceMark rm;
log_info(cds,dynamic)("Archiving hidden %s", info._proxy_klasses->at(0)->external_name());
size_t byte_size = sizeof(RunTimeLambdaProxyClassInfo);
diff --git a/src/hotspot/share/classfile/systemDictionaryShared.hpp b/src/hotspot/share/classfile/systemDictionaryShared.hpp
index 5e0c54a6ffcc7..41e3d9c971667 100644
--- a/src/hotspot/share/classfile/systemDictionaryShared.hpp
+++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -137,7 +137,6 @@ class SharedClassLoadingMark {
};
class SystemDictionaryShared: public SystemDictionary {
- friend class ExcludeDumpTimeSharedClasses;
friend class CleanupDumpTimeLambdaProxyClassTable;
struct ArchiveInfo {
@@ -188,24 +187,20 @@ class SystemDictionaryShared: public SystemDictionary {
static DumpTimeClassInfo* get_info(InstanceKlass* k);
static DumpTimeClassInfo* get_info_locked(InstanceKlass* k);
- static void find_all_archivable_classes_impl();
static void write_dictionary(RunTimeSharedDictionary* dictionary,
bool is_builtin);
static void write_lambda_proxy_class_dictionary(LambdaProxyClassDictionary* dictionary);
static void cleanup_lambda_proxy_class_dictionary();
static void reset_registered_lambda_proxy_class(InstanceKlass* ik);
static bool is_jfr_event_class(InstanceKlass *k);
- static bool is_registered_lambda_proxy_class(InstanceKlass* ik);
static bool check_for_exclusion_impl(InstanceKlass* k);
static void remove_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
static bool has_been_redefined(InstanceKlass* k);
static InstanceKlass* retrieve_lambda_proxy_class(const RunTimeLambdaProxyClassInfo* info) NOT_CDS_RETURN_(nullptr);
- static void scan_constant_pool(InstanceKlass* k);
DEBUG_ONLY(static bool _class_loading_may_happen;)
public:
- static bool should_hidden_class_be_archived(InstanceKlass* k);
- static void mark_required_hidden_class(InstanceKlass* k);
+ static bool is_registered_lambda_proxy_class(InstanceKlass* ik);
static bool is_hidden_lambda_proxy(InstanceKlass* ik);
static bool is_early_klass(InstanceKlass* k); // Was k loaded while JvmtiExport::is_early_phase()==true
static bool has_archived_enum_objs(InstanceKlass* ik);
@@ -291,7 +286,9 @@ class SystemDictionaryShared: public SystemDictionary {
}
static bool add_unregistered_class(Thread* current, InstanceKlass* k);
- static void find_all_archivable_classes();
+ static void finish_exclusion_checks();
+ static DumpTimeSharedClassTable* dumptime_table() { return _dumptime_table; }
+
static bool should_be_excluded(Klass* k);
static bool check_for_exclusion(InstanceKlass* k, DumpTimeClassInfo* info);
static void validate_before_archiving(InstanceKlass* k);
diff --git a/src/hotspot/share/classfile/verificationType.cpp b/src/hotspot/share/classfile/verificationType.cpp
index ddeee499814f8..d0541a0d20f93 100644
--- a/src/hotspot/share/classfile/verificationType.cpp
+++ b/src/hotspot/share/classfile/verificationType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp
index 0ac2cc350b18d..95e5f55c17229 100644
--- a/src/hotspot/share/classfile/verifier.cpp
+++ b/src/hotspot/share/classfile/verifier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoader.hpp"
diff --git a/src/hotspot/share/classfile/vmClasses.cpp b/src/hotspot/share/classfile/vmClasses.cpp
index 553864ef0b991..ac359d4cacbf3 100644
--- a/src/hotspot/share/classfile/vmClasses.cpp
+++ b/src/hotspot/share/classfile/vmClasses.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/aotLinkedClassBulkLoader.hpp"
#include "cds/archiveHeapLoader.hpp"
#include "cds/cdsConfig.hpp"
diff --git a/src/hotspot/share/classfile/vmIntrinsics.cpp b/src/hotspot/share/classfile/vmIntrinsics.cpp
index 407cdafaf2017..4357e44e18761 100644
--- a/src/hotspot/share/classfile/vmIntrinsics.cpp
+++ b/src/hotspot/share/classfile/vmIntrinsics.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmIntrinsics.hpp"
#include "classfile/vmSymbols.hpp"
#include "compiler/compilerDirectives.hpp"
@@ -36,31 +35,31 @@
#include "utilities/tribool.hpp"
// These are flag-matching functions:
-inline bool match_F_R(jshort flags) {
+inline bool match_F_R(u2 flags) {
const int req = 0;
const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED | JVM_ACC_NATIVE;
return (flags & (req | neg)) == req;
}
-inline bool match_F_Y(jshort flags) {
+inline bool match_F_Y(u2 flags) {
const int req = JVM_ACC_SYNCHRONIZED;
const int neg = JVM_ACC_STATIC | JVM_ACC_NATIVE;
return (flags & (req | neg)) == req;
}
-inline bool match_F_RN(jshort flags) {
+inline bool match_F_RN(u2 flags) {
const int req = JVM_ACC_NATIVE;
const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED;
return (flags & (req | neg)) == req;
}
-inline bool match_F_S(jshort flags) {
+inline bool match_F_S(u2 flags) {
const int req = JVM_ACC_STATIC;
const int neg = JVM_ACC_SYNCHRONIZED | JVM_ACC_NATIVE;
return (flags & (req | neg)) == req;
}
-inline bool match_F_SN(jshort flags) {
+inline bool match_F_SN(u2 flags) {
const int req = JVM_ACC_STATIC | JVM_ACC_NATIVE;
const int neg = JVM_ACC_SYNCHRONIZED;
return (flags & (req | neg)) == req;
@@ -711,7 +710,7 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
vmIntrinsics::ID vmIntrinsics::find_id_impl(vmSymbolID holder,
vmSymbolID name,
vmSymbolID sig,
- jshort flags) {
+ u2 flags) {
assert((int)vmSymbolID::SID_LIMIT <= (1<* CodeCache::_allocable_heaps = new(mtCode) GrowableArra
static void check_min_size(const char* codeheap, size_t size, size_t required_size) {
if (size < required_size) {
- log_debug(codecache)("Code heap (%s) size " SIZE_FORMAT "K below required minimal size " SIZE_FORMAT "K",
+ log_debug(codecache)("Code heap (%s) size %zuK below required minimal size %zuK",
codeheap, size/K, required_size/K);
err_msg title("Not enough space in %s to run VM", codeheap);
- err_msg message(SIZE_FORMAT "K < " SIZE_FORMAT "K", size/K, required_size/K);
+ err_msg message("%zuK < %zuK", size/K, required_size/K);
vm_exit_during_initialization(title, message);
}
}
@@ -206,7 +205,7 @@ void CodeCache::initialize_heaps() {
const bool cache_size_set = FLAG_IS_CMDLINE(ReservedCodeCacheSize);
const size_t ps = page_size(false, 8);
const size_t min_size = MAX2(os::vm_allocation_granularity(), ps);
- const size_t min_cache_size = CompilerConfig::min_code_cache_size(); // Make sure we have enough space for VM internal code
+ const size_t min_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3); // Make sure we have enough space for VM internal code
size_t cache_size = align_up(ReservedCodeCacheSize, min_size);
// Prerequisites
@@ -256,15 +255,15 @@ void CodeCache::initialize_heaps() {
size_t total = non_nmethod.size + profiled.size + non_profiled.size;
if (total != cache_size && !cache_size_set) {
- log_info(codecache)("ReservedCodeCache size " SIZE_FORMAT "K changed to total segments size NonNMethod "
- SIZE_FORMAT "K NonProfiled " SIZE_FORMAT "K Profiled " SIZE_FORMAT "K = " SIZE_FORMAT "K",
+ log_info(codecache)("ReservedCodeCache size %zuK changed to total segments size NonNMethod "
+ "%zuK NonProfiled %zuK Profiled %zuK = %zuK",
cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K, total/K);
// Adjust ReservedCodeCacheSize as necessary because it was not set explicitly
cache_size = total;
}
- log_debug(codecache)("Initializing code heaps ReservedCodeCache " SIZE_FORMAT "K NonNMethod " SIZE_FORMAT "K"
- " NonProfiled " SIZE_FORMAT "K Profiled " SIZE_FORMAT "K",
+ log_debug(codecache)("Initializing code heaps ReservedCodeCache %zuK NonNMethod %zuK"
+ " NonProfiled %zuK Profiled %zuK",
cache_size/K, non_nmethod.size/K, non_profiled.size/K, profiled.size/K);
// Validation
@@ -282,16 +281,16 @@ void CodeCache::initialize_heaps() {
// ReservedCodeCacheSize was set explicitly, so report an error and abort if it doesn't match the segment sizes
if (total != cache_size && cache_size_set) {
- err_msg message("NonNMethodCodeHeapSize (" SIZE_FORMAT "K)", non_nmethod.size/K);
+ err_msg message("NonNMethodCodeHeapSize (%zuK)", non_nmethod.size/K);
if (profiled.enabled) {
- message.append(" + ProfiledCodeHeapSize (" SIZE_FORMAT "K)", profiled.size/K);
+ message.append(" + ProfiledCodeHeapSize (%zuK)", profiled.size/K);
}
if (non_profiled.enabled) {
- message.append(" + NonProfiledCodeHeapSize (" SIZE_FORMAT "K)", non_profiled.size/K);
+ message.append(" + NonProfiledCodeHeapSize (%zuK)", non_profiled.size/K);
}
- message.append(" = " SIZE_FORMAT "K", total/K);
+ message.append(" = %zuK", total/K);
message.append((total > cache_size) ? " is greater than " : " is less than ");
- message.append("ReservedCodeCacheSize (" SIZE_FORMAT "K).", cache_size/K);
+ message.append("ReservedCodeCacheSize (%zuK).", cache_size/K);
vm_exit_during_initialization("Invalid code heap sizes", message);
}
@@ -356,7 +355,7 @@ ReservedSpace CodeCache::reserve_heap_memory(size_t size, size_t rs_ps) {
ReservedSpace rs = CodeMemoryReserver::reserve(rs_size, rs_align, rs_ps);
if (!rs.is_reserved()) {
- vm_exit_during_initialization(err_msg("Could not reserve enough space for code cache (" SIZE_FORMAT "K)",
+ vm_exit_during_initialization(err_msg("Could not reserve enough space for code cache (%zuK)",
rs_size/K));
}
@@ -437,7 +436,7 @@ void CodeCache::add_heap(ReservedSpace rs, const char* name, CodeBlobType code_b
size_t size_initial = MIN2((size_t)InitialCodeCacheSize, rs.size());
size_initial = align_up(size_initial, rs.page_size());
if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) {
- vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (" SIZE_FORMAT "K)",
+ vm_exit_during_initialization(err_msg("Could not reserve enough space in %s (%zuK)",
heap->name(), size_initial/K));
}
@@ -565,7 +564,7 @@ CodeBlob* CodeCache::allocate(uint size, CodeBlobType code_blob_type, bool handl
} else {
tty->print("CodeCache");
}
- tty->print_cr(" extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
+ tty->print_cr(" extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%zd bytes)",
(intptr_t)heap->low_boundary(), (intptr_t)heap->high(),
(address)heap->high() - (address)heap->low_boundary());
}
@@ -1491,10 +1490,10 @@ void CodeCache::print_memory_overhead() {
}
// Print bytes that are allocated in the freelist
ttyLocker ttl;
- tty->print_cr("Number of elements in freelist: " SSIZE_FORMAT, freelists_length());
- tty->print_cr("Allocated in freelist: " SSIZE_FORMAT "kB", bytes_allocated_in_freelists()/K);
- tty->print_cr("Unused bytes in CodeBlobs: " SSIZE_FORMAT "kB", (wasted_bytes/K));
- tty->print_cr("Segment map size: " SSIZE_FORMAT "kB", allocated_segments()/K); // 1 byte per segment
+ tty->print_cr("Number of elements in freelist: %zd", freelists_length());
+ tty->print_cr("Allocated in freelist: %zdkB", bytes_allocated_in_freelists()/K);
+ tty->print_cr("Unused bytes in CodeBlobs: %zdkB", (wasted_bytes/K));
+ tty->print_cr("Segment map size: %zdkB", allocated_segments()/K); // 1 byte per segment
}
//------------------------------------------------------------------------------------------------
@@ -1727,8 +1726,8 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
total_used += used;
total_max_used += max_used;
total_free += free;
- st->print_cr(" size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT
- "Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb",
+ st->print_cr(" size=%zuKb used=%zu"
+ "Kb max_used=%zuKb free=%zuKb",
size, used, max_used, free);
if (detailed) {
@@ -1788,7 +1787,7 @@ void CodeCache::print_layout(outputStream* st) {
void CodeCache::log_state(outputStream* st) {
st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
- " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
+ " adapters='" UINT32_FORMAT "' free_code_cache='%zu'",
blob_count(), nmethod_count(), adapter_count(),
unallocated_capacity());
}
diff --git a/src/hotspot/share/code/codeCache.hpp b/src/hotspot/share/code/codeCache.hpp
index dbca9aeb25fee..3e446ab8430fe 100644
--- a/src/hotspot/share/code/codeCache.hpp
+++ b/src/hotspot/share/code/codeCache.hpp
@@ -90,7 +90,6 @@ class CodeCache : AllStatic {
friend class JVMCIVMStructs;
template friend class CodeBlobIterator;
friend class WhiteBox;
- friend class CodeCacheLoader;
friend class ShenandoahParallelCodeHeapIterator;
private:
// CodeHeaps of the cache
diff --git a/src/hotspot/share/code/codeHeapState.cpp b/src/hotspot/share/code/codeHeapState.cpp
index 0fa7c7386c7ee..065aab5c2500d 100644
--- a/src/hotspot/share/code/codeHeapState.cpp
+++ b/src/hotspot/share/code/codeHeapState.cpp
@@ -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.
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeHeapState.hpp"
#include "compiler/compileBroker.hpp"
#include "oops/klass.inline.hpp"
@@ -370,7 +369,7 @@ void CodeHeapState::prepare_StatArray(outputStream* out, size_t nElem, size_t gr
if (StatArray == nullptr) {
//---< just do nothing if allocation failed >---
out->print_cr("Statistics could not be collected for %s, probably out of memory.", heapName);
- out->print_cr("Current granularity is " SIZE_FORMAT " bytes. Try a coarser granularity.", granularity);
+ out->print_cr("Current granularity is %zu bytes. Try a coarser granularity.", granularity);
alloc_granules = 0;
granule_size = 0;
} else {
@@ -621,11 +620,11 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
" collected data to be consistent. Only the method names and signatures\n"
" are retrieved at print time. That may lead to rare cases where the\n"
" name of a method is no longer available, e.g. because it was unloaded.\n");
- ast->print_cr(" CodeHeap committed size " SIZE_FORMAT "K (" SIZE_FORMAT "M), reserved size " SIZE_FORMAT "K (" SIZE_FORMAT "M), %d%% occupied.",
+ ast->print_cr(" CodeHeap committed size %zuK (%zuM), reserved size %zuK (%zuM), %d%% occupied.",
size/(size_t)K, size/(size_t)M, res_size/(size_t)K, res_size/(size_t)M, (unsigned int)(100.0*size/res_size));
- ast->print_cr(" CodeHeap allocation segment size is " SIZE_FORMAT " bytes. This is the smallest possible granularity.", seg_size);
- ast->print_cr(" CodeHeap (committed part) is mapped to " SIZE_FORMAT " granules of size " SIZE_FORMAT " bytes.", granules, granularity);
- ast->print_cr(" Each granule takes " SIZE_FORMAT " bytes of C heap, that is " SIZE_FORMAT "K in total for statistics data.", sizeof(StatElement), (sizeof(StatElement)*granules)/(size_t)K);
+ ast->print_cr(" CodeHeap allocation segment size is %zu bytes. This is the smallest possible granularity.", seg_size);
+ ast->print_cr(" CodeHeap (committed part) is mapped to %zu granules of size %zu bytes.", granules, granularity);
+ ast->print_cr(" Each granule takes %zu bytes of C heap, that is %zuK in total for statistics data.", sizeof(StatElement), (sizeof(StatElement)*granules)/(size_t)K);
ast->print_cr(" The number of granules is limited to %dk, requiring a granules size of at least %d bytes for a 1GB heap.", (unsigned int)(max_granules/K), (unsigned int)(G/max_granules));
BUFFEREDSTREAM_FLUSH("\n")
@@ -697,10 +696,10 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
insane = true; ast->print_cr("Sanity check: HeapBlock @%p outside used range (%p)", (char*)h, low_bound + size);
}
if (ix_end >= granules) {
- insane = true; ast->print_cr("Sanity check: end index (%d) out of bounds (" SIZE_FORMAT ")", ix_end, granules);
+ insane = true; ast->print_cr("Sanity check: end index (%d) out of bounds (%zu)", ix_end, granules);
}
if (size != heap->capacity()) {
- insane = true; ast->print_cr("Sanity check: code heap capacity has changed (" SIZE_FORMAT "K to " SIZE_FORMAT "K)", size/(size_t)K, heap->capacity()/(size_t)K);
+ insane = true; ast->print_cr("Sanity check: code heap capacity has changed (%zuK to %zuK)", size/(size_t)K, heap->capacity()/(size_t)K);
}
if (ix_beg > ix_end) {
insane = true; ast->print_cr("Sanity check: end index (%d) lower than begin index (%d)", ix_end, ix_beg);
@@ -1042,19 +1041,19 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
// interspersed with print data from other threads. We take this risk intentionally.
// Getting stalled waiting for tty_lock while holding the CodeCache_lock is not desirable.
printBox(ast, '-', "Global CodeHeap statistics for segment ", heapName);
- ast->print_cr("freeSpace = " SIZE_FORMAT_W(8) "k, nBlocks_free = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", freeSpace/(size_t)K, nBlocks_free, (100.0*freeSpace)/size, (100.0*freeSpace)/res_size);
- ast->print_cr("usedSpace = " SIZE_FORMAT_W(8) "k, nBlocks_used = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", usedSpace/(size_t)K, nBlocks_used, (100.0*usedSpace)/size, (100.0*usedSpace)/res_size);
- ast->print_cr(" Tier1 Space = " SIZE_FORMAT_W(8) "k, nBlocks_t1 = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", t1Space/(size_t)K, nBlocks_t1, (100.0*t1Space)/size, (100.0*t1Space)/res_size);
- ast->print_cr(" Tier2 Space = " SIZE_FORMAT_W(8) "k, nBlocks_t2 = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", t2Space/(size_t)K, nBlocks_t2, (100.0*t2Space)/size, (100.0*t2Space)/res_size);
- ast->print_cr(" Alive Space = " SIZE_FORMAT_W(8) "k, nBlocks_alive = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", aliveSpace/(size_t)K, nBlocks_alive, (100.0*aliveSpace)/size, (100.0*aliveSpace)/res_size);
- ast->print_cr(" disconnected = " SIZE_FORMAT_W(8) "k, nBlocks_disconn = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", disconnSpace/(size_t)K, nBlocks_disconn, (100.0*disconnSpace)/size, (100.0*disconnSpace)/res_size);
- ast->print_cr(" not entrant = " SIZE_FORMAT_W(8) "k, nBlocks_notentr = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", notentrSpace/(size_t)K, nBlocks_notentr, (100.0*notentrSpace)/size, (100.0*notentrSpace)/res_size);
- ast->print_cr(" stubSpace = " SIZE_FORMAT_W(8) "k, nBlocks_stub = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", stubSpace/(size_t)K, nBlocks_stub, (100.0*stubSpace)/size, (100.0*stubSpace)/res_size);
+ ast->print_cr("freeSpace = %8zuk, nBlocks_free = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", freeSpace/(size_t)K, nBlocks_free, (100.0*freeSpace)/size, (100.0*freeSpace)/res_size);
+ ast->print_cr("usedSpace = %8zuk, nBlocks_used = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", usedSpace/(size_t)K, nBlocks_used, (100.0*usedSpace)/size, (100.0*usedSpace)/res_size);
+ ast->print_cr(" Tier1 Space = %8zuk, nBlocks_t1 = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", t1Space/(size_t)K, nBlocks_t1, (100.0*t1Space)/size, (100.0*t1Space)/res_size);
+ ast->print_cr(" Tier2 Space = %8zuk, nBlocks_t2 = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", t2Space/(size_t)K, nBlocks_t2, (100.0*t2Space)/size, (100.0*t2Space)/res_size);
+ ast->print_cr(" Alive Space = %8zuk, nBlocks_alive = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", aliveSpace/(size_t)K, nBlocks_alive, (100.0*aliveSpace)/size, (100.0*aliveSpace)/res_size);
+ ast->print_cr(" disconnected = %8zuk, nBlocks_disconn = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", disconnSpace/(size_t)K, nBlocks_disconn, (100.0*disconnSpace)/size, (100.0*disconnSpace)/res_size);
+ ast->print_cr(" not entrant = %8zuk, nBlocks_notentr = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", notentrSpace/(size_t)K, nBlocks_notentr, (100.0*notentrSpace)/size, (100.0*notentrSpace)/res_size);
+ ast->print_cr(" stubSpace = %8zuk, nBlocks_stub = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", stubSpace/(size_t)K, nBlocks_stub, (100.0*stubSpace)/size, (100.0*stubSpace)/res_size);
ast->print_cr("ZombieBlocks = %8d. These are HeapBlocks which could not be identified as CodeBlobs.", nBlocks_zomb);
ast->cr();
- ast->print_cr("Segment start = " INTPTR_FORMAT ", used space = " SIZE_FORMAT_W(8)"k", p2i(low_bound), size/K);
- ast->print_cr("Segment end (used) = " INTPTR_FORMAT ", remaining space = " SIZE_FORMAT_W(8)"k", p2i(low_bound) + size, (res_size - size)/K);
- ast->print_cr("Segment end (reserved) = " INTPTR_FORMAT ", reserved space = " SIZE_FORMAT_W(8)"k", p2i(low_bound) + res_size, res_size/K);
+ ast->print_cr("Segment start = " INTPTR_FORMAT ", used space = %8zuk", p2i(low_bound), size/K);
+ ast->print_cr("Segment end (used) = " INTPTR_FORMAT ", remaining space = %8zuk", p2i(low_bound) + size, (res_size - size)/K);
+ ast->print_cr("Segment end (reserved) = " INTPTR_FORMAT ", reserved space = %8zuk", p2i(low_bound) + res_size, res_size/K);
ast->cr();
ast->print_cr("latest allocated compilation id = %d", latest_compilation_id);
ast->print_cr("highest observed compilation id = %d", highest_compilation_id);
@@ -1134,7 +1133,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
ast->print_cr(" The aggregate step collects information about all free blocks in CodeHeap.\n"
" Subsequent print functions create their output based on this snapshot.\n");
ast->print_cr(" Free space in %s is distributed over %d free blocks.", heapName, nBlocks_free);
- ast->print_cr(" Each free block takes " SIZE_FORMAT " bytes of C heap for statistics data, that is " SIZE_FORMAT "K in total.", sizeof(FreeBlk), (sizeof(FreeBlk)*nBlocks_free)/K);
+ ast->print_cr(" Each free block takes %zu bytes of C heap for statistics data, that is %zuK in total.", sizeof(FreeBlk), (sizeof(FreeBlk)*nBlocks_free)/K);
BUFFEREDSTREAM_FLUSH("\n")
//----------------------------------------
@@ -1303,7 +1302,7 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
if (is_nmethod) {
//---< nMethod size in hex >---
ast->print(UINT32_FORMAT_X_0, TopSizeArray[i].nm_size);
- ast->print("(" SIZE_FORMAT_W(4) "K)", TopSizeArray[i].nm_size/K);
+ ast->print("(%4zuK)", TopSizeArray[i].nm_size/K);
ast->fill_to(51);
ast->print(" %c", blobTypeChar[TopSizeArray[i].type]);
//---< compiler information >---
@@ -1315,7 +1314,7 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
} else {
//---< block size in hex >---
ast->print(UINT32_FORMAT_X_0, (unsigned int)(TopSizeArray[i].len<print("(" SIZE_FORMAT_W(4) "K)", (TopSizeArray[i].len<print("(%4zuK)", (TopSizeArray[i].len<---
ast->fill_to(56);
//---< name and signature >---
@@ -1362,17 +1361,17 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
ast->print_cr("[Size Range)------avg.-size-+----count-+");
for (unsigned int i = 0; i < nSizeDistElements; i++) {
if (SizeDistributionArray[i].rangeStart<print("[" SIZE_FORMAT_W(5) " .." SIZE_FORMAT_W(5) " ): "
+ ast->print("[%5zu ..%5zu ): "
,(size_t)(SizeDistributionArray[i].rangeStart<print("[" SIZE_FORMAT_W(5) "K.." SIZE_FORMAT_W(5) "K): "
+ ast->print("[%5zuK..%5zuK): "
,(SizeDistributionArray[i].rangeStart<print("[" SIZE_FORMAT_W(5) "M.." SIZE_FORMAT_W(5) "M): "
+ ast->print("[%5zuM..%5zuM): "
,(SizeDistributionArray[i].rangeStart<print_cr("[Size Range)------avg.-size-+----count-+");
for (unsigned int i = 0; i < nSizeDistElements; i++) {
if (SizeDistributionArray[i].rangeStart<print("[" SIZE_FORMAT_W(5) " .." SIZE_FORMAT_W(5) " ): "
+ ast->print("[%5zu ..%5zu ): "
,(size_t)(SizeDistributionArray[i].rangeStart<print("[" SIZE_FORMAT_W(5) "K.." SIZE_FORMAT_W(5) "K): "
+ ast->print("[%5zuK..%5zuK): "
,(SizeDistributionArray[i].rangeStart<print("[" SIZE_FORMAT_W(5) "M.." SIZE_FORMAT_W(5) "M): "
+ ast->print("[%5zuM..%5zuM): "
,(SizeDistributionArray[i].rangeStart<cr();
ast->print_cr("--------------------------------------------------------------------");
- ast->print_cr("Address range [" INTPTR_FORMAT "," INTPTR_FORMAT "), " SIZE_FORMAT "k", p2i(low_bound+ix*granule_size), p2i(low_bound + end_ix*granule_size), (end_ix - ix)*granule_size/(size_t)K);
+ ast->print_cr("Address range [" INTPTR_FORMAT "," INTPTR_FORMAT "), %zuk", p2i(low_bound+ix*granule_size), p2i(low_bound + end_ix*granule_size), (end_ix - ix)*granule_size/(size_t)K);
ast->print_cr("--------------------------------------------------------------------");
BUFFEREDSTREAM_FLUSH_AUTO("")
}
@@ -2170,7 +2169,7 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
bool get_name = (cbType == nMethod_inuse) || (cbType == nMethod_notused);
//---< nMethod size in hex >---
ast->print(UINT32_FORMAT_X_0, total_size);
- ast->print("(" SIZE_FORMAT_W(4) "K)", total_size/K);
+ ast->print("(%4zuK)", total_size/K);
//---< compiler information >---
ast->fill_to(51);
ast->print("%5s %3d", compTypeName[StatArray[ix].compiler], StatArray[ix].level);
diff --git a/src/hotspot/share/code/compiledIC.cpp b/src/hotspot/share/code/compiledIC.cpp
index 684aee509ee53..2547b8711db16 100644
--- a/src/hotspot/share/code/compiledIC.cpp
+++ b/src/hotspot/share/code/compiledIC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeBehaviours.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
diff --git a/src/hotspot/share/code/compressedStream.cpp b/src/hotspot/share/code/compressedStream.cpp
index 6a4174fb6ce0e..db86a1acd3c8f 100644
--- a/src/hotspot/share/code/compressedStream.cpp
+++ b/src/hotspot/share/code/compressedStream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/compressedStream.hpp"
#include "utilities/ostream.hpp"
#include "utilities/reverse_bits.hpp"
diff --git a/src/hotspot/share/code/debugInfo.cpp b/src/hotspot/share/code/debugInfo.cpp
index ccee142c93808..9e895ecf152f3 100644
--- a/src/hotspot/share/code/debugInfo.cpp
+++ b/src/hotspot/share/code/debugInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/debugInfo.hpp"
#include "code/debugInfoRec.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/share/code/debugInfoRec.cpp b/src/hotspot/share/code/debugInfoRec.cpp
index 71da21f1e99cd..02cd23407bf90 100644
--- a/src/hotspot/share/code/debugInfoRec.cpp
+++ b/src/hotspot/share/code/debugInfoRec.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/debugInfoRec.hpp"
#include "code/scopeDesc.hpp"
#include "compiler/oopMap.hpp"
diff --git a/src/hotspot/share/code/dependencies.cpp b/src/hotspot/share/code/dependencies.cpp
index 260da40b87a42..7f925388eb039 100644
--- a/src/hotspot/share/code/dependencies.cpp
+++ b/src/hotspot/share/code/dependencies.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciArrayKlass.hpp"
#include "ci/ciEnv.hpp"
#include "ci/ciKlass.hpp"
diff --git a/src/hotspot/share/code/dependencyContext.cpp b/src/hotspot/share/code/dependencyContext.cpp
index 0e6b99d172dcb..6a7742cea8d3d 100644
--- a/src/hotspot/share/code/dependencyContext.cpp
+++ b/src/hotspot/share/code/dependencyContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "code/dependencies.hpp"
#include "code/dependencyContext.hpp"
diff --git a/src/hotspot/share/code/exceptionHandlerTable.cpp b/src/hotspot/share/code/exceptionHandlerTable.cpp
index aedeb0e9e049f..a295d1271aa65 100644
--- a/src/hotspot/share/code/exceptionHandlerTable.cpp
+++ b/src/hotspot/share/code/exceptionHandlerTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/exceptionHandlerTable.hpp"
#include "code/nmethod.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/share/code/location.cpp b/src/hotspot/share/code/location.cpp
index ba8859b60a887..ec9d0797dc3a3 100644
--- a/src/hotspot/share/code/location.cpp
+++ b/src/hotspot/share/code/location.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/debugInfo.hpp"
#include "code/location.hpp"
#include "runtime/handles.inline.hpp"
diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp
index 754a7786605ff..283970afa69a7 100644
--- a/src/hotspot/share/code/nmethod.cpp
+++ b/src/hotspot/share/code/nmethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
@@ -1586,7 +1585,7 @@ void nmethod::log_identity(xmlStream* log) const {
#define LOG_OFFSET(log, name) \
if (p2i(name##_end()) - p2i(name##_begin())) \
- log->print(" " XSTR(name) "_offset='" INTX_FORMAT "'" , \
+ log->print(" " XSTR(name) "_offset='%zd'" , \
p2i(name##_begin()) - p2i(this))
@@ -1962,7 +1961,7 @@ void nmethod::log_state_change() const {
if (LogCompilation) {
if (xtty != nullptr) {
ttyLocker ttyl; // keep the following output all in one block
- xtty->begin_elem("make_not_entrant thread='" UINTX_FORMAT "'",
+ xtty->begin_elem("make_not_entrant thread='%zu'",
os::current_thread_id());
log_identity(xtty);
xtty->stamp();
@@ -2110,7 +2109,7 @@ void nmethod::purge(bool unregister_nmethod) {
// completely deallocate this method
Events::log_nmethod_flush(Thread::current(), "flushing %s nmethod " INTPTR_FORMAT, is_osr_method() ? "osr" : "", p2i(this));
log_debug(codecache)("*flushing %s nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT
- "/Free CodeCache:" SIZE_FORMAT "Kb",
+ "/Free CodeCache:%zuKb",
is_osr_method() ? "osr" : "",_compile_id, p2i(this), CodeCache::blob_count(),
CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(this))/1024);
diff --git a/src/hotspot/share/code/oopRecorder.cpp b/src/hotspot/share/code/oopRecorder.cpp
index 1849493974ca4..af23bf12b4386 100644
--- a/src/hotspot/share/code/oopRecorder.cpp
+++ b/src/hotspot/share/code/oopRecorder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciEnv.hpp"
#include "ci/ciInstance.hpp"
#include "ci/ciMetadata.hpp"
diff --git a/src/hotspot/share/code/pcDesc.cpp b/src/hotspot/share/code/pcDesc.cpp
index 241eee03a9c13..23f0c9f80c5fe 100644
--- a/src/hotspot/share/code/pcDesc.cpp
+++ b/src/hotspot/share/code/pcDesc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/debugInfoRec.hpp"
#include "code/nmethod.hpp"
#include "code/pcDesc.hpp"
diff --git a/src/hotspot/share/code/relocInfo.cpp b/src/hotspot/share/code/relocInfo.cpp
index a379f88ddc180..9dc4eced9662b 100644
--- a/src/hotspot/share/code/relocInfo.cpp
+++ b/src/hotspot/share/code/relocInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/share/code/scopeDesc.cpp b/src/hotspot/share/code/scopeDesc.cpp
index d22d3352f4e4e..d3e08a886e6e4 100644
--- a/src/hotspot/share/code/scopeDesc.cpp
+++ b/src/hotspot/share/code/scopeDesc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "code/debugInfoRec.hpp"
#include "code/pcDesc.hpp"
diff --git a/src/hotspot/share/code/stubs.cpp b/src/hotspot/share/code/stubs.cpp
index 95cee4edb43c9..074241ff61133 100644
--- a/src/hotspot/share/code/stubs.cpp
+++ b/src/hotspot/share/code/stubs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
#include "code/stubs.hpp"
diff --git a/src/hotspot/share/code/vmreg.cpp b/src/hotspot/share/code/vmreg.cpp
index b9ee4a6b3e7a5..7407eceac0580 100644
--- a/src/hotspot/share/code/vmreg.cpp
+++ b/src/hotspot/share/code/vmreg.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
diff --git a/src/hotspot/share/code/vtableStubs.cpp b/src/hotspot/share/code/vtableStubs.cpp
index 6a0c52ae828c4..00826f820366d 100644
--- a/src/hotspot/share/code/vtableStubs.cpp
+++ b/src/hotspot/share/code/vtableStubs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/vtableStubs.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/disassembler.hpp"
@@ -79,7 +78,7 @@ void* VtableStub::operator new(size_t size, int code_size) throw() {
void VtableStub::print_on(outputStream* st) const {
- st->print("vtable stub (index = %d, receiver_location = " INTX_FORMAT ", code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "])",
+ st->print("vtable stub (index = %d, receiver_location = %zd, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "])",
index(), p2i(receiver_location()), p2i(code_begin()), p2i(code_end()));
}
@@ -226,7 +225,7 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
enter(is_vtable_stub, vtable_index, s);
if (PrintAdapterHandlers) {
- tty->print_cr("Decoding VtableStub %s[%d]@" PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (" SIZE_FORMAT " bytes)",
+ tty->print_cr("Decoding VtableStub %s[%d]@" PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (%zu bytes)",
is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location()),
p2i(s->code_begin()), p2i(s->code_end()), pointer_delta(s->code_end(), s->code_begin(), 1));
Disassembler::decode(s->code_begin(), s->code_end());
diff --git a/src/hotspot/share/compiler/abstractCompiler.cpp b/src/hotspot/share/compiler/abstractCompiler.cpp
index 0c094c75d8b59..386243850ddb2 100644
--- a/src/hotspot/share/compiler/abstractCompiler.cpp
+++ b/src/hotspot/share/compiler/abstractCompiler.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2007, 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
@@ -21,7 +21,6 @@
// questions.
//
-#include "precompiled.hpp"
#include "compiler/abstractCompiler.hpp"
#include "compiler/compileBroker.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/hotspot/share/compiler/abstractDisassembler.cpp b/src/hotspot/share/compiler/abstractDisassembler.cpp
index 6117108155fe8..32f37e7b5139b 100644
--- a/src/hotspot/share/compiler/abstractDisassembler.cpp
+++ b/src/hotspot/share/compiler/abstractDisassembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -26,7 +26,6 @@
// AbstractDisassembler is the base class for
// platform-specific Disassembler classes.
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "compiler/abstractDisassembler.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/share/compiler/cHeapStringHolder.cpp b/src/hotspot/share/compiler/cHeapStringHolder.cpp
index 0383e738a47c9..261658e04eb1c 100644
--- a/src/hotspot/share/compiler/cHeapStringHolder.cpp
+++ b/src/hotspot/share/compiler/cHeapStringHolder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/cHeapStringHolder.hpp"
void CHeapStringHolder::set(const char* string) {
diff --git a/src/hotspot/share/compiler/compilationFailureInfo.cpp b/src/hotspot/share/compiler/compilationFailureInfo.cpp
index fb94102ef1654..aaa9cb79d1211 100644
--- a/src/hotspot/share/compiler/compilationFailureInfo.cpp
+++ b/src/hotspot/share/compiler/compilationFailureInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#if defined(COMPILER1) || defined(COMPILER2)
#ifdef COMPILER1
diff --git a/src/hotspot/share/compiler/compilationLog.cpp b/src/hotspot/share/compiler/compilationLog.cpp
index 822ff1a7ff4ab..f8dc24d3aaaf3 100644
--- a/src/hotspot/share/compiler/compilationLog.cpp
+++ b/src/hotspot/share/compiler/compilationLog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "compiler/compilationLog.hpp"
#include "compiler/compileTask.hpp"
diff --git a/src/hotspot/share/compiler/compilationMemoryStatistic.cpp b/src/hotspot/share/compiler/compilationMemoryStatistic.cpp
index 4cc2043656efa..89d0b60212e22 100644
--- a/src/hotspot/share/compiler/compilationMemoryStatistic.cpp
+++ b/src/hotspot/share/compiler/compilationMemoryStatistic.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#ifdef COMPILER1
diff --git a/src/hotspot/share/compiler/compilationPolicy.cpp b/src/hotspot/share/compiler/compilationPolicy.cpp
index 8fc70619abe7e..e28c4511d5219 100644
--- a/src/hotspot/share/compiler/compilationPolicy.cpp
+++ b/src/hotspot/share/compiler/compilationPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/scopeDesc.hpp"
#include "compiler/compilationPolicy.hpp"
#include "compiler/compileBroker.hpp"
@@ -455,7 +454,7 @@ void CompilationPolicy::initialize() {
c2_size = C2Compiler::initial_code_buffer_size();
#endif
size_t buffer_size = c1_only ? c1_size : (c1_size/3 + 2*c2_size/3);
- int max_count = (ReservedCodeCacheSize - (int)CompilerConfig::min_code_cache_size()) / (int)buffer_size;
+ int max_count = (ReservedCodeCacheSize - (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3))) / (int)buffer_size;
if (count > max_count) {
// Lower the compiler count such that all buffers fit into the code cache
count = MAX2(max_count, c1_only ? 1 : 2);
diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp
index 30956b6c793bd..badcfeab2954e 100644
--- a/src/hotspot/share/compiler/compileBroker.cpp
+++ b/src/hotspot/share/compiler/compileBroker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/vmClasses.hpp"
@@ -1917,7 +1916,7 @@ void CompileBroker::compiler_thread_loop() {
// Open a log.
CompileLog* log = get_log(thread);
if (log != nullptr) {
- log->begin_elem("start_compile_thread name='%s' thread='" UINTX_FORMAT "' process='%d'",
+ log->begin_elem("start_compile_thread name='%s' thread='%zu' process='%d'",
thread->name(),
os::current_thread_id(),
os::current_process_id());
@@ -2008,11 +2007,11 @@ void CompileBroker::init_compiler_thread_log() {
for (int try_temp_dir = 1; try_temp_dir >= 0; try_temp_dir--) {
const char* dir = (try_temp_dir ? os::get_temp_directory() : nullptr);
if (dir == nullptr) {
- jio_snprintf(file_name, sizeof(file_name), "hs_c" UINTX_FORMAT "_pid%u.log",
+ jio_snprintf(file_name, sizeof(file_name), "hs_c%zu_pid%u.log",
thread_id, os::current_process_id());
} else {
jio_snprintf(file_name, sizeof(file_name),
- "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir,
+ "%s%shs_c%zu_pid%u.log", dir,
os::file_separator(), thread_id, os::current_process_id());
}
@@ -2031,7 +2030,7 @@ void CompileBroker::init_compiler_thread_log() {
if (xtty != nullptr) {
ttyLocker ttyl;
// Record any per thread log files
- xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
+ xtty->elem("thread_logfile thread='%zd' filename='%s'", thread_id, file_name);
}
return;
}
@@ -2532,6 +2531,11 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
// C1 and C2 counters are counting both successful and unsuccessful compiles
_t_total_compilation.add(time);
+ // Update compilation times. Used by the implementation of JFR CompilerStatistics
+ // and java.lang.management.CompilationMXBean.
+ _perf_total_compilation->inc(time.ticks());
+ _peak_compilation_time = MAX2(time.milliseconds(), _peak_compilation_time);
+
if (!success) {
_total_bailout_count++;
if (UsePerfData) {
@@ -2550,12 +2554,6 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
_t_invalidated_compilation.add(time);
} else {
// Compilation succeeded
-
- // update compilation ticks - used by the implementation of
- // java.lang.management.CompilationMXBean
- _perf_total_compilation->inc(time.ticks());
- _peak_compilation_time = time.milliseconds() > _peak_compilation_time ? time.milliseconds() : _peak_compilation_time;
-
if (CITime) {
int bytes_compiled = method->code_size() + task->num_inlined_bytecodes();
if (is_osr) {
@@ -2779,9 +2777,9 @@ void CompileBroker::print_info(outputStream *out) {
out->print_cr("CodeCache overview");
out->print_cr("--------------------------------------------------------");
out->cr();
- out->print_cr(" Reserved size : " SIZE_FORMAT_W(7) " KB", CodeCache::max_capacity() / K);
- out->print_cr(" Committed size : " SIZE_FORMAT_W(7) " KB", CodeCache::capacity() / K);
- out->print_cr(" Unallocated capacity : " SIZE_FORMAT_W(7) " KB", CodeCache::unallocated_capacity() / K);
+ out->print_cr(" Reserved size : %7zu KB", CodeCache::max_capacity() / K);
+ out->print_cr(" Committed size : %7zu KB", CodeCache::capacity() / K);
+ out->print_cr(" Unallocated capacity : %7zu KB", CodeCache::unallocated_capacity() / K);
out->cr();
}
diff --git a/src/hotspot/share/compiler/compileLog.cpp b/src/hotspot/share/compiler/compileLog.cpp
index 7b780fec492f9..85b8cbdf5921a 100644
--- a/src/hotspot/share/compiler/compileLog.cpp
+++ b/src/hotspot/share/compiler/compileLog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethod.hpp"
#include "code/codeCache.hpp"
#include "compiler/compileLog.hpp"
@@ -212,7 +211,7 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen)
// print/print_cr may need to allocate large stack buffer to format
// strings, here we use snprintf() and print_raw() instead.
file->print_raw("");
diff --git a/src/hotspot/share/compiler/compileTask.cpp b/src/hotspot/share/compiler/compileTask.cpp
index 1a2af5721665f..2011fa656248b 100644
--- a/src/hotspot/share/compiler/compileTask.cpp
+++ b/src/hotspot/share/compiler/compileTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compilationPolicy.hpp"
#include "compiler/compileTask.hpp"
#include "compiler/compileLog.hpp"
diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp
index ad3d14012ff62..f82e96be6ae7e 100644
--- a/src/hotspot/share/compiler/compilerDefinitions.cpp
+++ b/src/hotspot/share/compiler/compilerDefinitions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "interpreter/invocationCounter.hpp"
@@ -475,7 +474,8 @@ void CompilerConfig::set_jvmci_specific_flags() {
bool CompilerConfig::check_args_consistency(bool status) {
// Check lower bounds of the code cache
- size_t min_code_cache_size = CompilerConfig::min_code_cache_size();
+ // Template Interpreter code is approximately 3X larger in debug builds.
+ uint min_code_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3);
if (ReservedCodeCacheSize < InitialCodeCacheSize) {
jio_fprintf(defaultStream::error_stream(),
"Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",
diff --git a/src/hotspot/share/compiler/compilerDefinitions.hpp b/src/hotspot/share/compiler/compilerDefinitions.hpp
index a72e82e32bd56..bdaa6dffb8f5f 100644
--- a/src/hotspot/share/compiler/compilerDefinitions.hpp
+++ b/src/hotspot/share/compiler/compilerDefinitions.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -148,8 +148,6 @@ class CompilerConfig : public AllStatic {
inline static bool is_c2_or_jvmci_compiler_only();
inline static bool is_c2_or_jvmci_compiler_enabled();
- inline static size_t min_code_cache_size();
-
private:
static bool is_compilation_mode_selected();
static void set_compilation_policy_flags();
diff --git a/src/hotspot/share/compiler/compilerDefinitions.inline.hpp b/src/hotspot/share/compiler/compilerDefinitions.inline.hpp
index 5d04ef307d0f7..45df9b0b8b005 100644
--- a/src/hotspot/share/compiler/compilerDefinitions.inline.hpp
+++ b/src/hotspot/share/compiler/compilerDefinitions.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -25,12 +25,6 @@
#ifndef SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP
#define SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP
-#ifdef COMPILER1
-#include "c1/c1_Compiler.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/c2compiler.hpp"
-#endif
#include "compiler/compilerDefinitions.hpp"
#include "compiler/compiler_globals.hpp"
#include "runtime/arguments.hpp"
@@ -136,13 +130,4 @@ inline bool CompilerConfig::is_c2_or_jvmci_compiler_enabled() {
return is_c2_enabled() || is_jvmci_compiler_enabled();
}
-inline size_t CompilerConfig::min_code_cache_size() {
- size_t min_code_cache_size = CodeCacheMinimumUseSpace;
- // Template Interpreter code is approximately 3X larger in debug builds.
- DEBUG_ONLY(min_code_cache_size *= 3);
- COMPILER1_PRESENT(min_code_cache_size += Compiler::code_buffer_size());
- COMPILER2_PRESENT(min_code_cache_size += C2Compiler::initial_code_buffer_size());
- return min_code_cache_size;
-}
-
#endif // SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP
diff --git a/src/hotspot/share/compiler/compilerDirectives.cpp b/src/hotspot/share/compiler/compilerDirectives.cpp
index 46750cacc35db..5431b03f6a142 100644
--- a/src/hotspot/share/compiler/compilerDirectives.cpp
+++ b/src/hotspot/share/compiler/compilerDirectives.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethod.hpp"
#include "ci/ciUtilities.inline.hpp"
#include "compiler/abstractCompiler.hpp"
diff --git a/src/hotspot/share/compiler/compilerDirectives.hpp b/src/hotspot/share/compiler/compilerDirectives.hpp
index 620874508f483..74e3d8b9b38e7 100644
--- a/src/hotspot/share/compiler/compilerDirectives.hpp
+++ b/src/hotspot/share/compiler/compilerDirectives.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -218,8 +218,8 @@ void set_##name(void* value) { \
return _trace_merge_stores_tags;
};
- void print_intx(outputStream* st, ccstr n, intx v, bool mod) { if (mod) { st->print("%s:" INTX_FORMAT " ", n, v); } }
- void print_uintx(outputStream* st, ccstr n, intx v, bool mod) { if (mod) { st->print("%s:" UINTX_FORMAT " ", n, v); } }
+ void print_intx(outputStream* st, ccstr n, intx v, bool mod) { if (mod) { st->print("%s:%zd ", n, v); } }
+ void print_uintx(outputStream* st, ccstr n, intx v, bool mod) { if (mod) { st->print("%s:%zu ", n, v); } }
void print_bool(outputStream* st, ccstr n, bool v, bool mod) { if (mod) { st->print("%s:%s ", n, v ? "true" : "false"); } }
void print_double(outputStream* st, ccstr n, double v, bool mod) { if (mod) { st->print("%s:%f ", n, v); } }
void print_ccstr(outputStream* st, ccstr n, ccstr v, bool mod) { if (mod) { st->print("%s:%s ", n, v); } }
diff --git a/src/hotspot/share/compiler/compilerEvent.cpp b/src/hotspot/share/compiler/compilerEvent.cpp
index d2f6e7ba88670..4bc859ef0d642 100644
--- a/src/hotspot/share/compiler/compilerEvent.cpp
+++ b/src/hotspot/share/compiler/compilerEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethod.hpp"
#include "compiler/compilerEvent.hpp"
#include "jfr/jfr.hpp"
diff --git a/src/hotspot/share/compiler/compilerOracle.cpp b/src/hotspot/share/compiler/compilerOracle.cpp
index 107350794a02d..8e296226feec1 100644
--- a/src/hotspot/share/compiler/compilerOracle.cpp
+++ b/src/hotspot/share/compiler/compilerOracle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "compiler/compilerDirectives.hpp"
#include "compiler/compilerOracle.hpp"
@@ -236,10 +235,10 @@ void TypedMethodOptionMatcher::print() {
enum OptionType type = option2type(_option);
switch (type) {
case OptionType::Intx:
- tty->print_cr(" intx %s = " INTX_FORMAT, name, value());
+ tty->print_cr(" intx %s = %zd", name, value());
break;
case OptionType::Uintx:
- tty->print_cr(" uintx %s = " UINTX_FORMAT, name, value());
+ tty->print_cr(" uintx %s = %zu", name, value());
break;
case OptionType::Bool:
tty->print_cr(" bool %s = %s", name, value() ? "true" : "false");
@@ -736,7 +735,7 @@ static void scan_value(enum OptionType type, char* line, int& total_bytes_read,
success = parseMemLimit(line, value, bytes_read, errorbuf, buf_size);
} else {
// Is it a raw number?
- success = sscanf(line, "" INTX_FORMAT "%n", &value, &bytes_read) == 1;
+ success = sscanf(line, "%zd%n", &value, &bytes_read) == 1;
}
if (success) {
total_bytes_read += bytes_read;
@@ -754,7 +753,7 @@ static void scan_value(enum OptionType type, char* line, int& total_bytes_read,
success = parseMemStat(line, value, bytes_read, errorbuf, buf_size);
} else {
// parse as raw number
- success = sscanf(line, "" UINTX_FORMAT "%n", &value, &bytes_read) == 1;
+ success = sscanf(line, "%zu%n", &value, &bytes_read) == 1;
}
if (success) {
total_bytes_read += bytes_read;
diff --git a/src/hotspot/share/compiler/compilerThread.cpp b/src/hotspot/share/compiler/compilerThread.cpp
index e6329f3e65579..a72fc48b9a116 100644
--- a/src/hotspot/share/compiler/compilerThread.cpp
+++ b/src/hotspot/share/compiler/compilerThread.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compilationMemoryStatistic.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/compileTask.hpp"
diff --git a/src/hotspot/share/compiler/directivesParser.cpp b/src/hotspot/share/compiler/directivesParser.cpp
index 731bf33d799dd..72cc0612c492f 100644
--- a/src/hotspot/share/compiler/directivesParser.cpp
+++ b/src/hotspot/share/compiler/directivesParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/directivesParser.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/share/compiler/disassembler.cpp b/src/hotspot/share/compiler/disassembler.cpp
index 6556ce4ae1df2..f8313db66aa2d 100644
--- a/src/hotspot/share/compiler/disassembler.cpp
+++ b/src/hotspot/share/compiler/disassembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.hpp"
#include "ci/ciUtilities.hpp"
@@ -597,7 +596,7 @@ void decode_env::print_address(address adr) {
if (desc != nullptr) {
st->print("Stub::%s", desc->name());
if (desc->begin() != adr) {
- st->print(INTX_FORMAT_W(+) " " PTR_FORMAT, adr - desc->begin(), p2i(adr));
+ st->print("%+zd " PTR_FORMAT, adr - desc->begin(), p2i(adr));
} else if (WizardMode) {
st->print(" " PTR_FORMAT, p2i(adr));
}
diff --git a/src/hotspot/share/compiler/methodLiveness.cpp b/src/hotspot/share/compiler/methodLiveness.cpp
index 7d65b20a1595e..af21321e05d59 100644
--- a/src/hotspot/share/compiler/methodLiveness.cpp
+++ b/src/hotspot/share/compiler/methodLiveness.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciMethod.hpp"
#include "ci/ciMethodBlocks.hpp"
#include "ci/ciStreams.hpp"
diff --git a/src/hotspot/share/compiler/methodMatcher.cpp b/src/hotspot/share/compiler/methodMatcher.cpp
index 0bd5cdd8501fc..1f401d2e409b7 100644
--- a/src/hotspot/share/compiler/methodMatcher.cpp
+++ b/src/hotspot/share/compiler/methodMatcher.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/vmSymbols.hpp"
#include "compiler/compilerOracle.hpp"
diff --git a/src/hotspot/share/compiler/oopMap.cpp b/src/hotspot/share/compiler/oopMap.cpp
index 376057aa72e25..ea2c770d66f74 100644
--- a/src/hotspot/share/compiler/oopMap.cpp
+++ b/src/hotspot/share/compiler/oopMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
#include "code/nmethod.hpp"
@@ -929,7 +928,7 @@ void DerivedPointerTable::add(derived_pointer* derived_loc, derived_base* base_l
tty->print_cr(
"Add derived pointer@" INTPTR_FORMAT
" - Derived: " INTPTR_FORMAT
- " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: " INTX_FORMAT ")",
+ " Base: " INTPTR_FORMAT " (@" INTPTR_FORMAT ") (Offset: %zd)",
p2i(derived_loc), derived_pointer_value(*derived_loc), intptr_t(*base_loc), p2i(base_loc), offset
);
}
@@ -959,7 +958,7 @@ void DerivedPointerTable::update_pointers() {
if (TraceDerivedPointers) {
tty->print_cr("Updating derived pointer@" INTPTR_FORMAT
- " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: " INTX_FORMAT ")",
+ " - Derived: " INTPTR_FORMAT " Base: " INTPTR_FORMAT " (Offset: %zd)",
p2i(derived_loc), derived_pointer_value(*derived_loc), p2i(base), offset);
}
diff --git a/src/hotspot/share/gc/epsilon/epsilonArguments.cpp b/src/hotspot/share/gc/epsilon/epsilonArguments.cpp
index ba023e8799bc5..fc2ee7dff013b 100644
--- a/src/hotspot/share/gc/epsilon/epsilonArguments.cpp
+++ b/src/hotspot/share/gc/epsilon/epsilonArguments.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/epsilon/epsilonArguments.hpp"
#include "gc/epsilon/epsilonHeap.hpp"
#include "gc/shared/gcArguments.hpp"
@@ -46,7 +45,7 @@ void EpsilonArguments::initialize() {
}
if (EpsilonMaxTLABSize < MinTLABSize) {
- log_warning(gc)("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize);
+ log_warning(gc)("EpsilonMaxTLABSize < MinTLABSize, adjusting it to %zu", MinTLABSize);
EpsilonMaxTLABSize = MinTLABSize;
}
diff --git a/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp b/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp
index 6444ea344c2d5..e02da30d8e5ae 100644
--- a/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp
+++ b/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/epsilon/epsilonBarrierSet.hpp"
#include "gc/epsilon/epsilonThreadLocalData.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp
index 3cd5665e04534..8bc98835844ed 100644
--- a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp
+++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/epsilon/epsilonHeap.hpp"
#include "gc/epsilon/epsilonInitLogger.hpp"
#include "gc/epsilon/epsilonMemoryPool.hpp"
@@ -103,7 +102,7 @@ EpsilonHeap* EpsilonHeap::heap() {
}
HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
- assert(is_object_aligned(size), "Allocation size should be aligned: " SIZE_FORMAT, size);
+ assert(is_object_aligned(size), "Allocation size should be aligned: %zu", size);
HeapWord* res = nullptr;
while (true) {
@@ -129,7 +128,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
size_t unused_space = max_capacity() - used();
size_t want_space = MAX2(size_in_bytes, EpsilonMinHeapExpand);
assert(unused_space >= uncommitted_space,
- "Unused (" SIZE_FORMAT ") >= uncommitted (" SIZE_FORMAT ")",
+ "Unused (%zu) >= uncommitted (%zu)",
unused_space, uncommitted_space);
if (want_space < uncommitted_space) {
@@ -218,18 +217,18 @@ HeapWord* EpsilonHeap::allocate_new_tlab(size_t min_size,
// Check that adjustments did not break local and global invariants
assert(is_object_aligned(size),
- "Size honors object alignment: " SIZE_FORMAT, size);
+ "Size honors object alignment: %zu", size);
assert(min_size <= size,
- "Size honors min size: " SIZE_FORMAT " <= " SIZE_FORMAT, min_size, size);
+ "Size honors min size: %zu <= %zu", min_size, size);
assert(size <= _max_tlab_size,
- "Size honors max size: " SIZE_FORMAT " <= " SIZE_FORMAT, size, _max_tlab_size);
+ "Size honors max size: %zu <= %zu", size, _max_tlab_size);
assert(size <= CollectedHeap::max_tlab_size(),
- "Size honors global max size: " SIZE_FORMAT " <= " SIZE_FORMAT, size, CollectedHeap::max_tlab_size());
+ "Size honors global max size: %zu <= %zu", size, CollectedHeap::max_tlab_size());
if (log_is_enabled(Trace, gc)) {
ResourceMark rm;
- log_trace(gc)("TLAB size for \"%s\" (Requested: " SIZE_FORMAT "K, Min: " SIZE_FORMAT
- "K, Max: " SIZE_FORMAT "K, Ergo: " SIZE_FORMAT "K) -> " SIZE_FORMAT "K",
+ log_trace(gc)("TLAB size for \"%s\" (Requested: %zuK, Min: %zu"
+ "K, Max: %zuK, Ergo: %zuK) -> %zuK",
thread->name(),
requested_size * HeapWordSize / K,
min_size * HeapWordSize / K,
@@ -325,8 +324,8 @@ void EpsilonHeap::print_heap_info(size_t used) const {
size_t committed = capacity();
if (reserved != 0) {
- log_info(gc)("Heap: " SIZE_FORMAT "%s reserved, " SIZE_FORMAT "%s (%.2f%%) committed, "
- SIZE_FORMAT "%s (%.2f%%) used",
+ log_info(gc)("Heap: %zu%s reserved, %zu%s (%.2f%%) committed, "
+ "%zu%s (%.2f%%) used",
byte_size_in_proper_unit(reserved), proper_unit_for_byte_size(reserved),
byte_size_in_proper_unit(committed), proper_unit_for_byte_size(committed),
committed * 100.0 / reserved,
@@ -344,8 +343,8 @@ void EpsilonHeap::print_metaspace_info() const {
size_t used = stats.used();
if (reserved != 0) {
- log_info(gc, metaspace)("Metaspace: " SIZE_FORMAT "%s reserved, " SIZE_FORMAT "%s (%.2f%%) committed, "
- SIZE_FORMAT "%s (%.2f%%) used",
+ log_info(gc, metaspace)("Metaspace: %zu%s reserved, %zu%s (%.2f%%) committed, "
+ "%zu%s (%.2f%%) used",
byte_size_in_proper_unit(reserved), proper_unit_for_byte_size(reserved),
byte_size_in_proper_unit(committed), proper_unit_for_byte_size(committed),
committed * 100.0 / reserved,
diff --git a/src/hotspot/share/gc/epsilon/epsilonInitLogger.cpp b/src/hotspot/share/gc/epsilon/epsilonInitLogger.cpp
index a75e9e7679da7..fec5110fba338 100644
--- a/src/hotspot/share/gc/epsilon/epsilonInitLogger.cpp
+++ b/src/hotspot/share/gc/epsilon/epsilonInitLogger.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/epsilon/epsilonHeap.hpp"
#include "gc/epsilon/epsilonInitLogger.hpp"
#include "gc/shared/tlab_globals.hpp"
@@ -32,31 +31,31 @@
#include "utilities/globalDefinitions.hpp"
void EpsilonInitLogger::print_gc_specific() {
- // Warn users that non-resizable heap might be better for some configurations.
- // We are not adjusting the heap size by ourselves, because it affects startup time.
- if (InitialHeapSize != MaxHeapSize) {
- log_warning(gc, init)("Consider setting -Xms equal to -Xmx to avoid resizing hiccups");
- }
-
- // Warn users that AlwaysPreTouch might be better for some configurations.
- // We are not turning this on by ourselves, because it affects startup time.
- if (FLAG_IS_DEFAULT(AlwaysPreTouch) && !AlwaysPreTouch) {
- log_warning(gc, init)("Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups");
- }
-
if (UseTLAB) {
size_t max_tlab = EpsilonHeap::heap()->max_tlab_size() * HeapWordSize;
- log_info(gc, init)("TLAB Size Max: " SIZE_FORMAT "%s",
+ log_info(gc, init)("TLAB Size Max: %zu%s",
byte_size_in_exact_unit(max_tlab), exact_unit_for_byte_size(max_tlab));
if (EpsilonElasticTLAB) {
log_info(gc, init)("TLAB Size Elasticity: %.2fx", EpsilonTLABElasticity);
}
if (EpsilonElasticTLABDecay) {
- log_info(gc, init)("TLAB Size Decay Time: " SIZE_FORMAT "ms", EpsilonTLABDecayTime);
+ log_info(gc, init)("TLAB Size Decay Time: %zums", EpsilonTLABDecayTime);
}
} else {
log_info(gc, init)("TLAB: Disabled");
}
+
+ // Suggest that non-resizable heap might be better for some configurations.
+ // We are not adjusting the heap size by ourselves, because it affects startup time.
+ if (InitialHeapSize != MaxHeapSize) {
+ log_info(gc)("Consider setting -Xms equal to -Xmx to avoid resizing hiccups");
+ }
+
+ // Suggest that AlwaysPreTouch might be better for some configurations.
+ // We are not turning this on by ourselves, because it affects startup time.
+ if (FLAG_IS_DEFAULT(AlwaysPreTouch) && !AlwaysPreTouch) {
+ log_info(gc)("Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups");
+ }
}
void EpsilonInitLogger::print() {
diff --git a/src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp b/src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp
index b90d6e38d28d5..013b00d505a9f 100644
--- a/src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp
+++ b/src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/epsilon/epsilonHeap.hpp"
#include "gc/epsilon/epsilonMemoryPool.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp b/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp
index 93d84d5604ccf..55f15fb473dc9 100644
--- a/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp
+++ b/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/epsilon/epsilonMonitoringSupport.hpp"
#include "gc/epsilon/epsilonHeap.hpp"
#include "gc/shared/generationCounters.hpp"
diff --git a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp
index 449ff2e4acf8b..1e91e067f330b 100644
--- a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp
+++ b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_LIRGenerator.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "gc/g1/c1/g1BarrierSetC1.hpp"
diff --git a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
index 315aa469dbe56..7999efe54bf65 100644
--- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
+++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "code/vmreg.inline.hpp"
#include "gc/g1/c2/g1BarrierSetC2.hpp"
diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.cpp b/src/hotspot/share/gc/g1/g1AllocRegion.cpp
index a0a2b31ed6a18..47d7e3a6bffa7 100644
--- a/src/hotspot/share/gc/g1/g1AllocRegion.cpp
+++ b/src/hotspot/share/gc/g1/g1AllocRegion.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1AllocRegion.inline.hpp"
#include "gc/g1/g1EvacStats.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
@@ -225,10 +224,10 @@ void G1AllocRegion::trace(const char* str, size_t min_word_size, size_t desired_
if (detailed_info) {
if (result != nullptr) {
- out->print(" min " SIZE_FORMAT " desired " SIZE_FORMAT " actual " SIZE_FORMAT " " PTR_FORMAT,
+ out->print(" min %zu desired %zu actual %zu " PTR_FORMAT,
min_word_size, desired_word_size, actual_word_size, p2i(result));
} else if (min_word_size != 0) {
- out->print(" min " SIZE_FORMAT " desired " SIZE_FORMAT, min_word_size, desired_word_size);
+ out->print(" min %zu desired %zu", min_word_size, desired_word_size);
}
}
out->cr();
@@ -319,7 +318,7 @@ G1HeapRegion* MutatorAllocRegion::release() {
_wasted_bytes += retire_internal(_retained_alloc_region, false);
_retained_alloc_region = nullptr;
}
- log_debug(gc, alloc, region)("Mutator Allocation stats, regions: %u, wasted size: " SIZE_FORMAT "%s (%4.1f%%)",
+ log_debug(gc, alloc, region)("Mutator Allocation stats, regions: %u, wasted size: %zu%s (%4.1f%%)",
count(),
byte_size_in_proper_unit(_wasted_bytes),
proper_unit_for_byte_size(_wasted_bytes),
diff --git a/src/hotspot/share/gc/g1/g1Allocator.cpp b/src/hotspot/share/gc/g1/g1Allocator.cpp
index be8c39ba440b2..56dbeb9eac140 100644
--- a/src/hotspot/share/gc/g1/g1Allocator.cpp
+++ b/src/hotspot/share/gc/g1/g1Allocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1AllocRegion.inline.hpp"
#include "gc/g1/g1EvacInfo.hpp"
@@ -218,7 +217,7 @@ HeapWord* G1Allocator::par_allocate_during_gc(G1HeapRegionAttr dest,
size_t temp = 0;
HeapWord* result = par_allocate_during_gc(dest, word_size, word_size, &temp, node_index);
assert(result == nullptr || temp == word_size,
- "Requested " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT,
+ "Requested %zu words, but got %zu at " PTR_FORMAT,
word_size, temp, p2i(result));
return result;
}
diff --git a/src/hotspot/share/gc/g1/g1Analytics.cpp b/src/hotspot/share/gc/g1/g1Analytics.cpp
index 5809bfa2b6c5e..59d1a48cd8529 100644
--- a/src/hotspot/share/gc/g1/g1Analytics.cpp
+++ b/src/hotspot/share/gc/g1/g1Analytics.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/g1AnalyticsSequences.inline.hpp"
#include "gc/g1/g1Predictions.hpp"
diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp
index 1ae5f2ce76fef..b1cf9fd304620 100644
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp
@@ -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.
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "gc/g1/g1Arguments.hpp"
#include "gc/g1/g1CardSet.hpp"
diff --git a/src/hotspot/share/gc/g1/g1BarrierSet.cpp b/src/hotspot/share/gc/g1/g1BarrierSet.cpp
index 4eb3fcf600b04..c56434340cd5a 100644
--- a/src/hotspot/share/gc/g1/g1BarrierSet.cpp
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.inline.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1CardTable.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp b/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp
index ab67321242e71..ce0d53e4891cc 100644
--- a/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp
+++ b/src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.inline.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
#include "gc/g1/g1ThreadLocalData.hpp"
diff --git a/src/hotspot/share/gc/g1/g1BatchedTask.cpp b/src/hotspot/share/gc/g1/g1BatchedTask.cpp
index 804ec06688054..9089ffedf61de 100644
--- a/src/hotspot/share/gc/g1/g1BatchedTask.cpp
+++ b/src/hotspot/share/gc/g1/g1BatchedTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BatchedTask.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1BiasedArray.cpp b/src/hotspot/share/gc/g1/g1BiasedArray.cpp
index 22b07db3d85d6..05b8d7834e764 100644
--- a/src/hotspot/share/gc/g1/g1BiasedArray.cpp
+++ b/src/hotspot/share/gc/g1/g1BiasedArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BiasedArray.hpp"
#include "memory/padded.inline.hpp"
@@ -48,20 +47,20 @@ address G1BiasedMappedArrayBase::create_new_base_array(size_t length, size_t ele
#ifndef PRODUCT
void G1BiasedMappedArrayBase::verify_index(idx_t index) const {
guarantee(_base != nullptr, "Array not initialized");
- guarantee(index < length(), "Index out of bounds index: " SIZE_FORMAT " length: " SIZE_FORMAT, index, length());
+ guarantee(index < length(), "Index out of bounds index: %zu length: %zu", index, length());
}
void G1BiasedMappedArrayBase::verify_biased_index(idx_t biased_index) const {
guarantee(_biased_base != nullptr, "Array not initialized");
guarantee(biased_index >= bias() && biased_index < (bias() + length()),
- "Biased index out of bounds, index: " SIZE_FORMAT " bias: " SIZE_FORMAT " length: " SIZE_FORMAT,
+ "Biased index out of bounds, index: %zu bias: %zu length: %zu",
biased_index, bias(), length());
}
void G1BiasedMappedArrayBase::verify_biased_index_inclusive_end(idx_t biased_index) const {
guarantee(_biased_base != nullptr, "Array not initialized");
guarantee(biased_index >= bias() && biased_index <= (bias() + length()),
- "Biased index out of inclusive bounds, index: " SIZE_FORMAT " bias: " SIZE_FORMAT " length: " SIZE_FORMAT,
+ "Biased index out of inclusive bounds, index: %zu bias: %zu length: %zu",
biased_index, bias(), length());
}
diff --git a/src/hotspot/share/gc/g1/g1BiasedArray.hpp b/src/hotspot/share/gc/g1/g1BiasedArray.hpp
index 67b4c6bbe3084..da99f928ab599 100644
--- a/src/hotspot/share/gc/g1/g1BiasedArray.hpp
+++ b/src/hotspot/share/gc/g1/g1BiasedArray.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -72,12 +72,12 @@ class G1BiasedMappedArrayBase : public CHeapObj {
void initialize(HeapWord* bottom, HeapWord* end, size_t target_elem_size_in_bytes, size_t mapping_granularity_in_bytes) {
assert(mapping_granularity_in_bytes > 0, "just checking");
assert(is_power_of_2(mapping_granularity_in_bytes),
- "mapping granularity must be power of 2, is " SIZE_FORMAT, mapping_granularity_in_bytes);
+ "mapping granularity must be power of 2, is %zu", mapping_granularity_in_bytes);
assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0,
- "bottom mapping area address must be a multiple of mapping granularity " SIZE_FORMAT ", is " PTR_FORMAT,
+ "bottom mapping area address must be a multiple of mapping granularity %zu, is " PTR_FORMAT,
mapping_granularity_in_bytes, p2i(bottom));
assert((uintptr_t)end % mapping_granularity_in_bytes == 0,
- "end mapping area address must be a multiple of mapping granularity " SIZE_FORMAT ", is " PTR_FORMAT,
+ "end mapping area address must be a multiple of mapping granularity %zu, is " PTR_FORMAT,
mapping_granularity_in_bytes, p2i(end));
size_t num_target_elems = pointer_delta(end, bottom, mapping_granularity_in_bytes);
idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes;
diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp
index a8c558743184b..dcd1979343acb 100644
--- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp
+++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BlockOffsetTable.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1HeapRegion.inline.hpp"
@@ -44,7 +43,7 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st
_offset_base = ((uint8_t*)bot_reserved.start() - (uintptr_t(_reserved.start()) >> CardTable::card_shift()));
log_trace(gc, bot)("G1BlockOffsetTable::G1BlockOffsetTable: ");
- log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): " SIZE_FORMAT " rs end(): " PTR_FORMAT,
+ log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): %zu rs end(): " PTR_FORMAT,
p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end()));
}
diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
index e0454d803f1e4..59d5c4efcef21 100644
--- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
+++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -47,7 +47,7 @@ class G1BlockOffsetTable: public CHeapObj {
void check_offset(size_t offset, const char* msg) const {
assert(offset < CardTable::card_size_in_words(),
- "%s - offset: " SIZE_FORMAT ", N_words: %u",
+ "%s - offset: %zu, N_words: %u",
msg, offset, CardTable::card_size_in_words());
}
diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp
index 5c11a1a967700..57b7f91260ccd 100644
--- a/src/hotspot/share/gc/g1/g1CardSet.cpp
+++ b/src/hotspot/share/gc/g1/g1CardSet.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CardSet.inline.hpp"
#include "gc/g1/g1CardSetContainers.inline.hpp"
#include "gc/g1/g1CardSetMemory.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.cpp b/src/hotspot/share/gc/g1/g1CardSetContainers.cpp
index adee0a8e5a947..6ee1dfb2f95a5 100644
--- a/src/hotspot/share/gc/g1/g1CardSetContainers.cpp
+++ b/src/hotspot/share/gc/g1/g1CardSetContainers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CardSetContainers.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp
index 28ed698b248e7..6f683e777fb94 100644
--- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp
+++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CardSetContainers.inline.hpp"
#include "gc/g1/g1CardSetMemory.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CardTable.cpp b/src/hotspot/share/gc/g1/g1CardTable.cpp
index fa8203a1f58a6..303b8cda91fa3 100644
--- a/src/hotspot/share/gc/g1/g1CardTable.cpp
+++ b/src/hotspot/share/gc/g1/g1CardTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/shared/memset_with_concurrent_readers.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CodeRootSet.cpp b/src/hotspot/share/gc/g1/g1CodeRootSet.cpp
index e72e5e8d377ed..40534b9b4c98a 100644
--- a/src/hotspot/share/gc/g1/g1CodeRootSet.cpp
+++ b/src/hotspot/share/gc/g1/g1CodeRootSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "code/codeCache.hpp"
#include "code/nmethod.hpp"
#include "gc/g1/g1CodeRootSet.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index 91fc048e982d2..478c8f48f27ba 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/metadataOnStackMark.hpp"
#include "classfile/systemDictionary.hpp"
@@ -179,11 +178,11 @@ G1HeapRegion* G1CollectedHeap::new_region(size_t word_size,
// safepoint.
assert(SafepointSynchronize::is_at_safepoint(), "invariant");
- log_debug(gc, ergo, heap)("Attempt heap expansion (region allocation request failed). Allocation request: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Attempt heap expansion (region allocation request failed). Allocation request: %zuB",
word_size * HeapWordSize);
assert(word_size * HeapWordSize < G1HeapRegion::GrainBytes,
- "This kind of expansion should never be more than one region. Size: " SIZE_FORMAT,
+ "This kind of expansion should never be more than one region. Size: %zu",
word_size * HeapWordSize);
if (expand_single_region(node_index)) {
// Given that expand_single_region() succeeded in expanding the heap, and we
@@ -335,7 +334,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(G1HeapRegion* first_h
}
size_t G1CollectedHeap::humongous_obj_size_in_regions(size_t word_size) {
- assert(is_humongous(word_size), "Object of size " SIZE_FORMAT " must be humongous here", word_size);
+ assert(is_humongous(word_size), "Object of size %zu must be humongous here", word_size);
return align_up(word_size, G1HeapRegion::GrainWords) / G1HeapRegion::GrainWords;
}
@@ -358,7 +357,7 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size) {
humongous_start = _hrm.expand_and_allocate_humongous(obj_regions);
if (humongous_start != nullptr) {
// We managed to find a region by expanding the heap.
- log_debug(gc, ergo, heap)("Heap expansion (humongous allocation request). Allocation request: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Heap expansion (humongous allocation request). Allocation request: %zuB",
word_size * HeapWordSize);
policy()->record_new_heap_size(num_regions());
} else {
@@ -444,7 +443,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
return result;
}
- log_trace(gc, alloc)("%s: Unsuccessfully scheduled collection allocating " SIZE_FORMAT " words",
+ log_trace(gc, alloc)("%s: Unsuccessfully scheduled collection allocating %zu words",
Thread::current()->name(), word_size);
// We can reach here if we were unsuccessful in scheduling a collection (because
@@ -462,7 +461,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size) {
// Give a warning if we seem to be looping forever.
if ((QueuedAllocationWarningCount > 0) &&
(try_count % QueuedAllocationWarningCount == 0)) {
- log_warning(gc, alloc)("%s: Retried allocation %u times for " SIZE_FORMAT " words",
+ log_warning(gc, alloc)("%s: Retried allocation %u times for %zu words",
Thread::current()->name(), try_count, word_size);
}
}
@@ -495,8 +494,8 @@ HeapWord* G1CollectedHeap::alloc_archive_region(size_t word_size, HeapWord* pref
MemRegion reserved = _hrm.reserved();
if (reserved.word_size() <= word_size) {
- log_info(gc, heap)("Unable to allocate regions as archive heap is too large; size requested = " SIZE_FORMAT
- " bytes, heap = " SIZE_FORMAT " bytes", word_size, reserved.word_size());
+ log_info(gc, heap)("Unable to allocate regions as archive heap is too large; size requested = %zu"
+ " bytes, heap = %zu bytes", word_size, reserved.word_size());
return nullptr;
}
@@ -514,7 +513,7 @@ HeapWord* G1CollectedHeap::alloc_archive_region(size_t word_size, HeapWord* pref
}
increase_used(word_size * HeapWordSize);
if (commits != 0) {
- log_debug(gc, ergo, heap)("Attempt heap expansion (allocate archive regions). Total size: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Attempt heap expansion (allocate archive regions). Total size: %zuB",
G1HeapRegion::GrainWords * HeapWordSize * commits);
}
@@ -573,7 +572,7 @@ void G1CollectedHeap::dealloc_archive_regions(MemRegion range) {
iterate_regions_in_range(range, dealloc_archive_region);
if (shrink_count != 0) {
- log_debug(gc, ergo, heap)("Attempt heap shrinking (CDS archive regions). Total size: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Attempt heap shrinking (CDS archive regions). Total size: %zuB",
G1HeapRegion::GrainWords * HeapWordSize * shrink_count);
// Explicit uncommit.
uncommit_regions(shrink_count);
@@ -673,7 +672,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size) {
return result;
}
- log_trace(gc, alloc)("%s: Unsuccessfully scheduled collection allocating " SIZE_FORMAT "",
+ log_trace(gc, alloc)("%s: Unsuccessfully scheduled collection allocating %zu",
Thread::current()->name(), word_size);
// We can reach here if we were unsuccessful in scheduling a collection (because
@@ -978,7 +977,7 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size) {
_verifier->verify_region_sets_optional();
size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes);
- log_debug(gc, ergo, heap)("Attempt heap expansion (allocation request failed). Allocation request: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Attempt heap expansion (allocation request failed). Allocation request: %zuB",
word_size * HeapWordSize);
@@ -995,7 +994,7 @@ bool G1CollectedHeap::expand(size_t expand_bytes, WorkerThreads* pretouch_worker
size_t aligned_expand_bytes = os::align_up_vm_page_size(expand_bytes);
aligned_expand_bytes = align_up(aligned_expand_bytes, G1HeapRegion::GrainBytes);
- log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount: " SIZE_FORMAT "B expansion amount: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount: %zuB expansion amount: %zuB",
expand_bytes, aligned_expand_bytes);
if (is_maximal_no_gc()) {
@@ -1042,7 +1041,7 @@ void G1CollectedHeap::shrink_helper(size_t shrink_bytes) {
uint num_regions_removed = _hrm.shrink_by(num_regions_to_remove);
size_t shrunk_bytes = num_regions_removed * G1HeapRegion::GrainBytes;
- log_debug(gc, ergo, heap)("Shrink the heap. requested shrinking amount: " SIZE_FORMAT "B aligned shrinking amount: " SIZE_FORMAT "B actual amount shrunk: " SIZE_FORMAT "B",
+ log_debug(gc, ergo, heap)("Shrink the heap. requested shrinking amount: %zuB aligned shrinking amount: %zuB actual amount shrunk: %zuB",
shrink_bytes, aligned_shrink_bytes, shrunk_bytes);
if (num_regions_removed > 0) {
log_debug(gc, heap)("Uncommittable regions after shrink: %u", num_regions_removed);
@@ -2117,12 +2116,12 @@ void G1CollectedHeap::print_on(outputStream* st) const {
p2i(_hrm.reserved().start()),
p2i(_hrm.reserved().end()));
st->cr();
- st->print(" region size " SIZE_FORMAT "K, ", G1HeapRegion::GrainBytes / K);
+ st->print(" region size %zuK, ", G1HeapRegion::GrainBytes / K);
uint young_regions = young_regions_count();
- st->print("%u young (" SIZE_FORMAT "K), ", young_regions,
+ st->print("%u young (%zuK), ", young_regions,
(size_t) young_regions * G1HeapRegion::GrainBytes / K);
uint survivor_regions = survivor_regions_count();
- st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions,
+ st->print("%u survivors (%zuK)", survivor_regions,
(size_t) survivor_regions * G1HeapRegion::GrainBytes / K);
st->cr();
if (_numa->is_enabled()) {
@@ -2774,7 +2773,7 @@ void G1CollectedHeap::increase_used(size_t bytes) {
void G1CollectedHeap::decrease_used(size_t bytes) {
assert(_summary_bytes_used >= bytes,
- "invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
+ "invariant: _summary_bytes_used: %zu should be >= bytes: %zu",
_summary_bytes_used, bytes);
_summary_bytes_used -= bytes;
}
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
index 1b840392769cd..73dfc85bb1bc0 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -361,8 +361,8 @@ class G1CollectedHeap : public CollectedHeap {
do { \
size_t cur_used_bytes = g1h->used(); \
size_t recal_used_bytes = g1h->recalculate_used(); \
- assert(cur_used_bytes == recal_used_bytes, "Used(" SIZE_FORMAT ") is not" \
- " same as recalculated used(" SIZE_FORMAT ").", \
+ assert(cur_used_bytes == recal_used_bytes, "Used(%zu) is not" \
+ " same as recalculated used(%zu).", \
cur_used_bytes, recal_used_bytes); \
} while (0)
#else
diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.cpp b/src/hotspot/share/gc/g1/g1CollectionSet.cpp
index ec90fd377503d..91c13183c4bee 100644
--- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectionSet.hpp"
@@ -284,7 +283,7 @@ double G1CollectionSet::finalize_young_part(double target_pause_time_ms, G1Survi
size_t pending_cards = _policy->pending_cards_at_gc_start();
- log_trace(gc, ergo, cset)("Start choosing CSet. Pending cards: " SIZE_FORMAT " target pause time: %1.2fms",
+ log_trace(gc, ergo, cset)("Start choosing CSet. Pending cards: %zu target pause time: %1.2fms",
pending_cards, target_pause_time_ms);
// The young list is laid with the survivor regions from the previous
diff --git a/src/hotspot/share/gc/g1/g1CollectionSetCandidates.cpp b/src/hotspot/share/gc/g1/g1CollectionSetCandidates.cpp
index 05e6457c095a5..1c3134eee6471 100644
--- a/src/hotspot/share/gc/g1/g1CollectionSetCandidates.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectionSetCandidates.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectionSetCandidates.inline.hpp"
#include "gc/g1/g1CollectionSetChooser.hpp"
#include "gc/g1/g1HeapRegion.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp b/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp
index 630fb8a7a1122..28ca72a238115 100644
--- a/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectionSetChooser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectionSetCandidates.hpp"
#include "gc/g1/g1CollectionSetChooser.hpp"
@@ -224,7 +223,7 @@ class G1BuildCandidateRegionsTask : public WorkerTask {
num_pruned++;
}
- log_debug(gc, ergo, cset)("Pruned %u regions out of %u, leaving " SIZE_FORMAT " bytes waste (allowed " SIZE_FORMAT ")",
+ log_debug(gc, ergo, cset)("Pruned %u regions out of %u, leaving %zu bytes waste (allowed %zu)",
num_pruned,
num_candidates,
wasted_bytes,
diff --git a/src/hotspot/share/gc/g1/g1CollectorState.cpp b/src/hotspot/share/gc/g1/g1CollectorState.cpp
index 581ab4f16bf63..d41ee22fdcead 100644
--- a/src/hotspot/share/gc/g1/g1CollectorState.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectorState.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1GCPauseType.hpp"
diff --git a/src/hotspot/share/gc/g1/g1CommittedRegionMap.cpp b/src/hotspot/share/gc/g1/g1CommittedRegionMap.cpp
index 6919cc7d0c911..d8454cd5cf88c 100644
--- a/src/hotspot/share/gc/g1/g1CommittedRegionMap.cpp
+++ b/src/hotspot/share/gc/g1/g1CommittedRegionMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CommittedRegionMap.inline.hpp"
#include "logging/log.hpp"
#include "memory/universe.hpp"
@@ -233,7 +232,7 @@ void G1CommittedRegionMap::verify_free_range(uint start, uint end) const {
void G1CommittedRegionMap::verify_no_inactive_regons() const {
BitMap::idx_t first_inactive = _inactive.find_first_set_bit(0);
- assert(first_inactive == _inactive.size(), "Should be no inactive regions, but was at index: " SIZE_FORMAT, first_inactive);
+ assert(first_inactive == _inactive.size(), "Should be no inactive regions, but was at index: %zu", first_inactive);
}
void G1CommittedRegionMap::verify_active_count(uint start, uint end, uint expected) const {
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
index d0879e9967cd3..3558138ad5b24 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/g1/g1BarrierSet.hpp"
@@ -140,7 +139,7 @@ bool G1CMMarkStack::initialize() {
log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (uint)(MarkStackSize / K), (uint)(MarkStackSizeMax / K));
- log_debug(gc)("Initialize mark stack with " SIZE_FORMAT " chunks, maximum " SIZE_FORMAT,
+ log_debug(gc)("Initialize mark stack with %zu chunks, maximum %zu",
initial_num_chunks, max_capacity);
return _chunk_allocator.initialize(initial_num_chunks, max_num_chunks);
@@ -205,7 +204,7 @@ bool G1CMMarkStack::ChunkAllocator::initialize(size_t initial_capacity, size_t m
size_t new_capacity = bucket_size(0);
if (!reserve(new_capacity)) {
- log_warning(gc)("Failed to reserve memory for new overflow mark stack with " SIZE_FORMAT " chunks and size " SIZE_FORMAT "B.", new_capacity, new_capacity * sizeof(TaskQueueEntryChunk));
+ log_warning(gc)("Failed to reserve memory for new overflow mark stack with %zu chunks and size %zuB.", new_capacity, new_capacity * sizeof(TaskQueueEntryChunk));
return false;
}
return true;
@@ -213,7 +212,7 @@ bool G1CMMarkStack::ChunkAllocator::initialize(size_t initial_capacity, size_t m
bool G1CMMarkStack::ChunkAllocator::try_expand_to(size_t desired_capacity) {
if (_capacity == _max_capacity) {
- log_debug(gc)("Can not expand overflow mark stack further, already at maximum capacity of " SIZE_FORMAT " chunks.", _capacity);
+ log_debug(gc)("Can not expand overflow mark stack further, already at maximum capacity of %zu chunks.", _capacity);
return false;
}
@@ -221,7 +220,7 @@ bool G1CMMarkStack::ChunkAllocator::try_expand_to(size_t desired_capacity) {
desired_capacity = MIN2(desired_capacity, _max_capacity);
if (reserve(desired_capacity)) {
- log_debug(gc)("Expanded the mark stack capacity from " SIZE_FORMAT " to " SIZE_FORMAT " chunks",
+ log_debug(gc)("Expanded the mark stack capacity from %zu to %zu chunks",
old_capacity, desired_capacity);
return true;
}
@@ -249,7 +248,7 @@ G1CMMarkStack::ChunkAllocator::~ChunkAllocator() {
}
bool G1CMMarkStack::ChunkAllocator::reserve(size_t new_capacity) {
- assert(new_capacity <= _max_capacity, "Cannot expand overflow mark stack beyond the max_capacity" SIZE_FORMAT " chunks.", _max_capacity);
+ assert(new_capacity <= _max_capacity, "Cannot expand overflow mark stack beyond the max_capacity of %zu chunks.", _max_capacity);
size_t highest_bucket = get_bucket(new_capacity - 1);
size_t i = get_bucket(_capacity);
@@ -273,7 +272,7 @@ bool G1CMMarkStack::ChunkAllocator::reserve(size_t new_capacity) {
TaskQueueEntryChunk* bucket_base = MmapArrayAllocator::allocate_or_null(bucket_capacity, mtGC);
if (bucket_base == nullptr) {
- log_warning(gc)("Failed to reserve memory for increasing the overflow mark stack capacity with " SIZE_FORMAT " chunks and size " SIZE_FORMAT "B.",
+ log_warning(gc)("Failed to reserve memory for increasing the overflow mark stack capacity with %zu chunks and size %zuB.",
bucket_capacity, bucket_capacity * sizeof(TaskQueueEntryChunk));
return false;
}
@@ -384,7 +383,7 @@ void G1CMRootMemRegions::reset() {
void G1CMRootMemRegions::add(HeapWord* start, HeapWord* end) {
assert_at_safepoint();
size_t idx = Atomic::fetch_then_add(&_num_root_regions, 1u);
- assert(idx < _max_regions, "Trying to add more root MemRegions than there is space " SIZE_FORMAT, _max_regions);
+ assert(idx < _max_regions, "Trying to add more root MemRegions than there is space %zu", _max_regions);
assert(start != nullptr && end != nullptr && start <= end, "Start (" PTR_FORMAT ") should be less or equal to "
"end (" PTR_FORMAT ")", p2i(start), p2i(end));
_root_regions[idx].set_start(start);
@@ -446,7 +445,7 @@ void G1CMRootMemRegions::scan_finished() {
if (!_should_abort) {
assert(_claimed_root_regions >= num_root_regions(),
- "we should have claimed all root regions, claimed " SIZE_FORMAT ", length = %u",
+ "we should have claimed all root regions, claimed %zu, length = %u",
_claimed_root_regions, num_root_regions());
}
@@ -790,7 +789,7 @@ void G1ConcurrentMark::clear_bitmap(WorkerThreads* workers, bool may_yield) {
G1ClearBitMapTask cl(this, num_workers, may_yield);
- log_debug(gc, ergo)("Running %s with %u workers for " SIZE_FORMAT " work units.", cl.name(), num_workers, num_chunks);
+ log_debug(gc, ergo)("Running %s with %u workers for %zu work units.", cl.name(), num_workers, num_chunks);
workers->run_task(&cl, num_workers);
guarantee(may_yield || cl.is_complete(), "Must have completed iteration when not yielding.");
}
@@ -1737,7 +1736,7 @@ void G1ConcurrentMark::weak_refs_work() {
// We can not trust g1_is_alive and the contents of the heap if the marking stack
// overflowed while processing references. Exit the VM.
fatal("Overflow during reference processing, can not continue. Current mark stack depth: "
- SIZE_FORMAT ", MarkStackSize: " SIZE_FORMAT ", MarkStackSizeMax: " SIZE_FORMAT ". "
+ "%zu, MarkStackSize: %zu, MarkStackSizeMax: %zu. "
"Please increase MarkStackSize and/or MarkStackSizeMax and restart.",
_global_mark_stack.size(), MarkStackSize, MarkStackSizeMax);
return;
@@ -1882,7 +1881,7 @@ void G1ConcurrentMark::finalize_marking() {
SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set();
guarantee(has_overflown() ||
satb_mq_set.completed_buffers_num() == 0,
- "Invariant: has_overflown = %s, num buffers = " SIZE_FORMAT,
+ "Invariant: has_overflown = %s, num buffers = %zu",
BOOL_TO_STR(has_overflown()),
satb_mq_set.completed_buffers_num());
@@ -1898,7 +1897,7 @@ void G1ConcurrentMark::flush_all_task_caches() {
misses += stats.second;
}
size_t sum = hits + misses;
- log_debug(gc, stats)("Mark stats cache hits " SIZE_FORMAT " misses " SIZE_FORMAT " ratio %1.3lf",
+ log_debug(gc, stats)("Mark stats cache hits %zu misses %zu ratio %1.3lf",
hits, misses, percent_of(hits, sum));
}
@@ -2475,7 +2474,7 @@ void G1CMTask::print_stats() {
_step_times_ms.sum());
size_t const hits = _mark_stats_cache.hits();
size_t const misses = _mark_stats_cache.misses();
- log_debug(gc, stats)(" Mark Stats Cache: hits " SIZE_FORMAT " misses " SIZE_FORMAT " ratio %.3f",
+ log_debug(gc, stats)(" Mark Stats Cache: hits %zu misses %zu ratio %.3f",
hits, misses, percent_of(hits, hits + misses));
}
@@ -2976,7 +2975,7 @@ G1CMTask::G1CMTask(uint worker_id,
#define G1PPRL_TYPE_H_FORMAT " %4s"
#define G1PPRL_STATE_FORMAT " %-5s"
#define G1PPRL_STATE_H_FORMAT " %5s"
-#define G1PPRL_BYTE_FORMAT " " SIZE_FORMAT_W(9)
+#define G1PPRL_BYTE_FORMAT " %9zu"
#define G1PPRL_BYTE_H_FORMAT " %9s"
#define G1PPRL_DOUBLE_FORMAT "%14.1f"
#define G1PPRL_GCEFF_FORMAT " %14s"
@@ -2984,7 +2983,7 @@ G1CMTask::G1CMTask(uint worker_id,
// For summary info
#define G1PPRL_SUM_ADDR_FORMAT(tag) " " tag ":" G1PPRL_ADDR_BASE_FORMAT
-#define G1PPRL_SUM_BYTE_FORMAT(tag) " " tag ": " SIZE_FORMAT
+#define G1PPRL_SUM_BYTE_FORMAT(tag) " " tag ": %zu"
#define G1PPRL_SUM_MB_FORMAT(tag) " " tag ": %1.2f MB"
#define G1PPRL_SUM_MB_PERC_FORMAT(tag) G1PPRL_SUM_MB_FORMAT(tag) " / %1.2f %%"
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp
index 039169794c543..c5ad269ae6902 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -92,7 +92,7 @@ inline void G1CMMarkStack::iterate(Fn fn) const {
TaskQueueEntryChunk* cur = _chunk_list;
while (cur != nullptr) {
- guarantee(num_chunks <= _chunks_in_chunk_list, "Found " SIZE_FORMAT " oop chunks which is more than there should be", num_chunks);
+ guarantee(num_chunks <= _chunks_in_chunk_list, "Found %zu oop chunks which is more than there should be", num_chunks);
for (size_t i = 0; i < EntriesPerChunk; ++i) {
if (cur->data[i].is_null()) {
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.cpp
index 4506fda30dabe..3d2e6c0f84906 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1HeapRegion.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
index ee1b1d6555a36..7f62e5527d5df 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
@@ -48,7 +47,7 @@ size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* sta
}
size_t G1CMObjArrayProcessor::process_obj(oop obj) {
- assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), obj->size());
+ assert(should_be_sliced(obj), "Must be an array object %d and large %zu", obj->is_objArray(), obj->size());
return process_array_slice(objArrayOop(obj), cast_from_oop(obj), objArrayOop(obj)->size());
}
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp
index 37e76a73fe79c..83d547966ed47 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp
index f62d42069004f..993df8b47ce3d 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRebuildAndScrub.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1ConcurrentRebuildAndScrub.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
index 8357737ef6a7d..2e48e438fc955 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CollectionSet.hpp"
#include "gc/g1/g1ConcurrentRefine.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp
index 3e8f83326b270..7f0bcc5b50fcc 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1ConcurrentRefineStats.hpp"
G1ConcurrentRefineStats::G1ConcurrentRefineStats() :
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp
index ed69ac08d1bf0..da1f85eba7343 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1ConcurrentRefine.hpp"
#include "gc/g1/g1ConcurrentRefineStats.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineThreadsNeeded.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineThreadsNeeded.cpp
index b016ff87adca4..d34229bd35942 100644
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThreadsNeeded.cpp
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThreadsNeeded.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,12 +22,12 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/g1ConcurrentRefineThreadsNeeded.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1Policy.hpp"
#include "utilities/globalDefinitions.hpp"
+
#include
G1ConcurrentRefineThreadsNeeded::G1ConcurrentRefineThreadsNeeded(G1Policy* policy,
diff --git a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
index 96c212bd2ed28..a2b463ecb347f 100644
--- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
+++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.inline.hpp"
#include "gc/g1/g1CardTableEntryClosure.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
@@ -174,7 +173,7 @@ void G1DirtyCardQueueSet::verify_num_cards() const {
actual += cur->size();
}
assert(actual == Atomic::load(&_num_cards),
- "Num entries in completed buffers should be " SIZE_FORMAT " but are " SIZE_FORMAT,
+ "Num entries in completed buffers should be %zu but are %zu",
Atomic::load(&_num_cards), actual);
}
#endif // ASSERT
diff --git a/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp b/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp
index afc1602639a30..86ceb40e97edb 100644
--- a/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp
+++ b/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BatchedTask.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1EvacStats.cpp b/src/hotspot/share/gc/g1/g1EvacStats.cpp
index e632dd2eeddb2..b0e5f7b6864f2 100644
--- a/src/hotspot/share/gc/g1/g1EvacStats.cpp
+++ b/src/hotspot/share/gc/g1/g1EvacStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1EvacStats.hpp"
#include "gc/shared/gcId.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FreeIdSet.cpp b/src/hotspot/share/gc/g1/g1FreeIdSet.cpp
index e3cb99acf8da6..6ff863920df23 100644
--- a/src/hotspot/share/gc/g1/g1FreeIdSet.cpp
+++ b/src/hotspot/share/gc/g1/g1FreeIdSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1FreeIdSet.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FromCardCache.cpp b/src/hotspot/share/gc/g1/g1FromCardCache.cpp
index 062130f40ab7f..4a29bcbc6dc41 100644
--- a/src/hotspot/share/gc/g1/g1FromCardCache.cpp
+++ b/src/hotspot/share/gc/g1/g1FromCardCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1ConcurrentRefine.hpp"
#include "gc/g1/g1DirtyCardQueue.hpp"
#include "gc/g1/g1FromCardCache.hpp"
@@ -57,7 +56,7 @@ void G1FromCardCache::initialize(uint max_reserved_regions) {
void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
guarantee((size_t)start_idx + new_num_regions <= max_uintx,
- "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT,
+ "Trying to invalidate beyond maximum region, from %u size %zu",
start_idx, new_num_regions);
uint end_idx = (start_idx + (uint)new_num_regions);
assert(end_idx <= _max_reserved_regions, "Must be within max.");
@@ -73,7 +72,7 @@ void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
void G1FromCardCache::print(outputStream* out) {
for (uint i = 0; i < num_par_rem_sets(); i++) {
for (uint j = 0; j < _max_reserved_regions; j++) {
- out->print_cr("_from_card_cache[%u][%u] = " SIZE_FORMAT ".",
+ out->print_cr("_from_card_cache[%u][%u] = %zu.",
i, j, at(i, j));
}
}
diff --git a/src/hotspot/share/gc/g1/g1FullCollector.cpp b/src/hotspot/share/gc/g1/g1FullCollector.cpp
index 5789b44e6189e..6a4e517178680 100644
--- a/src/hotspot/share/gc/g1/g1FullCollector.cpp
+++ b/src/hotspot/share/gc/g1/g1FullCollector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1FullCollector.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp
index 0d4adbe632e39..9a1dd4d1ff54e 100644
--- a/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
index bee3656ead5e4..cc71cf861720b 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullCollector.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
index ddd1b7c0999b8..d9d1957fc72bb 100644
--- a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1FullCollector.inline.hpp"
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1HeapRegion.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp
index 288331b398f7b..25002186280d8 100644
--- a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCMarker.cpp b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp
index 8fcc957b1682b..f3a8d23cbba3d 100644
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp b/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp
index ebc7852d150e7..d9cf64a365589 100644
--- a/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
index bed17e91ae9fb..86297086b444d 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullCollector.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp
index 1d2a023ed3a64..f9868bba67893 100644
--- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp
+++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -107,7 +107,7 @@ inline bool G1DetermineCompactionQueueClosure::do_heap_region(G1HeapRegion* hr)
// Too many live objects in the region; skip compacting it.
_collector->update_from_compacting_to_skip_compacting(hr->hrm_index());
- log_trace(gc, phases)("Phase 2: skip compaction region index: %u, live words: " SIZE_FORMAT,
+ log_trace(gc, phases)("Phase 2: skip compaction region index: %u, live words: %zu",
hr->hrm_index(), _collector->live_words(hr->hrm_index()));
}
diff --git a/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.cpp b/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.cpp
index 2022ff795256d..610cba9852147 100644
--- a/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1FullCollector.inline.hpp"
#include "gc/g1/g1FullGCResetMetadataTask.hpp"
#include "utilities/ticks.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCScope.cpp b/src/hotspot/share/gc/g1/g1FullGCScope.cpp
index 9352b7df2d9bf..5879442b82b12 100644
--- a/src/hotspot/share/gc/g1/g1FullGCScope.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCScope.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/share/gc/g1/g1FullGCTask.cpp b/src/hotspot/share/gc/g1/g1FullGCTask.cpp
index b9faa7af60375..633eae186e21e 100644
--- a/src/hotspot/share/gc/g1/g1FullGCTask.cpp
+++ b/src/hotspot/share/gc/g1/g1FullGCTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "logging/log.hpp"
#include "utilities/ticks.hpp"
diff --git a/src/hotspot/share/gc/g1/g1GCCounters.cpp b/src/hotspot/share/gc/g1/g1GCCounters.cpp
index bd9546e799164..9133b28d896ff 100644
--- a/src/hotspot/share/gc/g1/g1GCCounters.cpp
+++ b/src/hotspot/share/gc/g1/g1GCCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1GCCounters.hpp"
diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
index 4ec708ae09392..6d98dc220ffb0 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
@@ -405,7 +404,7 @@ void G1GCPhaseTimes::trace_time(const char* name, double value) const {
}
void G1GCPhaseTimes::trace_count(const char* name, size_t value) const {
- log_trace(gc, phases)(" %s: " SIZE_FORMAT, name, value);
+ log_trace(gc, phases)(" %s: %zu", name, value);
}
double G1GCPhaseTimes::print_pre_evacuate_collection_set() const {
diff --git a/src/hotspot/share/gc/g1/g1HeapRegion.cpp b/src/hotspot/share/gc/g1/g1HeapRegion.cpp
index 9cb2650f8208c..0377b82a65ccb 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegion.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1BlockOffsetTable.inline.hpp"
@@ -389,7 +388,7 @@ bool G1HeapRegion::verify_code_roots(VerifyOption vo) const {
if (is_empty()) {
bool has_code_roots = code_roots_length > 0;
if (has_code_roots) {
- log_error(gc, verify)("region " HR_FORMAT " is empty but has " SIZE_FORMAT " code root entries",
+ log_error(gc, verify)("region " HR_FORMAT " is empty but has %zu code root entries",
HR_FORMAT_PARAMS(this), code_roots_length);
}
return has_code_roots;
@@ -398,7 +397,7 @@ bool G1HeapRegion::verify_code_roots(VerifyOption vo) const {
if (is_continues_humongous()) {
bool has_code_roots = code_roots_length > 0;
if (has_code_roots) {
- log_error(gc, verify)("region " HR_FORMAT " is a continuation of a humongous region but has " SIZE_FORMAT " code root entries",
+ log_error(gc, verify)("region " HR_FORMAT " is a continuation of a humongous region but has %zu code root entries",
HR_FORMAT_PARAMS(this), code_roots_length);
}
return has_code_roots;
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionEventSender.cpp b/src/hotspot/share/gc/g1/g1HeapRegionEventSender.cpp
index 3be3ec2410c7e..79a2688e6b466 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionEventSender.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionEventSender.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1HeapRegionEventSender.hpp"
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp b/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp
index 9fb56f7c58fb2..016b2046265d8 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Arguments.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentRefine.hpp"
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp
index c1343fd7dbffc..7196e8b2db26c 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionRemSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BlockOffsetTable.inline.hpp"
#include "gc/g1/g1CardSetContainers.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
@@ -98,7 +97,7 @@ G1MonotonicArenaMemoryStats G1HeapRegionRemSet::card_set_memory_stats() const {
}
void G1HeapRegionRemSet::print_static_mem_size(outputStream* out) {
- out->print_cr(" Static structures = " SIZE_FORMAT, G1HeapRegionRemSet::static_mem_size());
+ out->print_cr(" Static structures = %zu", G1HeapRegionRemSet::static_mem_size());
}
// Code roots support
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionSet.cpp b/src/hotspot/share/gc/g1/g1HeapRegionSet.cpp
index 38796239168ef..70186adcdfcee 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionSet.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionSet.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1HeapRegionRemSet.inline.hpp"
#include "gc/g1/g1HeapRegionSet.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionTracer.cpp b/src/hotspot/share/gc/g1/g1HeapRegionTracer.cpp
index 749b7d2d1f5cc..2517b53c17c95 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionTracer.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1HeapRegionTracer.hpp"
#include "jfr/jfrEvents.hpp"
diff --git a/src/hotspot/share/gc/g1/g1HeapRegionType.cpp b/src/hotspot/share/gc/g1/g1HeapRegionType.cpp
index c6d38e341be33..ba6bf7e870de8 100644
--- a/src/hotspot/share/gc/g1/g1HeapRegionType.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapRegionType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1HeapRegionTraceType.hpp"
#include "gc/g1/g1HeapRegionType.hpp"
diff --git a/src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp b/src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp
index e8642e59cb4a4..c35ce7c356d28 100644
--- a/src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1HeapSizingPolicy.hpp"
@@ -74,7 +73,7 @@ static void log_expansion(double short_term_pause_time_ratio,
log_debug(gc, ergo, heap)("Heap expansion: "
"short term pause time ratio %1.2f%% long term pause time ratio %1.2f%% "
"threshold %1.2f%% pause time ratio %1.2f%% fully expanded %s "
- "resize by " SIZE_FORMAT "B",
+ "resize by %zuB",
short_term_pause_time_ratio * 100.0,
long_term_pause_time_ratio * 100.0,
threshold * 100.0,
@@ -240,8 +239,8 @@ size_t G1HeapSizingPolicy::full_collection_resize_amount(bool& expand) {
// This assert only makes sense here, before we adjust them
// with respect to the min and max heap size.
assert(minimum_desired_capacity <= maximum_desired_capacity,
- "minimum_desired_capacity = " SIZE_FORMAT ", "
- "maximum_desired_capacity = " SIZE_FORMAT,
+ "minimum_desired_capacity = %zu, "
+ "maximum_desired_capacity = %zu",
minimum_desired_capacity, maximum_desired_capacity);
// Should not be greater than the heap max size. No need to adjust
@@ -258,8 +257,8 @@ size_t G1HeapSizingPolicy::full_collection_resize_amount(bool& expand) {
size_t expand_bytes = minimum_desired_capacity - capacity_after_gc;
log_debug(gc, ergo, heap)("Attempt heap expansion (capacity lower than min desired capacity). "
- "Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B live: " SIZE_FORMAT "B "
- "min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)",
+ "Capacity: %zuB occupancy: %zuB live: %zuB "
+ "min_desired_capacity: %zuB (%zu %%)",
capacity_after_gc, used_after_gc, _g1h->used(), minimum_desired_capacity, MinHeapFreeRatio);
expand = true;
@@ -270,8 +269,8 @@ size_t G1HeapSizingPolicy::full_collection_resize_amount(bool& expand) {
size_t shrink_bytes = capacity_after_gc - maximum_desired_capacity;
log_debug(gc, ergo, heap)("Attempt heap shrinking (capacity higher than max desired capacity). "
- "Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B live: " SIZE_FORMAT "B "
- "maximum_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)",
+ "Capacity: %zuB occupancy: %zuB live: %zuB "
+ "maximum_desired_capacity: %zuB (%zu %%)",
capacity_after_gc, used_after_gc, _g1h->used(), maximum_desired_capacity, MaxHeapFreeRatio);
expand = false;
diff --git a/src/hotspot/share/gc/g1/g1HeapTransition.cpp b/src/hotspot/share/gc/g1/g1HeapTransition.cpp
index 815b701c4be90..30ad4c72bf663 100644
--- a/src/hotspot/share/gc/g1/g1HeapTransition.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapTransition.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1HeapTransition.hpp"
#include "gc/g1/g1Policy.hpp"
@@ -96,7 +95,7 @@ class G1HeapTransition::DetailedUsageClosure: public G1HeapRegionClosure {
_usage._humongous_used += r->used();
_usage._humongous_region_count++;
} else {
- assert(r->used() == 0, "Expected used to be 0 but it was " SIZE_FORMAT, r->used());
+ assert(r->used() == 0, "Expected used to be 0 but it was %zu", r->used());
}
return false;
}
@@ -109,7 +108,7 @@ static void log_regions(const char* msg, size_t before_length, size_t after_leng
if (lt.is_enabled()) {
LogStream ls(lt);
- ls.print("%s regions: " SIZE_FORMAT "->" SIZE_FORMAT "(" SIZE_FORMAT ")",
+ ls.print("%s regions: %zu->%zu(%zu)",
msg, before_length, after_length, capacity);
// Not null only if gc+heap+numa at Debug level is enabled.
if (before_per_node_length != nullptr && after_per_node_length != nullptr) {
@@ -141,12 +140,12 @@ void G1HeapTransition::print() {
DetailedUsageClosure blk;
_g1_heap->heap_region_iterate(&blk);
usage = blk._usage;
- assert(usage._eden_region_count == 0, "Expected no eden regions, but got " SIZE_FORMAT, usage._eden_region_count);
- assert(usage._survivor_region_count == after._survivor_length, "Expected survivors to be " SIZE_FORMAT " but was " SIZE_FORMAT,
+ assert(usage._eden_region_count == 0, "Expected no eden regions, but got %zu", usage._eden_region_count);
+ assert(usage._survivor_region_count == after._survivor_length, "Expected survivors to be %zu but was %zu",
after._survivor_length, usage._survivor_region_count);
- assert(usage._old_region_count == after._old_length, "Expected old to be " SIZE_FORMAT " but was " SIZE_FORMAT,
+ assert(usage._old_region_count == after._old_length, "Expected old to be %zu but was %zu",
after._old_length, usage._old_region_count);
- assert(usage._humongous_region_count == after._humongous_length, "Expected humongous to be " SIZE_FORMAT " but was " SIZE_FORMAT,
+ assert(usage._humongous_region_count == after._humongous_length, "Expected humongous to be %zu but was %zu",
after._humongous_length, usage._humongous_region_count);
}
@@ -156,17 +155,17 @@ void G1HeapTransition::print() {
log_regions("Survivor", _before._survivor_length, after._survivor_length, survivor_capacity_length_before_gc,
_before._survivor_length_per_node, after._survivor_length_per_node);
- log_trace(gc, heap)(" Used: " SIZE_FORMAT "K, Waste: " SIZE_FORMAT "K",
+ log_trace(gc, heap)(" Used: %zuK, Waste: %zuK",
usage._survivor_used / K, ((after._survivor_length * G1HeapRegion::GrainBytes) - usage._survivor_used) / K);
- log_info(gc, heap)("Old regions: " SIZE_FORMAT "->" SIZE_FORMAT,
+ log_info(gc, heap)("Old regions: %zu->%zu",
_before._old_length, after._old_length);
- log_trace(gc, heap)(" Used: " SIZE_FORMAT "K, Waste: " SIZE_FORMAT "K",
+ log_trace(gc, heap)(" Used: %zuK, Waste: %zuK",
usage._old_used / K, ((after._old_length * G1HeapRegion::GrainBytes) - usage._old_used) / K);
- log_info(gc, heap)("Humongous regions: " SIZE_FORMAT "->" SIZE_FORMAT,
+ log_info(gc, heap)("Humongous regions: %zu->%zu",
_before._humongous_length, after._humongous_length);
- log_trace(gc, heap)(" Used: " SIZE_FORMAT "K, Waste: " SIZE_FORMAT "K",
+ log_trace(gc, heap)(" Used: %zuK, Waste: %zuK",
usage._humongous_used / K, ((after._humongous_length * G1HeapRegion::GrainBytes) - usage._humongous_used) / K);
MetaspaceUtils::print_metaspace_change(_before._meta_sizes);
diff --git a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp
index 7d399b8265e65..6bec1094579ad 100644
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1IHOPControl.cpp b/src/hotspot/share/gc/g1/g1IHOPControl.cpp
index db8426d940139..5c05169c29ded 100644
--- a/src/hotspot/share/gc/g1/g1IHOPControl.cpp
+++ b/src/hotspot/share/gc/g1/g1IHOPControl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1IHOPControl.hpp"
#include "gc/g1/g1Predictions.hpp"
@@ -40,7 +39,7 @@ G1IHOPControl::G1IHOPControl(double initial_ihop_percent,
}
void G1IHOPControl::update_target_occupancy(size_t new_target_occupancy) {
- log_debug(gc, ihop)("Target occupancy update: old: " SIZE_FORMAT "B, new: " SIZE_FORMAT "B",
+ log_debug(gc, ihop)("Target occupancy update: old: %zuB, new: %zuB",
_target_occupancy, new_target_occupancy);
_target_occupancy = new_target_occupancy;
}
@@ -54,8 +53,8 @@ void G1IHOPControl::update_allocation_info(double allocation_time_s, size_t addi
void G1IHOPControl::print() {
assert(_target_occupancy > 0, "Target occupancy still not updated yet.");
size_t cur_conc_mark_start_threshold = get_conc_mark_start_threshold();
- log_debug(gc, ihop)("Basic information (value update), threshold: " SIZE_FORMAT "B (%1.2f), target occupancy: " SIZE_FORMAT "B, current occupancy: " SIZE_FORMAT "B, "
- "recent allocation size: " SIZE_FORMAT "B, recent allocation duration: %1.2fms, recent old gen allocation rate: %1.2fB/s, recent marking phase length: %1.2fms",
+ log_debug(gc, ihop)("Basic information (value update), threshold: %zuB (%1.2f), target occupancy: %zuB, current occupancy: %zuB, "
+ "recent allocation size: %zuB, recent allocation duration: %1.2fms, recent old gen allocation rate: %1.2fB/s, recent marking phase length: %1.2fms",
cur_conc_mark_start_threshold,
percent_of(cur_conc_mark_start_threshold, _target_occupancy),
_target_occupancy,
@@ -169,8 +168,8 @@ void G1AdaptiveIHOPControl::update_marking_length(double marking_length_s) {
void G1AdaptiveIHOPControl::print() {
G1IHOPControl::print();
size_t actual_target = actual_target_threshold();
- log_debug(gc, ihop)("Adaptive IHOP information (value update), threshold: " SIZE_FORMAT "B (%1.2f), internal target occupancy: " SIZE_FORMAT "B, "
- "occupancy: " SIZE_FORMAT "B, additional buffer size: " SIZE_FORMAT "B, predicted old gen allocation rate: %1.2fB/s, "
+ log_debug(gc, ihop)("Adaptive IHOP information (value update), threshold: %zuB (%1.2f), internal target occupancy: %zuB, "
+ "occupancy: %zuB, additional buffer size: %zuB, predicted old gen allocation rate: %1.2fB/s, "
"predicted marking phase length: %1.2fms, prediction active: %s",
get_conc_mark_start_threshold(),
percent_of(get_conc_mark_start_threshold(), actual_target),
diff --git a/src/hotspot/share/gc/g1/g1InitLogger.cpp b/src/hotspot/share/gc/g1/g1InitLogger.cpp
index 2f5753f9ff6a5..1e09eed904315 100644
--- a/src/hotspot/share/gc/g1/g1InitLogger.cpp
+++ b/src/hotspot/share/gc/g1/g1InitLogger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1InitLogger.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
@@ -30,7 +29,7 @@
#include "utilities/globalDefinitions.hpp"
void G1InitLogger::print_heap() {
- log_info_p(gc, init)("Heap Region Size: " SIZE_FORMAT "M", G1HeapRegionSize / M);
+ log_info_p(gc, init)("Heap Region Size: %zuM", G1HeapRegionSize / M);
GCInitLogger::print_heap();
}
@@ -45,7 +44,7 @@ void G1InitLogger::print_gc_specific() {
// Print a message about periodic GC configuration.
if (G1PeriodicGCInterval != 0) {
log_info_p(gc, init)("Periodic GC: Enabled");
- log_info_p(gc, init)("Periodic GC Interval: " UINTX_FORMAT "ms", G1PeriodicGCInterval);
+ log_info_p(gc, init)("Periodic GC Interval: %zums", G1PeriodicGCInterval);
} else {
log_info_p(gc, init)("Periodic GC: Disabled");
}
diff --git a/src/hotspot/share/gc/g1/g1MMUTracker.cpp b/src/hotspot/share/gc/g1/g1MMUTracker.cpp
index 24776a5334d99..391c165e82274 100644
--- a/src/hotspot/share/gc/g1/g1MMUTracker.cpp
+++ b/src/hotspot/share/gc/g1/g1MMUTracker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1MMUTracker.hpp"
#include "gc/g1/g1Trace.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/g1/g1MemoryPool.cpp b/src/hotspot/share/gc/g1/g1MemoryPool.cpp
index ccff848192627..bc5f27617b1b9 100644
--- a/src/hotspot/share/gc/g1/g1MemoryPool.cpp
+++ b/src/hotspot/share/gc/g1/g1MemoryPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1MemoryPool.hpp"
diff --git a/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp b/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp
index 203ef473fa258..e018515a051de 100644
--- a/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp
+++ b/src/hotspot/share/gc/g1/g1MonitoringSupport.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1MonitoringSupport.hpp"
#include "gc/g1/g1Policy.hpp"
@@ -285,12 +284,12 @@ void G1MonitoringSupport::recalculate_sizes() {
_eden_space_used = MIN2(_eden_space_used, _eden_space_committed);
// _survivor_space_used is calculated during a safepoint and _survivor_space_committed
// is calculated from survivor region count * heap region size.
- assert(_survivor_space_used <= _survivor_space_committed, "Survivor used bytes(" SIZE_FORMAT
- ") should be less than or equal to survivor committed(" SIZE_FORMAT ")",
+ assert(_survivor_space_used <= _survivor_space_committed, "Survivor used bytes(%zu)"
+ " should be less than or equal to survivor committed(%zu)",
_survivor_space_used, _survivor_space_committed);
// _old_gen_committed is calculated in terms of _old_gen_used value.
- assert(_old_gen_used <= _old_gen_committed, "Old gen used bytes(" SIZE_FORMAT
- ") should be less than or equal to old gen committed(" SIZE_FORMAT ")",
+ assert(_old_gen_used <= _old_gen_committed, "Old gen used bytes(%zu)"
+ " should be less than or equal to old gen committed(%zu)",
_old_gen_used, _old_gen_committed);
}
diff --git a/src/hotspot/share/gc/g1/g1MonotonicArena.cpp b/src/hotspot/share/gc/g1/g1MonotonicArena.cpp
index b2706d7a9463c..4c7a411d87867 100644
--- a/src/hotspot/share/gc/g1/g1MonotonicArena.cpp
+++ b/src/hotspot/share/gc/g1/g1MonotonicArena.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1MonotonicArena.inline.hpp"
#include "memory/allocation.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/gc/g1/g1MonotonicArenaFreeMemoryTask.cpp b/src/hotspot/share/gc/g1/g1MonotonicArenaFreeMemoryTask.cpp
index 59a1afe6f3408..cc857a5396907 100644
--- a/src/hotspot/share/gc/g1/g1MonotonicArenaFreeMemoryTask.cpp
+++ b/src/hotspot/share/gc/g1/g1MonotonicArenaFreeMemoryTask.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciUtilities.hpp"
#include "gc/g1/g1CardSetMemory.inline.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
diff --git a/src/hotspot/share/gc/g1/g1MonotonicArenaFreePool.cpp b/src/hotspot/share/gc/g1/g1MonotonicArenaFreePool.cpp
index 76df02d2a7142..922c68bfba4a5 100644
--- a/src/hotspot/share/gc/g1/g1MonotonicArenaFreePool.cpp
+++ b/src/hotspot/share/gc/g1/g1MonotonicArenaFreePool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1MonotonicArena.inline.hpp"
#include "gc/g1/g1MonotonicArenaFreePool.hpp"
diff --git a/src/hotspot/share/gc/g1/g1NMethodClosure.cpp b/src/hotspot/share/gc/g1/g1NMethodClosure.cpp
index 379b1f935e103..8dca2d7cccf7b 100644
--- a/src/hotspot/share/gc/g1/g1NMethodClosure.cpp
+++ b/src/hotspot/share/gc/g1/g1NMethodClosure.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "gc/g1/g1NMethodClosure.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1NUMA.cpp b/src/hotspot/share/gc/g1/g1NUMA.cpp
index 923d3af621d70..cd7dc55d0fe5b 100644
--- a/src/hotspot/share/gc/g1/g1NUMA.cpp
+++ b/src/hotspot/share/gc/g1/g1NUMA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1NUMA.hpp"
#include "gc/shared/gc_globals.hpp"
#include "logging/logStream.hpp"
@@ -215,7 +214,7 @@ void G1NUMA::request_memory_on_node(void* aligned_address, size_t size_in_bytes,
uint node_index = preferred_node_index_for_index(region_index);
assert(is_aligned(aligned_address, page_size()), "Given address (" PTR_FORMAT ") should be aligned.", p2i(aligned_address));
- assert(is_aligned(size_in_bytes, page_size()), "Given size (" SIZE_FORMAT ") should be aligned.", size_in_bytes);
+ assert(is_aligned(size_in_bytes, page_size()), "Given size (%zu) should be aligned.", size_in_bytes);
log_trace(gc, heap, numa)("Request memory [" PTR_FORMAT ", " PTR_FORMAT ") to be NUMA id (%u)",
p2i(aligned_address), p2i((char*)aligned_address + size_in_bytes), _node_ids[node_index]);
diff --git a/src/hotspot/share/gc/g1/g1NUMAStats.cpp b/src/hotspot/share/gc/g1/g1NUMAStats.cpp
index 089e4c0e8b83a..aaebfa1be8f32 100644
--- a/src/hotspot/share/gc/g1/g1NUMAStats.cpp
+++ b/src/hotspot/share/gc/g1/g1NUMAStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1NUMAStats.hpp"
#include "logging/logStream.hpp"
@@ -162,7 +161,7 @@ static const char* phase_to_explanatory_string(G1NUMAStats::NodeDataItems phase)
}
}
-#define RATE_TOTAL_FORMAT "%0.0f%% " SIZE_FORMAT "/" SIZE_FORMAT
+#define RATE_TOTAL_FORMAT "%0.0f%% %zu/%zu"
void G1NUMAStats::print_info(G1NUMAStats::NodeDataItems phase) {
LogTarget(Info, gc, heap, numa) lt;
@@ -206,18 +205,18 @@ void G1NUMAStats::print_mutator_alloc_stat_debug() {
for (uint req = 0; req < array_width; req++) {
ls.print("%3d ", _node_ids[req]);
for (uint alloc = 0; alloc < array_width; alloc++) {
- ls.print(SIZE_FORMAT_W(8), _node_data[NewRegionAlloc]->get(req, alloc));
+ ls.print("%8zu", _node_data[NewRegionAlloc]->get(req, alloc));
}
- ls.print(SIZE_FORMAT_W(8), _node_data[NewRegionAlloc]->sum(req));
+ ls.print("%8zu", _node_data[NewRegionAlloc]->sum(req));
ls.print_cr("");
// Add padding to align with the string 'Requested NUMA id'.
ls.print(" ");
}
ls.print("Any ");
for (uint alloc = 0; alloc < array_width; alloc++) {
- ls.print(SIZE_FORMAT_W(8), _node_data[NewRegionAlloc]->get(array_width, alloc));
+ ls.print("%8zu", _node_data[NewRegionAlloc]->get(array_width, alloc));
}
- ls.print(SIZE_FORMAT_W(8), _node_data[NewRegionAlloc]->sum(array_width));
+ ls.print("%8zu", _node_data[NewRegionAlloc]->sum(array_width));
ls.print_cr("");
}
}
diff --git a/src/hotspot/share/gc/g1/g1OldGenAllocationTracker.cpp b/src/hotspot/share/gc/g1/g1OldGenAllocationTracker.cpp
index 89ac76eef6079..ec3d39d7e5043 100644
--- a/src/hotspot/share/gc/g1/g1OldGenAllocationTracker.cpp
+++ b/src/hotspot/share/gc/g1/g1OldGenAllocationTracker.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1OldGenAllocationTracker.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/g1/g1OopClosures.cpp b/src/hotspot/share/gc/g1/g1OopClosures.cpp
index 9b30595e82f75..44085269d4554 100644
--- a/src/hotspot/share/gc/g1/g1OopClosures.cpp
+++ b/src/hotspot/share/gc/g1/g1OopClosures.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1OopClosures.inline.hpp"
#include "gc/g1/g1ParScanThreadState.hpp"
diff --git a/src/hotspot/share/gc/g1/g1OopStarChunkedList.cpp b/src/hotspot/share/gc/g1/g1OopStarChunkedList.cpp
index 48f69d51db929..5d19503ad9c1b 100644
--- a/src/hotspot/share/gc/g1/g1OopStarChunkedList.cpp
+++ b/src/hotspot/share/gc/g1/g1OopStarChunkedList.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1OopStarChunkedList.inline.hpp"
G1OopStarChunkedList::~G1OopStarChunkedList() {
diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
index 41c4fc3a34cec..eb76106d91c82 100644
--- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
+++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1PageBasedVirtualSpace.hpp"
#include "gc/shared/pretouchTask.hpp"
#include "gc/shared/workerThread.hpp"
@@ -48,13 +47,13 @@ void G1PageBasedVirtualSpace::initialize_with_page_size(ReservedSpace rs, size_t
vmassert(page_size > 0, "Page size must be non-zero.");
guarantee(is_aligned(rs.base(), page_size),
- "Reserved space base " PTR_FORMAT " is not aligned to requested page size " SIZE_FORMAT, p2i(rs.base()), page_size);
+ "Reserved space base " PTR_FORMAT " is not aligned to requested page size %zu", p2i(rs.base()), page_size);
guarantee(is_aligned(used_size, os::vm_page_size()),
- "Given used reserved space size needs to be OS page size aligned (" SIZE_FORMAT " bytes) but is " SIZE_FORMAT, os::vm_page_size(), used_size);
+ "Given used reserved space size needs to be OS page size aligned (%zu bytes) but is %zu", os::vm_page_size(), used_size);
guarantee(used_size <= rs.size(),
- "Used size of reserved space " SIZE_FORMAT " bytes is smaller than reservation at " SIZE_FORMAT " bytes", used_size, rs.size());
+ "Used size of reserved space %zu bytes is smaller than reservation at %zu bytes", used_size, rs.size());
guarantee(is_aligned(rs.size(), page_size),
- "Expected that the virtual space is size aligned, but " SIZE_FORMAT " is not aligned to page size " SIZE_FORMAT, rs.size(), page_size);
+ "Expected that the virtual space is size aligned, but %zu is not aligned to page size %zu", rs.size(), page_size);
_low_boundary = rs.base();
_high_boundary = _low_boundary + used_size;
@@ -121,15 +120,15 @@ size_t G1PageBasedVirtualSpace::page_size() const {
bool G1PageBasedVirtualSpace::is_after_last_page(size_t index) const {
guarantee(index <= _committed.size(),
- "Given boundary page " SIZE_FORMAT " is beyond managed page count " SIZE_FORMAT, index, _committed.size());
+ "Given boundary page %zu is beyond managed page count %zu", index, _committed.size());
return index == _committed.size();
}
void G1PageBasedVirtualSpace::commit_preferred_pages(size_t start, size_t num_pages) {
vmassert(num_pages > 0, "No full pages to commit");
vmassert(start + num_pages <= _committed.size(),
- "Tried to commit area from page " SIZE_FORMAT " to page " SIZE_FORMAT " "
- "that is outside of managed space of " SIZE_FORMAT " pages",
+ "Tried to commit area from page %zu to page %zu "
+ "that is outside of managed space of %zu pages",
start, start + num_pages, _committed.size());
char* start_addr = page_start(start);
@@ -147,9 +146,9 @@ void G1PageBasedVirtualSpace::commit_tail() {
void G1PageBasedVirtualSpace::commit_internal(size_t start_page, size_t end_page) {
guarantee(start_page < end_page,
- "Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
+ "Given start page %zu is larger or equal to end page %zu", start_page, end_page);
guarantee(end_page <= _committed.size(),
- "Given end page " SIZE_FORMAT " is beyond end of managed page amount of " SIZE_FORMAT, end_page, _committed.size());
+ "Given end page %zu is beyond end of managed page amount of %zu", end_page, _committed.size());
size_t pages = end_page - start_page;
bool need_to_commit_tail = is_after_last_page(end_page) && is_last_page_partial();
@@ -176,7 +175,7 @@ char* G1PageBasedVirtualSpace::bounded_end_addr(size_t end_page) const {
bool G1PageBasedVirtualSpace::commit(size_t start_page, size_t size_in_pages) {
// We need to make sure to commit all pages covered by the given area.
guarantee(is_area_uncommitted(start_page, size_in_pages),
- "Specified area is not uncommitted, start page: " SIZE_FORMAT ", page count: " SIZE_FORMAT,
+ "Specified area is not uncommitted, start page: %zu, page count: %zu",
start_page, size_in_pages);
bool zero_filled = true;
@@ -198,7 +197,7 @@ bool G1PageBasedVirtualSpace::commit(size_t start_page, size_t size_in_pages) {
void G1PageBasedVirtualSpace::uncommit_internal(size_t start_page, size_t end_page) {
guarantee(start_page < end_page,
- "Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page);
+ "Given start page %zu is larger or equal to end page %zu", start_page, end_page);
char* start_addr = page_start(start_page);
os::uncommit_memory(start_addr, pointer_delta(bounded_end_addr(end_page), start_addr, sizeof(char)));
@@ -206,7 +205,7 @@ void G1PageBasedVirtualSpace::uncommit_internal(size_t start_page, size_t end_pa
void G1PageBasedVirtualSpace::uncommit(size_t start_page, size_t size_in_pages) {
guarantee(is_area_committed(start_page, size_in_pages),
- "Specified area is not committed, start page: " SIZE_FORMAT ", page count: " SIZE_FORMAT,
+ "Specified area is not committed, start page: %zu, page count: %zu",
start_page, size_in_pages);
size_t end_page = start_page + size_in_pages;
@@ -236,9 +235,9 @@ void G1PageBasedVirtualSpace::print_on(outputStream* out) {
out->print ("Virtual space:");
if (_special) out->print(" (pinned in memory)");
out->cr();
- out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
- out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());
- out->print_cr(" - preferred page size: " SIZE_FORMAT, _page_size);
+ out->print_cr(" - committed: %zu", committed_size());
+ out->print_cr(" - reserved: %zu", reserved_size());
+ out->print_cr(" - preferred page size: %zu", _page_size);
out->print_cr(" - [low_b, high_b]: [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary));
}
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
index 5762d07972874..4774cbe956d19 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectionSet.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp
index f96a24007390c..148284e7ef7c1 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -75,7 +75,7 @@ inline void G1ParScanThreadState::remember_root_into_optional_region(T* p) {
oop o = RawAccess::oop_load(p);
uint index = _g1h->heap_region_containing(o)->index_in_opt_cset();
assert(index < _max_num_optional_regions,
- "Trying to access optional region idx %u beyond " SIZE_FORMAT, index, _max_num_optional_regions);
+ "Trying to access optional region idx %u beyond %zu", index, _max_num_optional_regions);
_oops_into_optional_regions[index].push_root(p);
}
@@ -84,14 +84,14 @@ inline void G1ParScanThreadState::remember_reference_into_optional_region(T* p)
oop o = RawAccess::oop_load(p);
uint index = _g1h->heap_region_containing(o)->index_in_opt_cset();
assert(index < _max_num_optional_regions,
- "Trying to access optional region idx %u beyond " SIZE_FORMAT, index, _max_num_optional_regions);
+ "Trying to access optional region idx %u beyond %zu", index, _max_num_optional_regions);
_oops_into_optional_regions[index].push_oop(p);
verify_task(p);
}
G1OopStarChunkedList* G1ParScanThreadState::oops_into_optional_region(const G1HeapRegion* hr) {
assert(hr->index_in_opt_cset() < _max_num_optional_regions,
- "Trying to access optional region idx %u beyond " SIZE_FORMAT " " HR_FORMAT,
+ "Trying to access optional region idx %u beyond %zu " HR_FORMAT,
hr->index_in_opt_cset(), _max_num_optional_regions, HR_FORMAT_PARAMS(hr));
return &_oops_into_optional_regions[hr->index_in_opt_cset()];
}
diff --git a/src/hotspot/share/gc/g1/g1ParallelCleaning.cpp b/src/hotspot/share/gc/g1/g1ParallelCleaning.cpp
index 3525f5764639d..a4c79cbed7a9a 100644
--- a/src/hotspot/share/gc/g1/g1ParallelCleaning.cpp
+++ b/src/hotspot/share/gc/g1/g1ParallelCleaning.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1ParallelCleaning.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/gc/g1/g1PeriodicGCTask.cpp b/src/hotspot/share/gc/g1/g1PeriodicGCTask.cpp
index fea7c2f3c8687..afbd0f35ce6e6 100644
--- a/src/hotspot/share/gc/g1/g1PeriodicGCTask.cpp
+++ b/src/hotspot/share/gc/g1/g1PeriodicGCTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1ConcurrentMarkThread.inline.hpp"
@@ -48,7 +47,7 @@ bool G1PeriodicGCTask::should_start_periodic_gc(G1CollectedHeap* g1h,
// Check if enough time has passed since the last GC.
uintx time_since_last_gc = (uintx)g1h->time_since_last_collection().milliseconds();
if ((time_since_last_gc < G1PeriodicGCInterval)) {
- log_debug(gc, periodic)("Last GC occurred " UINTX_FORMAT "ms before which is below threshold " UINTX_FORMAT "ms. Skipping.",
+ log_debug(gc, periodic)("Last GC occurred %zums before which is below threshold %zums. Skipping.",
time_since_last_gc, G1PeriodicGCInterval);
return false;
}
diff --git a/src/hotspot/share/gc/g1/g1Policy.cpp b/src/hotspot/share/gc/g1/g1Policy.cpp
index 1b71901f0fe05..eee2d02028f3c 100644
--- a/src/hotspot/share/gc/g1/g1Policy.cpp
+++ b/src/hotspot/share/gc/g1/g1Policy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Allocator.hpp"
#include "gc/g1/g1Analytics.hpp"
#include "gc/g1/g1Arguments.hpp"
@@ -606,8 +605,8 @@ void G1Policy::record_full_collection_end() {
static void log_refinement_stats(const char* kind, const G1ConcurrentRefineStats& stats) {
log_debug(gc, refine, stats)
- ("%s refinement: %.2fms, refined: " SIZE_FORMAT
- ", precleaned: " SIZE_FORMAT ", dirtied: " SIZE_FORMAT,
+ ("%s refinement: %.2fms, refined: %zu"
+ ", precleaned: %zu, dirtied: %zu",
kind,
stats.refinement_time().seconds() * MILLIUNITS,
stats.refined_cards(),
@@ -757,7 +756,7 @@ bool G1Policy::need_to_start_conc_mark(const char* source, size_t alloc_word_siz
bool result = false;
if (marking_request_bytes > marking_initiating_used_threshold) {
result = collector_state()->in_young_only_phase();
- log_debug(gc, ergo, ihop)("%s occupancy: " SIZE_FORMAT "B allocation request: " SIZE_FORMAT "B threshold: " SIZE_FORMAT "B (%1.2f) source: %s",
+ log_debug(gc, ergo, ihop)("%s occupancy: %zuB allocation request: %zuB threshold: %zuB (%1.2f) source: %s",
result ? "Request concurrent cycle initiation (occupancy higher than threshold)" : "Do not request concurrent cycle initiation (still doing mixed collections)",
cur_used_bytes, alloc_byte_size, marking_initiating_used_threshold, (double) marking_initiating_used_threshold / _g1h->capacity() * 100, source);
}
diff --git a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
index 59501447878b2..c89812ad08f28 100644
--- a/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
+++ b/src/hotspot/share/gc/g1/g1RedirtyCardsQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1RedirtyCardsQueue.hpp"
#include "gc/shared/bufferNode.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp b/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp
index e8b7c00b27e8b..eca0f78aed917 100644
--- a/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp
+++ b/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1RegionMarkStatsCache.inline.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp
index ed43bf94648e2..33a9df7934917 100644
--- a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp
+++ b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BiasedArray.hpp"
#include "gc/g1/g1NUMA.hpp"
#include "gc/g1/g1RegionToSpaceMapper.hpp"
@@ -91,7 +90,7 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper {
virtual void commit_regions(uint start_idx, size_t num_regions, WorkerThreads* pretouch_workers) {
guarantee(is_range_uncommitted(start_idx, num_regions),
- "Range not uncommitted, start: %u, num_regions: " SIZE_FORMAT,
+ "Range not uncommitted, start: %u, num_regions: %zu",
start_idx, num_regions);
const size_t start_page = (size_t)start_idx * _pages_per_region;
@@ -113,7 +112,7 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper {
virtual void uncommit_regions(uint start_idx, size_t num_regions) {
guarantee(is_range_committed(start_idx, num_regions),
- "Range not committed, start: %u, num_regions: " SIZE_FORMAT,
+ "Range not committed, start: %u, num_regions: %zu",
start_idx, num_regions);
_storage.uncommit((size_t)start_idx * _pages_per_region, num_regions * _pages_per_region);
diff --git a/src/hotspot/share/gc/g1/g1RegionsOnNodes.cpp b/src/hotspot/share/gc/g1/g1RegionsOnNodes.cpp
index b72d3687c6728..91f6ee4909524 100644
--- a/src/hotspot/share/gc/g1/g1RegionsOnNodes.cpp
+++ b/src/hotspot/share/gc/g1/g1RegionsOnNodes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1NUMA.hpp"
#include "gc/g1/g1RegionsOnNodes.hpp"
diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp
index 7ae81de1d074f..531ca49845665 100644
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BatchedTask.hpp"
#include "gc/g1/g1BlockOffsetTable.inline.hpp"
@@ -107,7 +106,7 @@ class G1RemSetScanState : public CHeapObj {
// dirty card, i.e. actually needs scanning.
bool chunk_needs_scan(uint const region_idx, uint const card_in_region) const {
size_t const idx = ((size_t)region_idx << _log_scan_chunks_per_region) + (card_in_region >> _scan_chunks_shift);
- assert(idx < _num_total_scan_chunks, "Index " SIZE_FORMAT " out of bounds " SIZE_FORMAT,
+ assert(idx < _num_total_scan_chunks, "Index %zu out of bounds %zu",
idx, _num_total_scan_chunks);
return _region_scan_chunks[idx];
}
@@ -347,7 +346,7 @@ class G1RemSetScanState : public CHeapObj {
void set_chunk_dirty(size_t const card_idx) {
assert((card_idx >> _scan_chunks_shift) < _num_total_scan_chunks,
- "Trying to access index " SIZE_FORMAT " out of bounds " SIZE_FORMAT,
+ "Trying to access index %zu out of bounds %zu",
card_idx >> _scan_chunks_shift, _num_total_scan_chunks);
size_t const chunk_idx = card_idx >> _scan_chunks_shift;
_region_scan_chunks[chunk_idx] = true;
@@ -1438,7 +1437,7 @@ void G1RemSet::print_merge_heap_roots_stats() {
size_t total_old_region_cards =
(g1h->num_regions() - (g1h->num_free_regions() - g1h->collection_set()->cur_length())) * G1HeapRegion::CardsPerRegion;
- ls.print_cr("Visited cards " SIZE_FORMAT " Total dirty " SIZE_FORMAT " (%.2lf%%) Total old " SIZE_FORMAT " (%.2lf%%)",
+ ls.print_cr("Visited cards %zu Total dirty %zu (%.2lf%%) Total old %zu (%.2lf%%)",
num_visited_cards,
total_dirty_region_cards,
percent_of(num_visited_cards, total_dirty_region_cards),
@@ -1471,7 +1470,7 @@ void G1RemSet::merge_heap_roots(bool initial_evacuation) {
{
G1MergeHeapRootsTask cl(_scan_state, num_workers, initial_evacuation);
- log_debug(gc, ergo)("Running %s using %u workers for " SIZE_FORMAT " regions",
+ log_debug(gc, ergo)("Running %s using %u workers for %zu regions",
cl.name(), num_workers, increment_length);
workers->run_task(&cl, num_workers);
}
@@ -1504,7 +1503,7 @@ inline void check_card_ptr(CardTable::CardValue* card_ptr, G1CardTable* ct) {
#ifdef ASSERT
G1CollectedHeap* g1h = G1CollectedHeap::heap();
assert(g1h->is_in(ct->addr_for(card_ptr)),
- "Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
+ "Card at " PTR_FORMAT " index %zu representing heap at " PTR_FORMAT " (%u) must be in committed heap",
p2i(card_ptr),
ct->index_for(ct->addr_for(card_ptr)),
p2i(ct->addr_for(card_ptr)),
diff --git a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp
index 5ea3500a7b0f7..adc2be84380a5 100644
--- a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp
+++ b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CardSetMemory.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
@@ -153,29 +152,29 @@ class RegionTypeCounter {
size_t code_root_elems() const { return _code_root_elems; }
void print_rs_mem_info_on(outputStream * out, size_t total) {
- out->print_cr(" " SIZE_FORMAT_W(8) " (%5.1f%%) by " SIZE_FORMAT " "
- "(" SIZE_FORMAT ") %s regions unused " SIZE_FORMAT,
+ out->print_cr(" %8zu (%5.1f%%) by %zu "
+ "(%zu) %s regions unused %zu",
rs_mem_size(), rs_mem_size_percent_of(total),
amount_tracked(), amount(),
_name, rs_unused_mem_size());
}
void print_cards_occupied_info_on(outputStream * out, size_t total) {
- out->print_cr(" " SIZE_FORMAT_W(8) " (%5.1f%%) entries by " SIZE_FORMAT " "
- "(" SIZE_FORMAT ") %s regions",
+ out->print_cr(" %8zu (%5.1f%%) entries by %zu "
+ "(%zu) %s regions",
cards_occupied(), cards_occupied_percent_of(total),
amount_tracked(), amount(), _name);
}
void print_code_root_mem_info_on(outputStream * out, size_t total) {
- out->print_cr(" " SIZE_FORMAT_W(8) "%s (%5.1f%%) by " SIZE_FORMAT " %s regions",
+ out->print_cr(" %8zu%s (%5.1f%%) by %zu %s regions",
byte_size_in_proper_unit(code_root_mem_size()),
proper_unit_for_byte_size(code_root_mem_size()),
code_root_mem_size_percent_of(total), amount(), _name);
}
void print_code_root_elems_info_on(outputStream * out, size_t total) {
- out->print_cr(" " SIZE_FORMAT_W(8) " (%5.1f%%) elements by " SIZE_FORMAT " %s regions",
+ out->print_cr(" %8zu (%5.1f%%) elements by %zu %s regions",
code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
}
};
@@ -267,8 +266,8 @@ class HRRSStatsIter: public G1HeapRegionClosure {
RegionTypeCounter* counters[] = { &_young, &_humongous, &_free, &_old, nullptr };
out->print_cr(" Current rem set statistics");
- out->print_cr(" Total per region rem sets sizes = " SIZE_FORMAT
- " Max = " SIZE_FORMAT " unused = " SIZE_FORMAT,
+ out->print_cr(" Total per region rem sets sizes = %zu"
+ " Max = %zu unused = %zu",
total_rs_mem_sz(),
max_rs_mem_sz(),
total_rs_unused_mem_sz());
@@ -276,7 +275,7 @@ class HRRSStatsIter: public G1HeapRegionClosure {
(*current)->print_rs_mem_info_on(out, total_rs_mem_sz());
}
- out->print_cr(" " SIZE_FORMAT " occupied cards represented.",
+ out->print_cr(" %zu occupied cards represented.",
total_cards_occupied());
for (RegionTypeCounter** current = &counters[0]; *current != nullptr; current++) {
(*current)->print_cards_occupied_info_on(out, total_cards_occupied());
@@ -285,7 +284,7 @@ class HRRSStatsIter: public G1HeapRegionClosure {
// Largest sized rem set region statistics
G1HeapRegionRemSet* rem_set = max_rs_mem_sz_region()->rem_set();
out->print_cr(" Region with largest rem set = " HR_FORMAT ", "
- "size = " SIZE_FORMAT " occupied = " SIZE_FORMAT,
+ "size = %zu occupied = %zu",
HR_FORMAT_PARAMS(max_rs_mem_sz_region()),
rem_set->mem_size(),
rem_set->occupied());
@@ -296,8 +295,8 @@ class HRRSStatsIter: public G1HeapRegionClosure {
// Code root statistics
G1HeapRegionRemSet* max_code_root_rem_set = max_code_root_mem_sz_region()->rem_set();
- out->print_cr(" Total heap region code root sets sizes = " SIZE_FORMAT "%s."
- " Max = " SIZE_FORMAT "%s.",
+ out->print_cr(" Total heap region code root sets sizes = %zu%s."
+ " Max = %zu%s.",
byte_size_in_proper_unit(total_code_root_mem_sz()),
proper_unit_for_byte_size(total_code_root_mem_sz()),
byte_size_in_proper_unit(max_code_root_rem_set->code_roots_mem_size()),
@@ -306,14 +305,14 @@ class HRRSStatsIter: public G1HeapRegionClosure {
(*current)->print_code_root_mem_info_on(out, total_code_root_mem_sz());
}
- out->print_cr(" " SIZE_FORMAT " code roots represented.",
+ out->print_cr(" %zu code roots represented.",
total_code_root_elems());
for (RegionTypeCounter** current = &counters[0]; *current != nullptr; current++) {
(*current)->print_code_root_elems_info_on(out, total_code_root_elems());
}
out->print_cr(" Region with largest amount of code roots = " HR_FORMAT ", "
- "size = " SIZE_FORMAT "%s, num_slots = " SIZE_FORMAT ".",
+ "size = %zu%s, num_slots = %zu.",
HR_FORMAT_PARAMS(max_code_root_mem_sz_region()),
byte_size_in_proper_unit(max_code_root_rem_set->code_roots_mem_size()),
proper_unit_for_byte_size(max_code_root_rem_set->code_roots_mem_size()),
diff --git a/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp b/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp
index 6538dffd998e8..9874b78699d94 100644
--- a/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp
+++ b/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectionSetChooser.hpp"
#include "gc/g1/g1HeapRegion.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1RootClosures.cpp b/src/hotspot/share/gc/g1/g1RootClosures.cpp
index 7acc3adc83611..f03681487cbc7 100644
--- a/src/hotspot/share/gc/g1/g1RootClosures.cpp
+++ b/src/hotspot/share/gc/g1/g1RootClosures.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1OopClosures.inline.hpp"
#include "gc/g1/g1RootClosures.hpp"
#include "gc/g1/g1SharedClosures.hpp"
diff --git a/src/hotspot/share/gc/g1/g1RootProcessor.cpp b/src/hotspot/share/gc/g1/g1RootProcessor.cpp
index 07ae66cfb0ba7..cf28c53648d74 100644
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/stringTable.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.cpp b/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.cpp
index 17a0f9326b5fe..f0b29a5bbaba1 100644
--- a/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.cpp
+++ b/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1BarrierSet.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1HeapRegion.hpp"
diff --git a/src/hotspot/share/gc/g1/g1ServiceThread.cpp b/src/hotspot/share/gc/g1/g1ServiceThread.cpp
index 655220c349bbd..5f664cfba3a21 100644
--- a/src/hotspot/share/gc/g1/g1ServiceThread.cpp
+++ b/src/hotspot/share/gc/g1/g1ServiceThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1ServiceThread.hpp"
#include "logging/log.hpp"
#include "runtime/cpuTimeCounters.hpp"
diff --git a/src/hotspot/share/gc/g1/g1StringDedup.cpp b/src/hotspot/share/gc/g1/g1StringDedup.cpp
index 6881c606114dd..97b15df537e33 100644
--- a/src/hotspot/share/gc/g1/g1StringDedup.cpp
+++ b/src/hotspot/share/gc/g1/g1StringDedup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/shared/stringdedup/stringDedup.hpp"
diff --git a/src/hotspot/share/gc/g1/g1SurvRateGroup.cpp b/src/hotspot/share/gc/g1/g1SurvRateGroup.cpp
index 40f15446fecc0..1eaaf44a1fbde 100644
--- a/src/hotspot/share/gc/g1/g1SurvRateGroup.cpp
+++ b/src/hotspot/share/gc/g1/g1SurvRateGroup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1Predictions.hpp"
#include "gc/g1/g1SurvRateGroup.hpp"
diff --git a/src/hotspot/share/gc/g1/g1SurvivorRegions.cpp b/src/hotspot/share/gc/g1/g1SurvivorRegions.cpp
index 53febea0a495b..dd3323f4079e2 100644
--- a/src/hotspot/share/gc/g1/g1SurvivorRegions.cpp
+++ b/src/hotspot/share/gc/g1/g1SurvivorRegions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1SurvivorRegions.hpp"
#include "utilities/growableArray.hpp"
diff --git a/src/hotspot/share/gc/g1/g1Trace.cpp b/src/hotspot/share/gc/g1/g1Trace.cpp
index 598a238e93b92..3cc8a8a28e176 100644
--- a/src/hotspot/share/gc/g1/g1Trace.cpp
+++ b/src/hotspot/share/gc/g1/g1Trace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1EvacInfo.hpp"
#include "gc/g1/g1HeapRegionTraceType.hpp"
#include "gc/g1/g1Trace.hpp"
diff --git a/src/hotspot/share/gc/g1/g1UncommitRegionTask.cpp b/src/hotspot/share/gc/g1/g1UncommitRegionTask.cpp
index 31ca32d9ea2f5..e1203229557a0 100644
--- a/src/hotspot/share/gc/g1/g1UncommitRegionTask.cpp
+++ b/src/hotspot/share/gc/g1/g1UncommitRegionTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1UncommitRegionTask.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
@@ -82,7 +81,7 @@ void G1UncommitRegionTask::report_execution(Tickspan time, uint regions) {
_summary_region_count += regions;
_summary_duration += time;
- log_trace(gc, heap)("Concurrent Uncommit: " SIZE_FORMAT "%s, %u regions, %1.3fms",
+ log_trace(gc, heap)("Concurrent Uncommit: %zu%s, %u regions, %1.3fms",
byte_size_in_proper_unit(regions * G1HeapRegion::GrainBytes),
proper_unit_for_byte_size(regions * G1HeapRegion::GrainBytes),
regions,
@@ -90,7 +89,7 @@ void G1UncommitRegionTask::report_execution(Tickspan time, uint regions) {
}
void G1UncommitRegionTask::report_summary() {
- log_debug(gc, heap)("Concurrent Uncommit Summary: " SIZE_FORMAT "%s, %u regions, %1.3fms",
+ log_debug(gc, heap)("Concurrent Uncommit Summary: %zu%s, %u regions, %1.3fms",
byte_size_in_proper_unit(_summary_region_count * G1HeapRegion::GrainBytes),
proper_unit_for_byte_size(_summary_region_count * G1HeapRegion::GrainBytes),
_summary_region_count,
diff --git a/src/hotspot/share/gc/g1/g1VMOperations.cpp b/src/hotspot/share/gc/g1/g1VMOperations.cpp
index 634cdf6265fd4..9552bd6d41812 100644
--- a/src/hotspot/share/gc/g1/g1VMOperations.cpp
+++ b/src/hotspot/share/gc/g1/g1VMOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMarkThread.inline.hpp"
#include "gc/g1/g1Policy.hpp"
diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.cpp b/src/hotspot/share/gc/g1/g1YoungCollector.cpp
index 2af5658f98e1c..9cb734ec65399 100644
--- a/src/hotspot/share/gc/g1/g1YoungCollector.cpp
+++ b/src/hotspot/share/gc/g1/g1YoungCollector.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
diff --git a/src/hotspot/share/gc/g1/g1YoungGCAllocationFailureInjector.cpp b/src/hotspot/share/gc/g1/g1YoungGCAllocationFailureInjector.cpp
index dcf42b31bb133..ceb859d249b79 100644
--- a/src/hotspot/share/gc/g1/g1YoungGCAllocationFailureInjector.cpp
+++ b/src/hotspot/share/gc/g1/g1YoungGCAllocationFailureInjector.cpp
@@ -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
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1YoungGCAllocationFailureInjector.inline.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp
index c72dcc9661821..5b9086be362a5 100644
--- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp
+++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "gc/g1/g1CardSetMemory.hpp"
@@ -394,7 +393,7 @@ class G1FreeHumongousRegionClosure : public G1HeapRegionIndexClosure {
"Only eagerly reclaiming type arrays is supported, but the object "
PTR_FORMAT " is not.", p2i(r->bottom()));
- log_debug(gc, humongous)("Reclaimed humongous region %u (object size " SIZE_FORMAT " @ " PTR_FORMAT ")",
+ log_debug(gc, humongous)("Reclaimed humongous region %u (object size %zu @ " PTR_FORMAT ")",
region_index,
obj->size() * HeapWordSize,
p2i(r->bottom())
diff --git a/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp
index d746062366966..63e7797981210 100644
--- a/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp
+++ b/src/hotspot/share/gc/g1/g1YoungGCPreEvacuateTasks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentRefineStats.hpp"
#include "gc/g1/g1DirtyCardQueue.hpp"
diff --git a/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp b/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp
index 0c4b0b90df0aa..a8209eb19ba37 100644
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1Arguments.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/g1/g1YoungGenSizer.hpp"
@@ -44,8 +43,8 @@ G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults),
if (NewSize > MaxNewSize) {
if (FLAG_IS_CMDLINE(MaxNewSize)) {
- log_warning(gc, ergo)("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). "
- "A new max generation size of " SIZE_FORMAT "k will be used.",
+ log_warning(gc, ergo)("NewSize (%zuk) is greater than the MaxNewSize (%zuk). "
+ "A new max generation size of %zuk will be used.",
NewSize/K, MaxNewSize/K, NewSize/K);
}
FLAG_SET_ERGO(MaxNewSize, NewSize);
diff --git a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp
index 0a29caed8ccd8..68da7400256a7 100644
--- a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp
+++ b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/g1/g1HeapRegionBounds.inline.hpp"
#include "gc/g1/jvmFlagConstraintsG1.hpp"
#include "gc/shared/bufferNode.hpp"
@@ -83,7 +82,7 @@ JVMFlag::Error G1HeapRegionSizeConstraintFunc(size_t value, bool verbose) {
// Default value of G1HeapRegionSize=0 means will be set ergonomically.
if (FLAG_IS_CMDLINE(G1HeapRegionSize) && (value < G1HeapRegionBounds::min_size())) {
JVMFlag::printError(verbose,
- "G1HeapRegionSize (" SIZE_FORMAT ") must be "
+ "G1HeapRegionSize (%zu) must be "
"greater than or equal to ergonomic heap region minimum size\n",
value);
return JVMFlag::VIOLATES_CONSTRAINT;
@@ -123,8 +122,8 @@ JVMFlag::Error G1MaxNewSizePercentConstraintFunc(uint value, bool verbose) {
JVMFlag::Error MaxGCPauseMillisConstraintFuncG1(uintx value, bool verbose) {
if (UseG1GC && FLAG_IS_CMDLINE(MaxGCPauseMillis) && (value >= GCPauseIntervalMillis)) {
JVMFlag::printError(verbose,
- "MaxGCPauseMillis (" UINTX_FORMAT ") must be "
- "less than GCPauseIntervalMillis (" UINTX_FORMAT ")\n",
+ "MaxGCPauseMillis (%zu) must be "
+ "less than GCPauseIntervalMillis (%zu)\n",
value, GCPauseIntervalMillis);
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -137,7 +136,7 @@ JVMFlag::Error GCPauseIntervalMillisConstraintFuncG1(uintx value, bool verbose)
if (FLAG_IS_CMDLINE(GCPauseIntervalMillis)) {
if (value < 1) {
JVMFlag::printError(verbose,
- "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
+ "GCPauseIntervalMillis (%zu) must be "
"greater than or equal to 1\n",
value);
return JVMFlag::VIOLATES_CONSTRAINT;
@@ -152,8 +151,8 @@ JVMFlag::Error GCPauseIntervalMillisConstraintFuncG1(uintx value, bool verbose)
if (value <= MaxGCPauseMillis) {
JVMFlag::printError(verbose,
- "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
- "greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n",
+ "GCPauseIntervalMillis (%zu) must be "
+ "greater than MaxGCPauseMillis (%zu)\n",
value, MaxGCPauseMillis);
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -171,7 +170,7 @@ JVMFlag::Error NewSizeConstraintFuncG1(size_t value, bool verbose) {
// So maximum of NewSize should be 'max_juint * 1M'
if (UseG1GC && (value > (max_juint * 1 * M))) {
JVMFlag::printError(verbose,
- "NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n",
+ "NewSize (%zu) must be less than ergonomic maximum value\n",
value);
return JVMFlag::VIOLATES_CONSTRAINT;
}
diff --git a/src/hotspot/share/gc/parallel/gcAdaptivePolicyCounters.cpp b/src/hotspot/share/gc/parallel/gcAdaptivePolicyCounters.cpp
index 9f0b5961ea0e1..47c09befb400d 100644
--- a/src/hotspot/share/gc/parallel/gcAdaptivePolicyCounters.cpp
+++ b/src/hotspot/share/gc/parallel/gcAdaptivePolicyCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/gcAdaptivePolicyCounters.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp b/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
index 99c795341df8d..94e2d306165db 100644
--- a/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
+++ b/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/jvmFlagConstraintsParallel.hpp"
#include "gc/shared/gc_globals.hpp"
#include "runtime/globals.hpp"
diff --git a/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp b/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp
index 06aa3d5fc72b2..874d3974ead53 100644
--- a/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp
+++ b/src/hotspot/share/gc/parallel/mutableNUMASpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/mutableNUMASpace.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
@@ -99,7 +98,7 @@ void MutableNUMASpace::ensure_parsability() {
while (words_left_to_fill > 0) {
size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size());
assert(words_to_fill >= CollectedHeap::min_fill_size(),
- "Remaining size (" SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")",
+ "Remaining size (%zu) is too small to fill (based on %zu and %zu)",
words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size());
CollectedHeap::fill_with_object(cur_top, words_to_fill);
cur_top += words_to_fill;
@@ -619,8 +618,8 @@ void MutableNUMASpace::print_on(outputStream* st) const {
for (int i = 0; i < lgrp_spaces()->length(); i++) {
lgrp_spaces()->at(i)->accumulate_statistics(page_size());
}
- st->print(" local/remote/unbiased/uncommitted: " SIZE_FORMAT "K/"
- SIZE_FORMAT "K/" SIZE_FORMAT "K/" SIZE_FORMAT "K\n",
+ st->print(" local/remote/unbiased/uncommitted: %zuK/"
+ "%zuK/%zuK/%zuK\n",
ls->space_stats()->_local_space / K,
ls->space_stats()->_remote_space / K,
ls->space_stats()->_unbiased_space / K,
diff --git a/src/hotspot/share/gc/parallel/mutableSpace.cpp b/src/hotspot/share/gc/parallel/mutableSpace.cpp
index 74801f4870b24..19ec0fcf83991 100644
--- a/src/hotspot/share/gc/parallel/mutableSpace.cpp
+++ b/src/hotspot/share/gc/parallel/mutableSpace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/mutableSpace.hpp"
#include "gc/shared/pretouchTask.hpp"
#include "gc/shared/spaceDecorator.hpp"
@@ -233,7 +232,7 @@ void MutableSpace::object_iterate(ObjectClosure* cl) {
void MutableSpace::print_short() const { print_short_on(tty); }
void MutableSpace::print_short_on( outputStream* st) const {
- st->print(" space " SIZE_FORMAT "K, %d%% used", capacity_in_bytes() / K,
+ st->print(" space %zuK, %d%% used", capacity_in_bytes() / K,
(int) ((double) used_in_bytes() * 100 / capacity_in_bytes()));
}
diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp
index 2637a9d2b8827..e8d94b28d1879 100644
--- a/src/hotspot/share/gc/parallel/objectStartArray.cpp
+++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/objectStartArray.inline.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "memory/memoryReserver.hpp"
diff --git a/src/hotspot/share/gc/parallel/parMarkBitMap.cpp b/src/hotspot/share/gc/parallel/parMarkBitMap.cpp
index db06cc785218b..cda892f68ca92 100644
--- a/src/hotspot/share/gc/parallel/parMarkBitMap.cpp
+++ b/src/hotspot/share/gc/parallel/parMarkBitMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/parMarkBitMap.inline.hpp"
#include "gc/parallel/psCompactionManager.inline.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp"
diff --git a/src/hotspot/share/gc/parallel/parallelArguments.cpp b/src/hotspot/share/gc/parallel/parallelArguments.cpp
index d9972ccc146c6..6309f52c82ed2 100644
--- a/src/hotspot/share/gc/parallel/parallelArguments.cpp
+++ b/src/hotspot/share/gc/parallel/parallelArguments.cpp
@@ -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.
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/parallelArguments.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/shared/adaptiveSizePolicy.hpp"
diff --git a/src/hotspot/share/gc/parallel/parallelInitLogger.cpp b/src/hotspot/share/gc/parallel/parallelInitLogger.cpp
index 555b96e26319b..b6d1034f60a1c 100644
--- a/src/hotspot/share/gc/parallel/parallelInitLogger.cpp
+++ b/src/hotspot/share/gc/parallel/parallelInitLogger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,16 +22,15 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/parallelInitLogger.hpp"
#include "gc/shared/genArguments.hpp"
#include "gc/shared/gcLogPrecious.hpp"
void ParallelInitLogger::print_heap() {
log_info_p(gc, init)("Alignments:"
- " Space " SIZE_FORMAT "%s,"
- " Generation " SIZE_FORMAT "%s,"
- " Heap " SIZE_FORMAT "%s",
+ " Space %zu%s,"
+ " Generation %zu%s,"
+ " Heap %zu%s",
byte_size_in_exact_unit(SpaceAlignment), exact_unit_for_byte_size(SpaceAlignment),
byte_size_in_exact_unit(GenAlignment), exact_unit_for_byte_size(GenAlignment),
byte_size_in_exact_unit(HeapAlignment), exact_unit_for_byte_size(HeapAlignment));
diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
index 6b1b25dd6aae3..dc6a3ca565f78 100644
--- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
+++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/objectStartArray.inline.hpp"
#include "gc/parallel/parallelArguments.hpp"
#include "gc/parallel/parallelInitLogger.hpp"
@@ -400,7 +399,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate_work(size_t size,
if ((result == nullptr) && (QueuedAllocationWarningCount > 0) &&
(loop_count % QueuedAllocationWarningCount == 0)) {
log_warning(gc)("ParallelScavengeHeap::mem_allocate retries %d times", loop_count);
- log_warning(gc)("\tsize=" SIZE_FORMAT, size);
+ log_warning(gc)("\tsize=%zu", size);
}
}
diff --git a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp
index 288a21fd35d05..3bb0c0bf1192a 100644
--- a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp
+++ b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psAdaptiveSizePolicy.hpp"
#include "gc/parallel/psGCAdaptivePolicyCounters.hpp"
@@ -315,12 +314,12 @@ void PSAdaptiveSizePolicy::compute_eden_space_size(
if (desired_eden_size > eden_limit) {
log_debug(gc, ergo)(
"PSAdaptiveSizePolicy::compute_eden_space_size limits:"
- " desired_eden_size: " SIZE_FORMAT
- " old_eden_size: " SIZE_FORMAT
- " eden_limit: " SIZE_FORMAT
- " cur_eden: " SIZE_FORMAT
- " max_eden_size: " SIZE_FORMAT
- " avg_young_live: " SIZE_FORMAT,
+ " desired_eden_size: %zu"
+ " old_eden_size: %zu"
+ " eden_limit: %zu"
+ " cur_eden: %zu"
+ " max_eden_size: %zu"
+ " avg_young_live: %zu",
desired_eden_size, _eden_size, eden_limit, cur_eden,
max_eden_size, (size_t)avg_young_live()->average());
}
@@ -358,14 +357,14 @@ void PSAdaptiveSizePolicy::compute_eden_space_size(
_avg_major_interval->average(),
gc_pause_goal_sec());
- log_debug(gc, ergo)("Live_space: " SIZE_FORMAT " free_space: " SIZE_FORMAT,
+ log_debug(gc, ergo)("Live_space: %zu free_space: %zu",
live_space(), free_space());
- log_trace(gc, ergo)("avg_young_live: " SIZE_FORMAT " avg_old_live: " SIZE_FORMAT,
+ log_trace(gc, ergo)("avg_young_live: %zu avg_old_live: %zu",
(size_t)avg_young_live()->average(),
(size_t)avg_old_live()->average());
- log_debug(gc, ergo)("Old eden_size: " SIZE_FORMAT " desired_eden_size: " SIZE_FORMAT,
+ log_debug(gc, ergo)("Old eden_size: %zu desired_eden_size: %zu",
_eden_size, desired_eden_size);
set_eden_size(desired_eden_size);
@@ -492,11 +491,11 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space(
size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average());
log_debug(gc, ergo)(
"PSAdaptiveSizePolicy::compute_old_gen_free_space limits:"
- " desired_promo_size: " SIZE_FORMAT
- " promo_limit: " SIZE_FORMAT
- " free_in_old_gen: " SIZE_FORMAT
- " max_old_gen_size: " SIZE_FORMAT
- " avg_old_live: " SIZE_FORMAT,
+ " desired_promo_size: %zu"
+ " promo_limit: %zu"
+ " free_in_old_gen: %zu"
+ " max_old_gen_size: %zu"
+ " avg_old_live: %zu",
desired_promo_size, promo_limit, free_in_old_gen,
max_old_gen_size, (size_t) avg_old_live()->average());
}
@@ -529,14 +528,14 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space(
gc_pause_goal_sec());
// Footprint stats
- log_debug(gc, ergo)("Live_space: " SIZE_FORMAT " free_space: " SIZE_FORMAT,
+ log_debug(gc, ergo)("Live_space: %zu free_space: %zu",
live_space(), free_space());
- log_trace(gc, ergo)("avg_young_live: " SIZE_FORMAT " avg_old_live: " SIZE_FORMAT,
+ log_trace(gc, ergo)("avg_young_live: %zu avg_old_live: %zu",
(size_t)avg_young_live()->average(),
(size_t)avg_old_live()->average());
- log_debug(gc, ergo)("Old promo_size: " SIZE_FORMAT " desired_promo_size: " SIZE_FORMAT,
+ log_debug(gc, ergo)("Old promo_size: %zu desired_promo_size: %zu",
_promo_size, desired_promo_size);
set_promo_size(desired_promo_size);
@@ -603,7 +602,7 @@ void PSAdaptiveSizePolicy::adjust_promo_for_pause_time(size_t* desired_promo_siz
log_trace(gc, ergo)(
"PSAdaptiveSizePolicy::adjust_promo_for_pause_time "
"adjusting gen sizes for major pause (avg %f goal %f). "
- "desired_promo_size " SIZE_FORMAT " promo delta " SIZE_FORMAT,
+ "desired_promo_size %zu promo delta %zu",
_avg_major_pause->average(), gc_pause_goal_sec(),
*desired_promo_size_ptr, promo_heap_delta);
}
@@ -620,7 +619,7 @@ void PSAdaptiveSizePolicy::adjust_eden_for_pause_time(size_t* desired_eden_size_
log_trace(gc, ergo)(
"PSAdaptiveSizePolicy::adjust_eden_for_pause_time "
"adjusting gen sizes for major pause (avg %f goal %f). "
- "desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT,
+ "desired_eden_size %zu eden delta %zu",
_avg_major_pause->average(), gc_pause_goal_sec(),
*desired_eden_size_ptr, eden_heap_delta);
}
@@ -636,7 +635,7 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc,
return;
}
- log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_promo_for_throughput(is_full: %d, promo: " SIZE_FORMAT "): mutator_cost %f major_gc_cost %f minor_gc_cost %f",
+ log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_promo_for_throughput(is_full: %d, promo: %zu): mutator_cost %f major_gc_cost %f minor_gc_cost %f",
is_full_gc, *desired_promo_size_ptr, mutator_cost(), major_gc_cost(), minor_gc_cost());
// Tenured generation
@@ -650,7 +649,7 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc,
double scale_by_ratio = major_gc_cost() / gc_cost();
scaled_promo_heap_delta =
(size_t) (scale_by_ratio * (double) promo_heap_delta);
- log_trace(gc, ergo)("Scaled tenured increment: " SIZE_FORMAT " by %f down to " SIZE_FORMAT,
+ log_trace(gc, ergo)("Scaled tenured increment: %zu by %f down to %zu",
promo_heap_delta, scale_by_ratio, scaled_promo_heap_delta);
} else if (major_gc_cost() >= 0.0) {
// Scaling is not going to work. If the major gc time is the
@@ -697,7 +696,7 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc,
_old_gen_change_for_major_throughput++;
}
- log_trace(gc, ergo)("Adjusting tenured gen for throughput (avg %f goal %f). desired_promo_size " SIZE_FORMAT " promo_delta " SIZE_FORMAT ,
+ log_trace(gc, ergo)("Adjusting tenured gen for throughput (avg %f goal %f). desired_promo_size %zu promo_delta %zu",
mutator_cost(),
_throughput_goal,
*desired_promo_size_ptr, scaled_promo_heap_delta);
@@ -715,7 +714,7 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc,
return;
}
- log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_eden_for_throughput(is_full: %d, cur_eden: " SIZE_FORMAT "): mutator_cost %f major_gc_cost %f minor_gc_cost %f",
+ log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_eden_for_throughput(is_full: %d, cur_eden: %zu): mutator_cost %f major_gc_cost %f minor_gc_cost %f",
is_full_gc, *desired_eden_size_ptr, mutator_cost(), major_gc_cost(), minor_gc_cost());
// Young generation
@@ -728,7 +727,7 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc,
assert(scale_by_ratio <= 1.0 && scale_by_ratio >= 0.0, "Scaling is wrong");
scaled_eden_heap_delta =
(size_t) (scale_by_ratio * (double) eden_heap_delta);
- log_trace(gc, ergo)("Scaled eden increment: " SIZE_FORMAT " by %f down to " SIZE_FORMAT,
+ log_trace(gc, ergo)("Scaled eden increment: %zu by %f down to %zu",
eden_heap_delta, scale_by_ratio, scaled_eden_heap_delta);
} else if (minor_gc_cost() >= 0.0) {
// Scaling is not going to work. If the minor gc time is the
@@ -774,7 +773,7 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc,
_young_gen_change_for_minor_throughput++;
}
- log_trace(gc, ergo)("Adjusting eden for throughput (avg %f goal %f). desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT,
+ log_trace(gc, ergo)("Adjusting eden for throughput (avg %f goal %f). desired_eden_size %zu eden delta %zu",
mutator_cost(), _throughput_goal, *desired_eden_size_ptr, scaled_eden_heap_delta);
}
@@ -791,9 +790,9 @@ size_t PSAdaptiveSizePolicy::adjust_promo_for_footprint(
log_trace(gc, ergo)(
"AdaptiveSizePolicy::adjust_promo_for_footprint "
"adjusting tenured gen for footprint. "
- "starting promo size " SIZE_FORMAT
- " reduced promo size " SIZE_FORMAT
- " promo delta " SIZE_FORMAT,
+ "starting promo size %zu"
+ " reduced promo size %zu"
+ " promo delta %zu",
desired_promo_size, reduced_size, change );
assert(reduced_size <= desired_promo_size, "Inconsistent result");
@@ -813,9 +812,9 @@ size_t PSAdaptiveSizePolicy::adjust_eden_for_footprint(
log_trace(gc, ergo)(
"AdaptiveSizePolicy::adjust_eden_for_footprint "
"adjusting eden for footprint. "
- " starting eden size " SIZE_FORMAT
- " reduced eden size " SIZE_FORMAT
- " eden delta " SIZE_FORMAT,
+ " starting eden size %zu"
+ " reduced eden size %zu"
+ " eden delta %zu",
desired_eden_size, reduced_size, change);
assert(reduced_size <= desired_eden_size, "Inconsistent result");
@@ -947,12 +946,10 @@ uint PSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold(
// Finally, increment or decrement the tenuring threshold, as decided above.
// We test for decrementing first, as we might have hit the target size
// limit.
- if (decr_tenuring_threshold && !(AlwaysTenure || NeverTenure)) {
- if (tenuring_threshold > 1) {
+ if (!(AlwaysTenure || NeverTenure)) {
+ if (decr_tenuring_threshold && tenuring_threshold > 1) {
tenuring_threshold--;
- }
- } else if (incr_tenuring_threshold && !(AlwaysTenure || NeverTenure)) {
- if (tenuring_threshold < MaxTenuringThreshold) {
+ } else if (incr_tenuring_threshold && tenuring_threshold < MaxTenuringThreshold) {
tenuring_threshold++;
}
}
@@ -966,7 +963,7 @@ uint PSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold(
log_debug(gc, ergo)("avg_survived_padded_avg: %f", _avg_survived->padded_average());
log_trace(gc, ergo)("avg_promoted_avg: %f avg_promoted_dev: %f", avg_promoted()->average(), avg_promoted()->deviation());
- log_debug(gc, ergo)("avg_promoted_padded_avg: %f avg_pretenured_padded_avg: %f tenuring_thresh: %d target_size: " SIZE_FORMAT,
+ log_debug(gc, ergo)("avg_promoted_padded_avg: %f avg_pretenured_padded_avg: %f tenuring_thresh: %d target_size: %zu",
avg_promoted()->padded_average(),
_avg_pretenured->padded_average(),
tenuring_threshold, target_size);
@@ -989,7 +986,7 @@ void PSAdaptiveSizePolicy::update_averages(bool is_survivor_overflow,
}
avg_promoted()->sample(promoted);
- log_trace(gc, ergo)("AdaptiveSizePolicy::update_averages: survived: " SIZE_FORMAT " promoted: " SIZE_FORMAT " overflow: %s",
+ log_trace(gc, ergo)("AdaptiveSizePolicy::update_averages: survived: %zu promoted: %zu overflow: %s",
survived, promoted, is_survivor_overflow ? "true" : "false");
}
diff --git a/src/hotspot/share/gc/parallel/psCardTable.cpp b/src/hotspot/share/gc/parallel/psCardTable.cpp
index b80a1b13b007f..f8841b9a164f5 100644
--- a/src/hotspot/share/gc/parallel/psCardTable.cpp
+++ b/src/hotspot/share/gc/parallel/psCardTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/objectStartArray.inline.hpp"
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
#include "gc/parallel/psCardTable.hpp"
@@ -122,13 +121,38 @@ class PSStripeShadowCardTable {
const uint _card_shift;
const uint _card_size;
CardValue _table[PSCardTable::num_cards_in_stripe];
- const CardValue* _table_base;
+ uintptr_t _table_base;
+
+ // Avoid UB pointer operations by using integers internally.
+
+ static_assert(sizeof(uintptr_t) == sizeof(CardValue*), "simplifying assumption");
+ static_assert(sizeof(CardValue) == 1, "simplifying assumption");
+
+ static uintptr_t iaddr(const void* p) {
+ return reinterpret_cast(p);
+ }
+
+ uintptr_t compute_table_base(HeapWord* start) const {
+ uintptr_t offset = iaddr(start) >> _card_shift;
+ return iaddr(_table) - offset;
+ }
+
+ void verify_card_inclusive(const CardValue* card) const {
+ assert(iaddr(card) >= iaddr(_table), "out of bounds");
+ assert(iaddr(card) <= (iaddr(_table) + sizeof(_table)), "out of bounds");
+ }
+
+ void verify_card_exclusive(const CardValue* card) const {
+ assert(iaddr(card) >= iaddr(_table), "out of bounds");
+ assert(iaddr(card) < (iaddr(_table) + sizeof(_table)), "out of bounds");
+ }
public:
PSStripeShadowCardTable(PSCardTable* pst, HeapWord* const start, HeapWord* const end) :
_card_shift(CardTable::card_shift()),
_card_size(CardTable::card_size()),
- _table_base(_table - (uintptr_t(start) >> _card_shift)) {
+ _table_base(compute_table_base(start))
+ {
size_t stripe_byte_size = pointer_delta(end, start) * HeapWordSize;
size_t copy_length = align_up(stripe_byte_size, _card_size) >> _card_shift;
// The end of the last stripe may not be card aligned as it is equal to old
@@ -143,12 +167,16 @@ class PSStripeShadowCardTable {
}
HeapWord* addr_for(const CardValue* const card) {
- assert(card >= _table && card <= &_table[PSCardTable::num_cards_in_stripe], "out of bounds");
- return (HeapWord*) ((card - _table_base) << _card_shift);
+ verify_card_inclusive(card);
+ uintptr_t addr = (iaddr(card) - _table_base) << _card_shift;
+ return reinterpret_cast(addr);
}
const CardValue* card_for(HeapWord* addr) {
- return &_table_base[uintptr_t(addr) >> _card_shift];
+ uintptr_t icard = _table_base + (iaddr(addr) >> _card_shift);
+ const CardValue* card = reinterpret_cast(icard);
+ verify_card_inclusive(card);
+ return card;
}
bool is_dirty(const CardValue* const card) {
@@ -156,7 +184,7 @@ class PSStripeShadowCardTable {
}
bool is_clean(const CardValue* const card) {
- assert(card >= _table && card < &_table[PSCardTable::num_cards_in_stripe], "out of bounds");
+ verify_card_exclusive(card);
return *card == PSCardTable::clean_card_val();
}
diff --git a/src/hotspot/share/gc/parallel/psClosure.inline.hpp b/src/hotspot/share/gc/parallel/psClosure.inline.hpp
index 7425b65739d16..5cc059a09f50d 100644
--- a/src/hotspot/share/gc/parallel/psClosure.inline.hpp
+++ b/src/hotspot/share/gc/parallel/psClosure.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -45,7 +45,7 @@ class PSAdjustWeakRootsClosure final: public OopClosure {
oop new_obj = o->forwardee();
if (log_develop_is_enabled(Trace, gc, scavenge)) {
ResourceMark rm; // required by internal_name()
- log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (" SIZE_FORMAT ")}",
+ log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%zu)}",
"forwarding",
new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
}
diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.cpp b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
index 19bb22fb91523..0601c5047ebe3 100644
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/objectStartArray.hpp"
#include "gc/parallel/parMarkBitMap.inline.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
diff --git a/src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.cpp b/src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.cpp
index ed96c5c418157..561d6009d59f0 100644
--- a/src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.cpp
+++ b/src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/psGCAdaptivePolicyCounters.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/parallel/psGenerationCounters.cpp b/src/hotspot/share/gc/parallel/psGenerationCounters.cpp
index 1b0e8d320a93e..8792df7cf277f 100644
--- a/src/hotspot/share/gc/parallel/psGenerationCounters.cpp
+++ b/src/hotspot/share/gc/parallel/psGenerationCounters.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/psGenerationCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/parallel/psMemoryPool.cpp b/src/hotspot/share/gc/parallel/psMemoryPool.cpp
index cd92e86c98b57..c120664600bb1 100644
--- a/src/hotspot/share/gc/parallel/psMemoryPool.cpp
+++ b/src/hotspot/share/gc/parallel/psMemoryPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/psMemoryPool.hpp"
PSGenerationPool::PSGenerationPool(PSOldGen* old_gen,
diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp
index 52ea4dc042cbb..ab74d3468e19e 100644
--- a/src/hotspot/share/gc/parallel/psOldGen.cpp
+++ b/src/hotspot/share/gc/parallel/psOldGen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/objectStartArray.inline.hpp"
#include "gc/parallel/parallelArguments.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
@@ -251,7 +250,7 @@ bool PSOldGen::expand_by(size_t bytes) {
if (result) {
size_t new_mem_size = virtual_space()->committed_size();
size_t old_mem_size = new_mem_size - bytes;
- log_debug(gc)("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
+ log_debug(gc)("Expanding %s from %zuK by %zuK to %zuK",
name(), old_mem_size/K, bytes/K, new_mem_size/K);
}
@@ -279,7 +278,7 @@ void PSOldGen::shrink(size_t bytes) {
size_t new_mem_size = virtual_space()->committed_size();
size_t old_mem_size = new_mem_size + bytes;
- log_debug(gc)("Shrinking %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
+ log_debug(gc)("Shrinking %s from %zuK by %zuK to %zuK",
name(), old_mem_size/K, bytes/K, new_mem_size/K);
}
}
@@ -309,9 +308,9 @@ void PSOldGen::resize(size_t desired_free_space) {
const size_t current_size = capacity_in_bytes();
log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: "
- "desired free: " SIZE_FORMAT " used: " SIZE_FORMAT
- " new size: " SIZE_FORMAT " current size " SIZE_FORMAT
- " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT,
+ "desired free: %zu used: %zu"
+ " new size: %zu current size %zu"
+ " gen limits: %zu / %zu",
desired_free_space, used_in_bytes(), new_size, current_size,
max_gen_size(), min_gen_size());
@@ -329,7 +328,7 @@ void PSOldGen::resize(size_t desired_free_space) {
shrink(change_bytes);
}
- log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: collection: %d (" SIZE_FORMAT ") -> (" SIZE_FORMAT ") ",
+ log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: collection: %d (%zu) -> (%zu) ",
ParallelScavengeHeap::heap()->total_collections(),
size_before,
virtual_space()->committed_size());
@@ -367,7 +366,7 @@ void PSOldGen::post_resize() {
void PSOldGen::print() const { print_on(tty);}
void PSOldGen::print_on(outputStream* st) const {
st->print(" %-15s", name());
- st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
+ st->print(" total %zuK, used %zuK",
capacity_in_bytes()/K, used_in_bytes()/K);
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
p2i(virtual_space()->low_boundary()),
diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
index 1aadcbeba3316..bdc53db29b844 100644
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/stringTable.hpp"
@@ -584,16 +583,16 @@ bool PSParallelCompact::initialize_aux_data() {
if (!_mark_bitmap.initialize(mr)) {
vm_shutdown_during_initialization(
- err_msg("Unable to allocate " SIZE_FORMAT "KB bitmaps for parallel "
- "garbage collection for the requested " SIZE_FORMAT "KB heap.",
+ err_msg("Unable to allocate %zuKB bitmaps for parallel "
+ "garbage collection for the requested %zuKB heap.",
_mark_bitmap.reserved_byte_size()/K, mr.byte_size()/K));
return false;
}
if (!_summary_data.initialize(mr)) {
vm_shutdown_during_initialization(
- err_msg("Unable to allocate " SIZE_FORMAT "KB card tables for parallel "
- "garbage collection for the requested " SIZE_FORMAT "KB heap.",
+ err_msg("Unable to allocate %zuKB card tables for parallel "
+ "garbage collection for the requested %zuKB heap.",
_summary_data.reserved_byte_size()/K, mr.byte_size()/K));
return false;
}
@@ -1075,7 +1074,7 @@ bool PSParallelCompact::invoke_no_policy(bool clear_all_soft_refs) {
if (UseAdaptiveSizePolicy) {
log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections());
- log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT,
+ log_trace(gc, ergo)("old_gen_capacity: %zu young_gen_capacity: %zu",
old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
// Don't check if the size_policy is ready here. Let
@@ -1688,7 +1687,7 @@ class FillableRegionLogger : public StackObj {
public:
FillableRegionLogger() : _next_index(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)), _total_regions(0) { }
~FillableRegionLogger() {
- log.trace(SIZE_FORMAT " initially fillable regions", _total_regions);
+ log.trace("%zu initially fillable regions", _total_regions);
}
void print_line() {
@@ -1697,7 +1696,7 @@ class FillableRegionLogger : public StackObj {
}
FormatBuffer<> line("Fillable: ");
for (int i = 0; i < _next_index; i++) {
- line.append(" " SIZE_FORMAT_W(7), _regions[i]);
+ line.append(" %7zu", _regions[i]);
}
log.trace("%s", line.buffer());
_next_index = 0;
diff --git a/src/hotspot/share/gc/parallel/psPromotionLAB.cpp b/src/hotspot/share/gc/parallel/psPromotionLAB.cpp
index 4c3367cdf9c98..e3ed819ceb1ef 100644
--- a/src/hotspot/share/gc/parallel/psPromotionLAB.cpp
+++ b/src/hotspot/share/gc/parallel/psPromotionLAB.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/mutableSpace.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psPromotionLAB.hpp"
diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.cpp b/src/hotspot/share/gc/parallel/psPromotionManager.cpp
index 69fdde5ea9ff2..12758f1b66147 100644
--- a/src/hotspot/share/gc/parallel/psPromotionManager.cpp
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "gc/parallel/mutableSpace.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
diff --git a/src/hotspot/share/gc/parallel/psScavenge.cpp b/src/hotspot/share/gc/parallel/psScavenge.cpp
index 101f06b8fe0b7..7434097da21cd 100644
--- a/src/hotspot/share/gc/parallel/psScavenge.cpp
+++ b/src/hotspot/share/gc/parallel/psScavenge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/stringTable.hpp"
#include "code/codeCache.hpp"
@@ -460,7 +459,7 @@ bool PSScavenge::invoke(bool clear_soft_refs) {
// Calculate the new survivor size and tenuring threshold
log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections());
- log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT,
+ log_trace(gc, ergo)("old_gen_capacity: %zu young_gen_capacity: %zu",
old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
if (UsePerfData) {
@@ -628,7 +627,7 @@ bool PSScavenge::should_attempt_scavenge() {
size_t free_in_old_gen = old_gen->max_gen_size() - old_gen->used_in_bytes();
bool result = promotion_estimate < free_in_old_gen;
- log_trace(ergo)("%s scavenge: average_promoted " SIZE_FORMAT " padded_average_promoted " SIZE_FORMAT " free in old gen " SIZE_FORMAT,
+ log_trace(ergo)("%s scavenge: average_promoted %zu padded_average_promoted %zu free in old gen %zu",
result ? "Do" : "Skip", (size_t) policy->average_promoted_in_bytes(),
(size_t) policy->padded_average_promoted_in_bytes(),
free_in_old_gen);
diff --git a/src/hotspot/share/gc/parallel/psVMOperations.cpp b/src/hotspot/share/gc/parallel/psVMOperations.cpp
index d4d2e1df21f24..674e51bf6d277 100644
--- a/src/hotspot/share/gc/parallel/psVMOperations.cpp
+++ b/src/hotspot/share/gc/parallel/psVMOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp"
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
#include "gc/parallel/psScavenge.hpp"
diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.cpp b/src/hotspot/share/gc/parallel/psVirtualspace.cpp
index ee8a564e3063d..ce4cd4ad977a6 100644
--- a/src/hotspot/share/gc/parallel/psVirtualspace.cpp
+++ b/src/hotspot/share/gc/parallel/psVirtualspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/psVirtualspace.hpp"
#include "memory/reservedSpace.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/gc/parallel/psYoungGen.cpp b/src/hotspot/share/gc/parallel/psYoungGen.cpp
index dd9619e454656..82b946201d2ee 100644
--- a/src/hotspot/share/gc/parallel/psYoungGen.cpp
+++ b/src/hotspot/share/gc/parallel/psYoungGen.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/mutableNUMASpace.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psScavenge.hpp"
@@ -256,9 +255,9 @@ void PSYoungGen::resize(size_t eden_size, size_t survivor_size) {
space_invariants();
log_trace(gc, ergo)("Young generation size: "
- "desired eden: " SIZE_FORMAT " survivor: " SIZE_FORMAT
- " used: " SIZE_FORMAT " capacity: " SIZE_FORMAT
- " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT,
+ "desired eden: %zu survivor: %zu"
+ " used: %zu capacity: %zu"
+ " gen limits: %zu / %zu",
eden_size, survivor_size, used_in_bytes(), capacity_in_bytes(),
max_gen_size(), min_gen_size());
}
@@ -315,15 +314,15 @@ bool PSYoungGen::resize_generation(size_t eden_size, size_t survivor_size) {
}
} else {
if (orig_size == max_gen_size()) {
- log_trace(gc)("PSYoung generation size at maximum: " SIZE_FORMAT "K", orig_size/K);
+ log_trace(gc)("PSYoung generation size at maximum: %zuK", orig_size/K);
} else if (orig_size == min_gen_size()) {
- log_trace(gc)("PSYoung generation size at minimum: " SIZE_FORMAT "K", orig_size/K);
+ log_trace(gc)("PSYoung generation size at minimum: %zuK", orig_size/K);
}
}
if (size_changed) {
post_resize();
- log_trace(gc)("PSYoung generation size changed: " SIZE_FORMAT "K->" SIZE_FORMAT "K",
+ log_trace(gc)("PSYoung generation size changed: %zuK->%zuK",
orig_size/K, virtual_space()->committed_size()/K);
}
@@ -420,21 +419,21 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
return;
}
- log_trace(gc, ergo)("PSYoungGen::resize_spaces(requested_eden_size: " SIZE_FORMAT ", requested_survivor_size: " SIZE_FORMAT ")",
+ log_trace(gc, ergo)("PSYoungGen::resize_spaces(requested_eden_size: %zu, requested_survivor_size: %zu)",
requested_eden_size, requested_survivor_size);
- log_trace(gc, ergo)(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") %zu",
p2i(eden_space()->bottom()),
p2i(eden_space()->end()),
pointer_delta(eden_space()->end(),
eden_space()->bottom(),
sizeof(char)));
- log_trace(gc, ergo)(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" from: [" PTR_FORMAT ".." PTR_FORMAT ") %zu",
p2i(from_space()->bottom()),
p2i(from_space()->end()),
pointer_delta(from_space()->end(),
from_space()->bottom(),
sizeof(char)));
- log_trace(gc, ergo)(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" to: [" PTR_FORMAT ".." PTR_FORMAT ") %zu",
p2i(to_space()->bottom()),
p2i(to_space()->end()),
pointer_delta( to_space()->end(),
@@ -525,15 +524,15 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
guarantee(to_start != to_end, "to space is zero sized");
- log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") %zu",
p2i(eden_start),
p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char)));
- log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") %zu",
p2i(from_start),
p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char)));
- log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") %zu",
p2i(to_start),
p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char)));
@@ -575,15 +574,15 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
eden_end = MAX2(eden_end, eden_start + SpaceAlignment);
to_start = MAX2(to_start, eden_end);
- log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") %zu",
p2i(eden_start),
p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char)));
- log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") %zu",
p2i(to_start),
p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char)));
- log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
+ log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") %zu",
p2i(from_start),
p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char)));
@@ -646,7 +645,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
assert(from_space()->top() == old_from_top, "from top changed!");
- log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: collection: %d (" SIZE_FORMAT ", " SIZE_FORMAT ") -> (" SIZE_FORMAT ", " SIZE_FORMAT ") ",
+ log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: collection: %d (%zu, %zu) -> (%zu, %zu) ",
ParallelScavengeHeap::heap()->total_collections(),
old_from, old_to,
from_space()->capacity_in_bytes(),
@@ -702,7 +701,7 @@ void PSYoungGen::object_iterate(ObjectClosure* blk) {
void PSYoungGen::print() const { print_on(tty); }
void PSYoungGen::print_on(outputStream* st) const {
st->print(" %-15s", "PSYoungGen");
- st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
+ st->print(" total %zuK, used %zuK",
capacity_in_bytes()/K, used_in_bytes()/K);
virtual_space()->print_space_boundaries_on(st);
st->print(" eden"); eden_space()->print_on(st);
diff --git a/src/hotspot/share/gc/parallel/spaceCounters.cpp b/src/hotspot/share/gc/parallel/spaceCounters.cpp
index 588c743d86587..4133fc2e2480a 100644
--- a/src/hotspot/share/gc/parallel/spaceCounters.cpp
+++ b/src/hotspot/share/gc/parallel/spaceCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/parallel/spaceCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/serial/cSpaceCounters.cpp b/src/hotspot/share/gc/serial/cSpaceCounters.cpp
index 6a9b51245783a..9f8b91e205cd0 100644
--- a/src/hotspot/share/gc/serial/cSpaceCounters.cpp
+++ b/src/hotspot/share/gc/serial/cSpaceCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/cSpaceCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/serial/cardTableRS.cpp b/src/hotspot/share/gc/serial/cardTableRS.cpp
index 1c1781e280efa..80985424a62ad 100644
--- a/src/hotspot/share/gc/serial/cardTableRS.cpp
+++ b/src/hotspot/share/gc/serial/cardTableRS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/generation.hpp"
diff --git a/src/hotspot/share/gc/serial/defNewGeneration.cpp b/src/hotspot/share/gc/serial/defNewGeneration.cpp
index f78a766c4c3b8..f637eb62a00f2 100644
--- a/src/hotspot/share/gc/serial/defNewGeneration.cpp
+++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/serialGcRefProcProxyTask.hpp"
#include "gc/serial/serialHeap.inline.hpp"
@@ -480,11 +479,11 @@ void DefNewGeneration::compute_new_size() {
gch->rem_set()->resize_covered_region(cmr);
log_debug(gc, ergo, heap)(
- "New generation size " SIZE_FORMAT "K->" SIZE_FORMAT "K [eden=" SIZE_FORMAT "K,survivor=" SIZE_FORMAT "K]",
+ "New generation size %zuK->%zuK [eden=%zuK,survivor=%zuK]",
new_size_before/K, _virtual_space.committed_size()/K,
eden()->capacity()/K, from()->capacity()/K);
log_trace(gc, ergo, heap)(
- " [allowed " SIZE_FORMAT "K extra for %d threads]",
+ " [allowed %zuK extra for %d threads]",
thread_increase_size/K, threads_count);
}
}
@@ -715,7 +714,7 @@ void DefNewGeneration::remove_forwarding_pointers() {
}
void DefNewGeneration::handle_promotion_failure(oop old) {
- log_debug(gc, promotion)("Promotion failure size = " SIZE_FORMAT ") ", old->size());
+ log_debug(gc, promotion)("Promotion failure size = %zu) ", old->size());
_promotion_failed = true;
_promotion_failed_info.register_copy_failure(old->size());
@@ -840,7 +839,7 @@ void DefNewGeneration::verify() {
void DefNewGeneration::print_on(outputStream* st) const {
st->print(" %-10s", name());
- st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
+ st->print(" total %zuK, used %zuK",
capacity()/K, used()/K);
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
p2i(_virtual_space.low_boundary()),
diff --git a/src/hotspot/share/gc/serial/generation.cpp b/src/hotspot/share/gc/serial/generation.cpp
index b15b071d7103f..61b128464e135 100644
--- a/src/hotspot/share/gc/serial/generation.cpp
+++ b/src/hotspot/share/gc/serial/generation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/generation.hpp"
#include "gc/serial/serialHeap.hpp"
diff --git a/src/hotspot/share/gc/serial/serialArguments.cpp b/src/hotspot/share/gc/serial/serialArguments.cpp
index c9d2caf9063c8..9b55e0cd9f69b 100644
--- a/src/hotspot/share/gc/serial/serialArguments.cpp
+++ b/src/hotspot/share/gc/serial/serialArguments.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/fullGCForwarding.hpp"
#include "gc/shared/gcArguments.hpp"
#include "gc/serial/serialArguments.hpp"
diff --git a/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp b/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp
index bfb4a65baa62e..5fd55e2a73da1 100644
--- a/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp
+++ b/src/hotspot/share/gc/serial/serialBlockOffsetTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/serialBlockOffsetTable.inline.hpp"
#include "gc/shared/blockOffsetTable.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/serial/serialFullGC.cpp b/src/hotspot/share/gc/serial/serialFullGC.cpp
index 0df28fa7bd5d2..9d0dc1932fcbc 100644
--- a/src/hotspot/share/gc/serial/serialFullGC.cpp
+++ b/src/hotspot/share/gc/serial/serialFullGC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
@@ -133,7 +132,7 @@ class DeadSpacer : StackObj {
// obj->set_mark(obj->mark().set_marked());
assert(dead_length == obj->size(), "bad filler object size");
- log_develop_trace(gc, compaction)("Inserting object to dead space: " PTR_FORMAT ", " PTR_FORMAT ", " SIZE_FORMAT "b",
+ log_develop_trace(gc, compaction)("Inserting object to dead space: " PTR_FORMAT ", " PTR_FORMAT ", %zub",
p2i(dead_start), p2i(dead_end), dead_length * HeapWordSize);
return true;
@@ -651,7 +650,7 @@ void SerialFullGC::adjust_marks() {
}
void SerialFullGC::restore_marks() {
- log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_overflow_stack_set.get()->size());
+ log_trace(gc)("Restoring %zu marks", _preserved_count + _preserved_overflow_stack_set.get()->size());
// restore the marks we saved earlier
for (size_t i = 0; i < _preserved_count; i++) {
diff --git a/src/hotspot/share/gc/serial/serialHeap.cpp b/src/hotspot/share/gc/serial/serialHeap.cpp
index 23f1df6fc66db..bae627cd1de0c 100644
--- a/src/hotspot/share/gc/serial/serialHeap.cpp
+++ b/src/hotspot/share/gc/serial/serialHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
@@ -219,8 +218,7 @@ ReservedHeapSpace SerialHeap::allocate(size_t alignment) {
"the maximum representable size");
}
assert(total_reserved % alignment == 0,
- "Gen size; total_reserved=" SIZE_FORMAT ", alignment="
- SIZE_FORMAT, total_reserved, alignment);
+ "Gen size; total_reserved=%zu, alignment=%zu", total_reserved, alignment);
ReservedHeapSpace heap_rs = Universe::reserve_heap(total_reserved, alignment);
size_t used_page_size = heap_rs.page_size();
@@ -400,7 +398,7 @@ HeapWord* SerialHeap::mem_allocate_work(size_t size,
if ((QueuedAllocationWarningCount > 0) &&
(try_count % QueuedAllocationWarningCount == 0)) {
log_warning(gc, ergo)("SerialHeap::mem_allocate_work retries %d times,"
- " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : "");
+ " size=%zu %s", try_count, size, is_tlab ? "(TLAB)" : "");
}
}
}
diff --git a/src/hotspot/share/gc/serial/serialHeap.hpp b/src/hotspot/share/gc/serial/serialHeap.hpp
index d787d216e37ab..d35809bf3a1d6 100644
--- a/src/hotspot/share/gc/serial/serialHeap.hpp
+++ b/src/hotspot/share/gc/serial/serialHeap.hpp
@@ -111,6 +111,9 @@ class SerialHeap : public CollectedHeap {
bool is_young_gc_safe() const;
+ void gc_prologue(bool full);
+ void gc_epilogue(bool full);
+
public:
// Returns JNI_OK on success
jint initialize() override;
@@ -226,10 +229,6 @@ class SerialHeap : public CollectedHeap {
SO_ScavengeCodeCache = 0x10
};
- protected:
- virtual void gc_prologue(bool full);
- virtual void gc_epilogue(bool full);
-
public:
// Apply closures on various roots in Young GC or marking/adjust phases of Full GC.
void process_roots(ScanningOption so,
diff --git a/src/hotspot/share/gc/serial/serialMemoryPools.cpp b/src/hotspot/share/gc/serial/serialMemoryPools.cpp
index b82252b5a094f..723b53a3e2b0b 100644
--- a/src/hotspot/share/gc/serial/serialMemoryPools.cpp
+++ b/src/hotspot/share/gc/serial/serialMemoryPools.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/serialMemoryPools.hpp"
#include "gc/serial/tenuredGeneration.hpp"
diff --git a/src/hotspot/share/gc/serial/serialStringDedup.cpp b/src/hotspot/share/gc/serial/serialStringDedup.cpp
index 93910ae65d375..486affd3d20a3 100644
--- a/src/hotspot/share/gc/serial/serialStringDedup.cpp
+++ b/src/hotspot/share/gc/serial/serialStringDedup.cpp
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/serialHeap.hpp"
#include "gc/serial/serialStringDedup.hpp"
diff --git a/src/hotspot/share/gc/serial/serialVMOperations.cpp b/src/hotspot/share/gc/serial/serialVMOperations.cpp
index 36805f619ecb8..445f5959fe077 100644
--- a/src/hotspot/share/gc/serial/serialVMOperations.cpp
+++ b/src/hotspot/share/gc/serial/serialVMOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/serialVMOperations.hpp"
#include "gc/shared/gcLocker.hpp"
diff --git a/src/hotspot/share/gc/serial/tenuredGeneration.cpp b/src/hotspot/share/gc/serial/tenuredGeneration.cpp
index 2b7711e9b0a9e..e3b7eef478ace 100644
--- a/src/hotspot/share/gc/serial/tenuredGeneration.cpp
+++ b/src/hotspot/share/gc/serial/tenuredGeneration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/serial/serialBlockOffsetTable.inline.hpp"
#include "gc/serial/serialFullGC.hpp"
@@ -69,7 +68,7 @@ bool TenuredGeneration::grow_by(size_t bytes) {
size_t new_mem_size = _virtual_space.committed_size();
size_t old_mem_size = new_mem_size - bytes;
- log_trace(gc, heap)("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
+ log_trace(gc, heap)("Expanding %s from %zuK by %zuK to %zuK",
name(), old_mem_size/K, bytes/K, new_mem_size/K);
}
return result;
@@ -140,7 +139,7 @@ void TenuredGeneration::shrink(size_t bytes) {
size_t new_mem_size = _virtual_space.committed_size();
size_t old_mem_size = new_mem_size + size;
- log_trace(gc, heap)("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K",
+ log_trace(gc, heap)("Shrinking %s from %zuK to %zuK",
name(), old_mem_size/K, new_mem_size/K);
}
@@ -236,7 +235,7 @@ void TenuredGeneration::compute_new_size_inner() {
assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size");
log_trace(gc, heap)(" shrinking: initSize: %.1fK maximum_desired_capacity: %.1fK",
OldSize / (double) K, maximum_desired_capacity / (double) K);
- log_trace(gc, heap)(" shrink_bytes: %.1fK current_shrink_factor: " SIZE_FORMAT " new shrink factor: " SIZE_FORMAT " _min_heap_delta_bytes: %.1fK",
+ log_trace(gc, heap)(" shrink_bytes: %.1fK current_shrink_factor: %zu new shrink factor: %zu _min_heap_delta_bytes: %.1fK",
shrink_bytes / (double) K,
current_shrink_factor,
_shrink_factor,
@@ -354,8 +353,8 @@ void TenuredGeneration::compute_new_size() {
compute_new_size_inner();
assert(used() == used_after_gc && used_after_gc <= capacity(),
- "used: " SIZE_FORMAT " used_after_gc: " SIZE_FORMAT
- " capacity: " SIZE_FORMAT, used(), used_after_gc, capacity());
+ "used: %zu used_after_gc: %zu"
+ " capacity: %zu", used(), used_after_gc, capacity());
}
void TenuredGeneration::update_promote_stats() {
@@ -384,7 +383,7 @@ bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes)
bool res = (promotion_estimate <= available);
- log_trace(gc)("Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "), max_promo(" SIZE_FORMAT ")",
+ log_trace(gc)("Tenured: promo attempt is%s safe: available(%zu) %s av_promo(%zu), max_promo(%zu)",
res? "":" not", available, res? ">=":"<", avg_promoted, max_promotion_in_bytes);
return res;
@@ -445,7 +444,7 @@ void TenuredGeneration::verify() {
void TenuredGeneration::print_on(outputStream* st) const {
st->print(" %-10s", name());
- st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
+ st->print(" total %zuK, used %zuK",
capacity()/K, used()/K);
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
p2i(_virtual_space.low_boundary()),
diff --git a/src/hotspot/share/gc/shared/accessBarrierSupport.cpp b/src/hotspot/share/gc/shared/accessBarrierSupport.cpp
index 93e88f82dba6a..35ea85571c2d3 100644
--- a/src/hotspot/share/gc/shared/accessBarrierSupport.cpp
+++ b/src/hotspot/share/gc/shared/accessBarrierSupport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "gc/shared/accessBarrierSupport.inline.hpp"
#include "oops/access.hpp"
diff --git a/src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp b/src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp
index 1454a2b21e94d..3ebcdaaaf21b8 100644
--- a/src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp
+++ b/src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/adaptiveSizePolicy.hpp"
#include "gc/shared/gcCause.hpp"
#include "gc/shared/gcUtil.hpp"
@@ -337,11 +336,11 @@ class AdaptiveSizePolicySpaceOverheadTester: public GCOverheadTester {
log_trace(gc, ergo)(
"AdaptiveSizePolicySpaceOverheadTester::is_exceeded:"
- " promo_limit: " SIZE_FORMAT
- " total_free_limit: " SIZE_FORMAT
- " max_old_gen_size: " SIZE_FORMAT
- " max_eden_size: " SIZE_FORMAT
- " mem_free_limit: " SIZE_FORMAT,
+ " promo_limit: %zu"
+ " total_free_limit: %zu"
+ " max_old_gen_size: %zu"
+ " max_eden_size: %zu"
+ " mem_free_limit: %zu",
promo_limit, total_free_limit,
_max_old_gen_size, _max_eden_size,
(size_t)mem_free_limit);
diff --git a/src/hotspot/share/gc/shared/ageTable.cpp b/src/hotspot/share/gc/shared/ageTable.cpp
index 28f17a4220b89..f5b62466556ed 100644
--- a/src/hotspot/share/gc/shared/ageTable.cpp
+++ b/src/hotspot/share/gc/shared/ageTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/ageTable.inline.hpp"
#include "gc/shared/ageTableTracer.hpp"
#include "gc/shared/collectedHeap.hpp"
@@ -35,7 +34,7 @@
#include "utilities/copy.hpp"
#include "logging/logStream.hpp"
-/* Copyright (c) 1992, 2024, Oracle and/or its affiliates, and Stanford University.
+/* Copyright (c) 1992, 2025, Oracle and/or its affiliates, and Stanford University.
See the LICENSE file for license information. */
AgeTable::AgeTable(bool global) : _use_perf_data(UsePerfData && global) {
@@ -108,7 +107,7 @@ uint AgeTable::compute_tenuring_threshold(size_t desired_survivor_size) {
}
- log_debug(gc, age)("Desired survivor size %zu bytes, new threshold " UINTX_FORMAT " (max threshold %u)",
+ log_debug(gc, age)("Desired survivor size %zu bytes, new threshold %zu (max threshold %u)",
desired_survivor_size * oopSize, (uintx) result, MaxTenuringThreshold);
return result;
@@ -131,7 +130,7 @@ void AgeTable::print_on(outputStream* st) {
size_t word_size = sizes[age];
total += word_size;
if (word_size > 0) {
- st->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total",
+ st->print_cr("- age %3u: %10zu bytes, %10zu total",
age, word_size * oopSize, total * oopSize);
}
AgeTableTracer::send_tenuring_distribution_event(age, word_size * oopSize);
diff --git a/src/hotspot/share/gc/shared/ageTableTracer.cpp b/src/hotspot/share/gc/shared/ageTableTracer.cpp
index 5e0fbcfbcb11e..c178ce99f565c 100644
--- a/src/hotspot/share/gc/shared/ageTableTracer.cpp
+++ b/src/hotspot/share/gc/shared/ageTableTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/ageTableTracer.hpp"
#include "gc/shared/gcId.hpp"
#include "jfr/jfrEvents.hpp"
diff --git a/src/hotspot/share/gc/shared/allocTracer.cpp b/src/hotspot/share/gc/shared/allocTracer.cpp
index 45fa0c7e631bd..bfd4ed75914af 100644
--- a/src/hotspot/share/gc/shared/allocTracer.cpp
+++ b/src/hotspot/share/gc/shared/allocTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/allocTracer.hpp"
#include "jfr/jfrEvents.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/shared/barrierSet.cpp b/src/hotspot/share/gc/shared/barrierSet.cpp
index c3a0c9cbbff0d..65ad476adc426 100644
--- a/src/hotspot/share/gc/shared/barrierSet.cpp
+++ b/src/hotspot/share/gc/shared/barrierSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
diff --git a/src/hotspot/share/gc/shared/barrierSetNMethod.cpp b/src/hotspot/share/gc/shared/barrierSetNMethod.cpp
index d61664cf5a6fc..4b81f321be3b7 100644
--- a/src/hotspot/share/gc/shared/barrierSetNMethod.cpp
+++ b/src/hotspot/share/gc/shared/barrierSetNMethod.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/share/gc/shared/barrierSetStackChunk.cpp b/src/hotspot/share/gc/shared/barrierSetStackChunk.cpp
index aa5dfe787f7c6..9bbfdf5ba7ace 100644
--- a/src/hotspot/share/gc/shared/barrierSetStackChunk.cpp
+++ b/src/hotspot/share/gc/shared/barrierSetStackChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSetStackChunk.hpp"
#include "memory/iterator.hpp"
#include "oops/access.inline.hpp"
diff --git a/src/hotspot/share/gc/shared/bufferNode.cpp b/src/hotspot/share/gc/shared/bufferNode.cpp
index 9baa812c56ecd..e27b1279c7904 100644
--- a/src/hotspot/share/gc/shared/bufferNode.cpp
+++ b/src/hotspot/share/gc/shared/bufferNode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/bufferNode.hpp"
#include "utilities/debug.hpp"
#include "memory/allocation.inline.hpp"
@@ -68,4 +67,3 @@ void BufferNode::Allocator::release(BufferNode* node) {
node->~BufferNode();
_free_list.release(node);
}
-
diff --git a/src/hotspot/share/gc/shared/bufferNodeList.cpp b/src/hotspot/share/gc/shared/bufferNodeList.cpp
index 4a527b3d64241..768f40e0985c2 100644
--- a/src/hotspot/share/gc/shared/bufferNodeList.cpp
+++ b/src/hotspot/share/gc/shared/bufferNodeList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/bufferNodeList.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp b/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp
index 046a7ee586572..ac640fb88d259 100644
--- a/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp
+++ b/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_LIRGenerator.hpp"
#include "classfile/javaClasses.hpp"
diff --git a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp
index 21b1ef7ea7e54..1cf629ca6b21c 100644
--- a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp
+++ b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/c1/cardTableBarrierSetC1.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
diff --git a/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp b/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp
index c2074c2859fe3..d7d463d252e4e 100644
--- a/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp
+++ b/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/c1/modRefBarrierSetC1.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
index 080af1c9693ed..3d59e972925a0 100644
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/vmreg.inline.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/tlab_globals.hpp"
diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp
index 7997492188b9d..870e351db6690 100644
--- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciUtilities.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
@@ -50,13 +49,9 @@ Node* CardTableBarrierSetC2::byte_map_base_node(GraphKit* kit) const {
// Insert a write-barrier store. This is to let generational GC work; we have
// to flag all oop-stores before the next GC point.
void CardTableBarrierSetC2::post_barrier(GraphKit* kit,
- Node* ctl,
- Node* oop_store,
Node* obj,
Node* adr,
- uint adr_idx,
Node* val,
- BasicType bt,
bool use_precise) const {
// No store check needed if we're storing a null.
if (val != nullptr && val->is_Con()) {
diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp
index 3abb6068f4a47..a380ec4a484cf 100644
--- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp
+++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp
@@ -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
@@ -30,13 +30,9 @@
class CardTableBarrierSetC2: public ModRefBarrierSetC2 {
protected:
virtual void post_barrier(GraphKit* kit,
- Node* ctl,
- Node* store,
Node* obj,
Node* adr,
- uint adr_idx,
Node* val,
- BasicType bt,
bool use_precise) const;
Node* byte_map_base_node(GraphKit* kit) const;
diff --git a/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp
index a8a1fb58fce16..cf5d3fc7e1668 100644
--- a/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -22,18 +22,14 @@
*
*/
-#include "precompiled.hpp"
#include "opto/arraycopynode.hpp"
#include "opto/graphKit.hpp"
#include "opto/idealKit.hpp"
-#include "opto/narrowptrnode.hpp"
#include "gc/shared/c2/modRefBarrierSetC2.hpp"
-#include "utilities/macros.hpp"
Node* ModRefBarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val) const {
DecoratorSet decorators = access.decorators();
- const TypePtr* adr_type = access.addr().type();
Node* adr = access.addr().node();
bool is_array = (decorators & IS_ARRAY) != 0;
@@ -48,36 +44,22 @@ Node* ModRefBarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue& val
assert(access.is_parse_access(), "entry not supported at optimization time");
C2ParseAccess& parse_access = static_cast(access);
- GraphKit* kit = parse_access.kit();
- uint adr_idx = kit->C->get_alias_index(adr_type);
- assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
-
- pre_barrier(kit, true /* do_load */, kit->control(), access.base(), adr, adr_idx, val.node(),
- static_cast(val.type()), nullptr /* pre_val */, access.type());
Node* store = BarrierSetC2::store_at_resolved(access, val);
- post_barrier(kit, kit->control(), access.raw_access(), access.base(), adr, adr_idx, val.node(),
- access.type(), use_precise);
+ post_barrier(parse_access.kit(), access.base(), adr, val.node(), use_precise);
return store;
}
Node* ModRefBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
Node* new_val, const Type* value_type) const {
- GraphKit* kit = access.kit();
-
if (!access.is_oop()) {
return BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type);
}
- pre_barrier(kit, false /* do_load */,
- kit->control(), nullptr, nullptr, max_juint, nullptr, nullptr,
- expected_val /* pre_val */, T_OBJECT);
-
Node* result = BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type);
- post_barrier(kit, kit->control(), access.raw_access(), access.base(),
- access.addr().node(), access.alias_idx(), new_val, T_OBJECT, true);
+ post_barrier(access.kit(), access.base(), access.addr().node(), new_val, true);
return result;
}
@@ -90,10 +72,6 @@ Node* ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& a
return BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type);
}
- pre_barrier(kit, false /* do_load */,
- kit->control(), nullptr, nullptr, max_juint, nullptr, nullptr,
- expected_val /* pre_val */, T_OBJECT);
-
Node* load_store = BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type);
// Emit the post barrier only when the actual store happened. This makes sense
@@ -109,8 +87,7 @@ Node* ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& a
IdealKit ideal(kit);
ideal.if_then(load_store, BoolTest::ne, ideal.ConI(0), PROB_STATIC_FREQUENT); {
kit->sync_kit(ideal);
- post_barrier(kit, ideal.ctrl(), access.raw_access(), access.base(),
- access.addr().node(), access.alias_idx(), new_val, T_OBJECT, true);
+ post_barrier(kit, access.base(), access.addr().node(), new_val, true);
ideal.sync_kit(kit);
} ideal.end_if();
kit->final_sync(ideal);
@@ -119,21 +96,12 @@ Node* ModRefBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& a
}
Node* ModRefBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const {
- GraphKit* kit = access.kit();
-
Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type);
if (!access.is_oop()) {
return result;
}
- // Don't need to load pre_val. The old value is returned by load_store.
- // The pre_barrier can execute after the xchg as long as no safepoint
- // gets inserted between them.
- pre_barrier(kit, false /* do_load */,
- kit->control(), nullptr, nullptr, max_juint, nullptr, nullptr,
- result /* pre_val */, T_OBJECT);
- post_barrier(kit, kit->control(), access.raw_access(), access.base(), access.addr().node(),
- access.alias_idx(), new_val, T_OBJECT, true);
+ post_barrier(access.kit(), access.base(), access.addr().node(), new_val, true);
return result;
}
diff --git a/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp
index cd19076f2ca72..42fe3f7d0b6a4 100644
--- a/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp
+++ b/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 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
@@ -31,25 +31,10 @@ class TypeOopPtr;
class ModRefBarrierSetC2: public BarrierSetC2 {
protected:
- virtual void pre_barrier(GraphKit* kit,
- bool do_load,
- Node* ctl,
- Node* obj,
- Node* adr,
- uint adr_idx,
- Node* val,
- const TypeOopPtr* val_type,
- Node* pre_val,
- BasicType bt) const {}
-
virtual void post_barrier(GraphKit* kit,
- Node* ctl,
- Node* store,
Node* obj,
Node* adr,
- uint adr_idx,
Node* val,
- BasicType bt,
bool use_precise) const {}
virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
diff --git a/src/hotspot/share/gc/shared/cardTable.cpp b/src/hotspot/share/gc/shared/cardTable.cpp
index 29ec67359bb9c..b32720f1d2cd5 100644
--- a/src/hotspot/share/gc/shared/cardTable.cpp
+++ b/src/hotspot/share/gc/shared/cardTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gcLogPrecious.hpp"
diff --git a/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp b/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
index c448d75940808..84bf3eac13046 100644
--- a/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
+++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.inline.hpp"
diff --git a/src/hotspot/share/gc/shared/classUnloadingContext.cpp b/src/hotspot/share/gc/shared/classUnloadingContext.cpp
index fdf84d69b6a86..4eac2561e679f 100644
--- a/src/hotspot/share/gc/shared/classUnloadingContext.cpp
+++ b/src/hotspot/share/gc/shared/classUnloadingContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "classfile/classLoaderData.inline.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/classUnloadingContext.hpp"
diff --git a/src/hotspot/share/gc/shared/collectedHeap.cpp b/src/hotspot/share/gc/shared/collectedHeap.cpp
index e35748b366900..d78e1f0822eed 100644
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/vmClasses.hpp"
@@ -405,7 +404,7 @@ MetaWord* CollectedHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loa
if ((QueuedAllocationWarningCount > 0) &&
(loop_count % QueuedAllocationWarningCount == 0)) {
log_warning(gc, ergo)("satisfy_failed_metadata_allocation() retries %d times,"
- " size=" SIZE_FORMAT, loop_count, word_size);
+ " size=%zu", loop_count, word_size);
}
} while (true); // Until a GC is done
}
@@ -481,7 +480,7 @@ CollectedHeap::fill_with_array(HeapWord* start, size_t words, bool zap)
const size_t payload_size = words - filler_array_hdr_size();
const size_t len = payload_size * HeapWordSize / sizeof(jint);
- assert((int)len >= 0, "size too large " SIZE_FORMAT " becomes %d", words, (int)len);
+ assert((int)len >= 0, "size too large %zu becomes %d", words, (int)len);
ObjArrayAllocator allocator(Universe::fillerArrayKlass(), words, (int)len, /* do_zero */ false);
allocator.initialize(start);
diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp
index 036bc0230c877..31a224597a048 100644
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp
@@ -383,12 +383,10 @@ class CollectedHeap : public CHeapObj {
void increment_total_collections(bool full = false) {
_total_collections++;
if (full) {
- increment_total_full_collections();
+ _total_full_collections++;
}
}
- void increment_total_full_collections() { _total_full_collections++; }
-
// Return the SoftRefPolicy for the heap;
SoftRefPolicy* soft_ref_policy() { return &_soft_ref_policy; }
diff --git a/src/hotspot/share/gc/shared/collectorCounters.cpp b/src/hotspot/share/gc/shared/collectorCounters.cpp
index 3a81dc383265c..f01997f985475 100644
--- a/src/hotspot/share/gc/shared/collectorCounters.cpp
+++ b/src/hotspot/share/gc/shared/collectorCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/shared/concurrentGCBreakpoints.cpp b/src/hotspot/share/gc/shared/concurrentGCBreakpoints.cpp
index 9b0b4bd7b1031..3a974952fea5c 100644
--- a/src/hotspot/share/gc/shared/concurrentGCBreakpoints.cpp
+++ b/src/hotspot/share/gc/shared/concurrentGCBreakpoints.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/concurrentGCBreakpoints.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/shared/concurrentGCThread.cpp b/src/hotspot/share/gc/shared/concurrentGCThread.cpp
index 04cf571749fe4..7d0cecde528bf 100644
--- a/src/hotspot/share/gc/shared/concurrentGCThread.cpp
+++ b/src/hotspot/share/gc/shared/concurrentGCThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/concurrentGCThread.hpp"
#include "runtime/atomic.hpp"
#include "runtime/init.hpp"
diff --git a/src/hotspot/share/gc/shared/freeListAllocator.cpp b/src/hotspot/share/gc/shared/freeListAllocator.cpp
index ef7d12ab0242f..27f1cd8aeb373 100644
--- a/src/hotspot/share/gc/shared/freeListAllocator.cpp
+++ b/src/hotspot/share/gc/shared/freeListAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/freeListAllocator.hpp"
#include "logging/log.hpp"
#include "utilities/globalCounter.inline.hpp"
diff --git a/src/hotspot/share/gc/shared/fullGCForwarding.cpp b/src/hotspot/share/gc/shared/fullGCForwarding.cpp
index 4880b08887e56..474a3209d7431 100644
--- a/src/hotspot/share/gc/shared/fullGCForwarding.cpp
+++ b/src/hotspot/share/gc/shared/fullGCForwarding.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/fullGCForwarding.hpp"
#include "memory/memRegion.hpp"
#include "runtime/globals_extension.hpp"
@@ -34,8 +33,8 @@ void FullGCForwarding::initialize_flags(size_t max_heap_size) {
#ifdef _LP64
size_t max_narrow_heap_size = right_n_bits(NumLowBitsNarrow - Shift);
if (UseCompactObjectHeaders && max_heap_size > max_narrow_heap_size * HeapWordSize) {
- warning("Compact object headers require a java heap size smaller than " SIZE_FORMAT
- "%s (given: " SIZE_FORMAT "%s). Disabling compact object headers.",
+ warning("Compact object headers require a java heap size smaller than %zu"
+ "%s (given: %zu%s). Disabling compact object headers.",
byte_size_in_proper_unit(max_narrow_heap_size * HeapWordSize),
proper_unit_for_byte_size(max_narrow_heap_size * HeapWordSize),
byte_size_in_proper_unit(max_heap_size),
diff --git a/src/hotspot/share/gc/shared/gcArguments.cpp b/src/hotspot/share/gc/shared/gcArguments.cpp
index c20c8c4922ef5..d45e6a9c7ddb0 100644
--- a/src/hotspot/share/gc/shared/gcArguments.cpp
+++ b/src/hotspot/share/gc/shared/gcArguments.cpp
@@ -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.
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/gcArguments.hpp"
#include "logging/log.hpp"
@@ -99,7 +98,7 @@ void GCArguments::assert_size_info() {
#endif // ASSERT
void GCArguments::initialize_size_info() {
- log_debug(gc, heap)("Minimum heap " SIZE_FORMAT " Initial heap " SIZE_FORMAT " Maximum heap " SIZE_FORMAT,
+ log_debug(gc, heap)("Minimum heap %zu Initial heap %zu Maximum heap %zu",
MinHeapSize, InitialHeapSize, MaxHeapSize);
DEBUG_ONLY(assert_size_info();)
@@ -109,10 +108,10 @@ void GCArguments::initialize_heap_flags_and_sizes() {
assert(SpaceAlignment != 0, "Space alignment not set up properly");
assert(HeapAlignment != 0, "Heap alignment not set up properly");
assert(HeapAlignment >= SpaceAlignment,
- "HeapAlignment: " SIZE_FORMAT " less than SpaceAlignment: " SIZE_FORMAT,
+ "HeapAlignment: %zu less than SpaceAlignment: %zu",
HeapAlignment, SpaceAlignment);
assert(HeapAlignment % SpaceAlignment == 0,
- "HeapAlignment: " SIZE_FORMAT " not aligned by SpaceAlignment: " SIZE_FORMAT,
+ "HeapAlignment: %zu not aligned by SpaceAlignment: %zu",
HeapAlignment, SpaceAlignment);
if (FLAG_IS_CMDLINE(MaxHeapSize)) {
diff --git a/src/hotspot/share/gc/shared/gcBehaviours.cpp b/src/hotspot/share/gc/shared/gcBehaviours.cpp
index b52ef9e7d3dc6..02971943874bd 100644
--- a/src/hotspot/share/gc/shared/gcBehaviours.cpp
+++ b/src/hotspot/share/gc/shared/gcBehaviours.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/gcBehaviours.hpp"
diff --git a/src/hotspot/share/gc/shared/gcCause.cpp b/src/hotspot/share/gc/shared/gcCause.cpp
index f73d3146aa3c2..f972aeccbc4b0 100644
--- a/src/hotspot/share/gc/shared/gcCause.cpp
+++ b/src/hotspot/share/gc/shared/gcCause.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcCause.hpp"
const char* GCCause::to_string(GCCause::Cause cause) {
diff --git a/src/hotspot/share/gc/shared/gcConfig.cpp b/src/hotspot/share/gc/shared/gcConfig.cpp
index bb9d0806a5312..402bd0caacddc 100644
--- a/src/hotspot/share/gc/shared/gcConfig.cpp
+++ b/src/hotspot/share/gc/shared/gcConfig.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcConfig.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
diff --git a/src/hotspot/share/gc/shared/gcConfiguration.cpp b/src/hotspot/share/gc/shared/gcConfiguration.cpp
index 4c94cfeab8b61..1c24c2353a19c 100644
--- a/src/hotspot/share/gc/shared/gcConfiguration.cpp
+++ b/src/hotspot/share/gc/shared/gcConfiguration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcArguments.hpp"
diff --git a/src/hotspot/share/gc/shared/gcId.cpp b/src/hotspot/share/gc/shared/gcId.cpp
index 8d123386180cb..6a182e41ee27a 100644
--- a/src/hotspot/share/gc/shared/gcId.cpp
+++ b/src/hotspot/share/gc/shared/gcId.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcId.hpp"
#include "jvm.h"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/share/gc/shared/gcInitLogger.cpp b/src/hotspot/share/gc/shared/gcInitLogger.cpp
index 1dfc27c533377..0a327ea7dfe2e 100644
--- a/src/hotspot/share/gc/shared/gcInitLogger.cpp
+++ b/src/hotspot/share/gc/shared/gcInitLogger.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcInitLogger.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
@@ -75,7 +74,7 @@ void GCInitLogger::print_large_pages() {
void GCInitLogger::print_numa() {
if (UseNUMA) {
log_info_p(gc, init)("NUMA Support: Enabled");
- log_info_p(gc, init)("NUMA Nodes: " SIZE_FORMAT, os::numa_get_groups_num());
+ log_info_p(gc, init)("NUMA Nodes: %zu", os::numa_get_groups_num());
} else {
log_info_p(gc, init)("NUMA Support: Disabled");
}
@@ -91,11 +90,11 @@ void GCInitLogger::print_compressed_oops() {
}
void GCInitLogger::print_heap() {
- log_info_p(gc, init)("Heap Min Capacity: " SIZE_FORMAT "%s",
+ log_info_p(gc, init)("Heap Min Capacity: %zu%s",
byte_size_in_exact_unit(MinHeapSize), exact_unit_for_byte_size(MinHeapSize));
- log_info_p(gc, init)("Heap Initial Capacity: " SIZE_FORMAT "%s",
+ log_info_p(gc, init)("Heap Initial Capacity: %zu%s",
byte_size_in_exact_unit(InitialHeapSize), exact_unit_for_byte_size(InitialHeapSize));
- log_info_p(gc, init)("Heap Max Capacity: " SIZE_FORMAT "%s",
+ log_info_p(gc, init)("Heap Max Capacity: %zu%s",
byte_size_in_exact_unit(MaxHeapSize), exact_unit_for_byte_size(MaxHeapSize));
log_info_p(gc, init)("Pre-touch: %s", AlwaysPreTouch ? "Enabled" : "Disabled");
diff --git a/src/hotspot/share/gc/shared/gcLocker.cpp b/src/hotspot/share/gc/shared/gcLocker.cpp
index d4e10b2671225..6344ba80d438e 100644
--- a/src/hotspot/share/gc/shared/gcLocker.cpp
+++ b/src/hotspot/share/gc/shared/gcLocker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gcLocker.hpp"
#include "gc/shared/gcTrace.hpp"
diff --git a/src/hotspot/share/gc/shared/gcLogPrecious.cpp b/src/hotspot/share/gc/shared/gcLogPrecious.cpp
index afc42e7cfcc46..43bd58db1aa08 100644
--- a/src/hotspot/share/gc/shared/gcLogPrecious.cpp
+++ b/src/hotspot/share/gc/shared/gcLogPrecious.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "runtime/mutex.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/hotspot/share/gc/shared/gcOverheadChecker.cpp b/src/hotspot/share/gc/shared/gcOverheadChecker.cpp
index 4eb5a459e7474..c6c89a51f54b6 100644
--- a/src/hotspot/share/gc/shared/gcOverheadChecker.cpp
+++ b/src/hotspot/share/gc/shared/gcOverheadChecker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, Google and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcOverheadChecker.hpp"
#include "gc/shared/softRefPolicy.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/shared/gcPolicyCounters.cpp b/src/hotspot/share/gc/shared/gcPolicyCounters.cpp
index dba53e9ee3193..d24ad745aa14d 100644
--- a/src/hotspot/share/gc/shared/gcPolicyCounters.cpp
+++ b/src/hotspot/share/gc/shared/gcPolicyCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcPolicyCounters.hpp"
#include "gc/shared/gc_globals.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/shared/gcTimer.cpp b/src/hotspot/share/gc/shared/gcTimer.cpp
index e293cb335a89d..8585975015184 100644
--- a/src/hotspot/share/gc/shared/gcTimer.cpp
+++ b/src/hotspot/share/gc/shared/gcTimer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcTimer.hpp"
#include "gc/shared/gc_globals.hpp"
#include "utilities/growableArray.hpp"
diff --git a/src/hotspot/share/gc/shared/gcTrace.cpp b/src/hotspot/share/gc/shared/gcTrace.cpp
index 1c84c3ca88bdc..bad9c707b1e51 100644
--- a/src/hotspot/share/gc/shared/gcTrace.cpp
+++ b/src/hotspot/share/gc/shared/gcTrace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/copyFailedInfo.hpp"
#include "gc/shared/gcHeapSummary.hpp"
#include "gc/shared/gcId.hpp"
diff --git a/src/hotspot/share/gc/shared/gcTraceSend.cpp b/src/hotspot/share/gc/shared/gcTraceSend.cpp
index 31ec2871cd05e..14e64e110b730 100644
--- a/src/hotspot/share/gc/shared/gcTraceSend.cpp
+++ b/src/hotspot/share/gc/shared/gcTraceSend.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/copyFailedInfo.hpp"
#include "gc/shared/gcHeapSummary.hpp"
#include "gc/shared/gcTimer.hpp"
diff --git a/src/hotspot/share/gc/shared/gcTraceTime.cpp b/src/hotspot/share/gc/shared/gcTraceTime.cpp
index af375039d12e2..def8a3f3f5c0c 100644
--- a/src/hotspot/share/gc/shared/gcTraceTime.cpp
+++ b/src/hotspot/share/gc/shared/gcTraceTime.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/gcTrace.hpp"
@@ -63,7 +62,7 @@ void GCTraceTimeLoggerImpl::log_end(Ticks end) {
size_t used_before_m = _heap_usage_before / M;
size_t used_m = heap->used() / M;
size_t capacity_m = heap->capacity() / M;
- out.print(" " SIZE_FORMAT "M->" SIZE_FORMAT "M(" SIZE_FORMAT "M)", used_before_m, used_m, capacity_m);
+ out.print(" %zuM->%zuM(%zuM)", used_before_m, used_m, capacity_m);
}
out.print_cr(" %.3fms", duration_in_ms);
diff --git a/src/hotspot/share/gc/shared/gcUtil.cpp b/src/hotspot/share/gc/shared/gcUtil.cpp
index 2c4010e75983b..6a4aa6d53dd25 100644
--- a/src/hotspot/share/gc/shared/gcUtil.cpp
+++ b/src/hotspot/share/gc/shared/gcUtil.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcUtil.hpp"
// Catch-all file for utility classes
diff --git a/src/hotspot/share/gc/shared/gcVMOperations.cpp b/src/hotspot/share/gc/shared/gcVMOperations.cpp
index 4cc75f4745991..85c452a6f8989 100644
--- a/src/hotspot/share/gc/shared/gcVMOperations.cpp
+++ b/src/hotspot/share/gc/shared/gcVMOperations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/shared/allocTracer.hpp"
@@ -110,7 +109,7 @@ bool VM_GC_Operation::doit_prologue() {
if (!is_init_completed()) {
vm_exit_during_initialization(
err_msg("GC triggered before VM initialization completed. Try increasing "
- "NewSize, current value " SIZE_FORMAT "%s.",
+ "NewSize, current value %zu%s.",
byte_size_in_proper_unit(NewSize),
proper_unit_for_byte_size(NewSize)));
}
@@ -140,8 +139,8 @@ void VM_GC_Operation::doit_epilogue() {
}
bool VM_GC_HeapInspection::doit_prologue() {
- if (_full_gc && UseZGC) {
- // ZGC cannot perform a synchronous GC cycle from within the VM thread.
+ if (_full_gc && (UseZGC || UseShenandoahGC)) {
+ // ZGC and Shenandoah cannot perform a synchronous GC cycle from within the VM thread.
// So VM_GC_HeapInspection::collect() is a noop. To respect the _full_gc
// flag a synchronous GC cycle is performed from the caller thread in the
// prologue.
@@ -259,7 +258,7 @@ void VM_CollectForMetadataAllocation::doit() {
return;
}
- log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size);
+ log_debug(gc)("After Metaspace GC failed to allocate size %zu", _size);
if (GCLocker::is_active_and_needs_gc()) {
set_gc_locked();
diff --git a/src/hotspot/share/gc/shared/genArguments.cpp b/src/hotspot/share/gc/shared/genArguments.cpp
index c94ca56722f62..90617b1675fa0 100644
--- a/src/hotspot/share/gc/shared/genArguments.cpp
+++ b/src/hotspot/share/gc/shared/genArguments.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/generation.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/genArguments.hpp"
@@ -79,13 +78,13 @@ void GenArguments::initialize_heap_flags_and_sizes() {
assert(GenAlignment != 0, "Generation alignment not set up properly");
assert(HeapAlignment >= GenAlignment,
- "HeapAlignment: " SIZE_FORMAT " less than GenAlignment: " SIZE_FORMAT,
+ "HeapAlignment: %zu less than GenAlignment: %zu",
HeapAlignment, GenAlignment);
assert(GenAlignment % SpaceAlignment == 0,
- "GenAlignment: " SIZE_FORMAT " not aligned by SpaceAlignment: " SIZE_FORMAT,
+ "GenAlignment: %zu not aligned by SpaceAlignment: %zu",
GenAlignment, SpaceAlignment);
assert(HeapAlignment % GenAlignment == 0,
- "HeapAlignment: " SIZE_FORMAT " not aligned by GenAlignment: " SIZE_FORMAT,
+ "HeapAlignment: %zu not aligned by GenAlignment: %zu",
HeapAlignment, GenAlignment);
// All generational heaps have a young gen; handle those flags here
@@ -128,8 +127,8 @@ void GenArguments::initialize_heap_flags_and_sizes() {
// Make sure there is room for an old generation
size_t smaller_max_new_size = MaxHeapSize - GenAlignment;
if (FLAG_IS_CMDLINE(MaxNewSize)) {
- log_warning(gc, ergo)("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire "
- "heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.",
+ log_warning(gc, ergo)("MaxNewSize (%zuk) is equal to or greater than the entire "
+ "heap (%zuk). A new max generation size of %zuk will be used.",
MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K);
}
FLAG_SET_ERGO(MaxNewSize, smaller_max_new_size);
@@ -147,8 +146,8 @@ void GenArguments::initialize_heap_flags_and_sizes() {
// At this point this should only happen if the user specifies a large NewSize and/or
// a small (but not too small) MaxNewSize.
if (FLAG_IS_CMDLINE(MaxNewSize)) {
- log_warning(gc, ergo)("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). "
- "A new max generation size of " SIZE_FORMAT "k will be used.",
+ log_warning(gc, ergo)("NewSize (%zuk) is greater than the MaxNewSize (%zuk). "
+ "A new max generation size of %zuk will be used.",
NewSize/K, MaxNewSize/K, NewSize/K);
}
FLAG_SET_ERGO(MaxNewSize, NewSize);
@@ -245,7 +244,7 @@ void GenArguments::initialize_size_info() {
}
}
- log_trace(gc, heap)("1: Minimum young " SIZE_FORMAT " Initial young " SIZE_FORMAT " Maximum young " SIZE_FORMAT,
+ log_trace(gc, heap)("1: Minimum young %zu Initial young %zu Maximum young %zu",
MinNewSize, initial_young_size, max_young_size);
// At this point the minimum, initial and maximum sizes
@@ -287,7 +286,7 @@ void GenArguments::initialize_size_info() {
initial_young_size = desired_young_size;
}
- log_trace(gc, heap)("2: Minimum young " SIZE_FORMAT " Initial young " SIZE_FORMAT " Maximum young " SIZE_FORMAT,
+ log_trace(gc, heap)("2: Minimum young %zu Initial young %zu Maximum young %zu",
MinNewSize, initial_young_size, max_young_size);
}
@@ -304,7 +303,7 @@ void GenArguments::initialize_size_info() {
OldSize = initial_old_size;
}
- log_trace(gc, heap)("Minimum old " SIZE_FORMAT " Initial old " SIZE_FORMAT " Maximum old " SIZE_FORMAT,
+ log_trace(gc, heap)("Minimum old %zu Initial old %zu Maximum old %zu",
MinOldSize, OldSize, MaxOldSize);
DEBUG_ONLY(assert_size_info();)
diff --git a/src/hotspot/share/gc/shared/generationCounters.cpp b/src/hotspot/share/gc/shared/generationCounters.cpp
index a0d0e529990e6..a8e5889dd8eeb 100644
--- a/src/hotspot/share/gc/shared/generationCounters.cpp
+++ b/src/hotspot/share/gc/shared/generationCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/generationCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/shared/hSpaceCounters.cpp b/src/hotspot/share/gc/shared/hSpaceCounters.cpp
index 5800e05a0a534..de5dd2912a505 100644
--- a/src/hotspot/share/gc/shared/hSpaceCounters.cpp
+++ b/src/hotspot/share/gc/shared/hSpaceCounters.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/hSpaceCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/gc/shared/isGCActiveMark.cpp b/src/hotspot/share/gc/shared/isGCActiveMark.cpp
index 70d289794270c..5dd1bd59031fc 100644
--- a/src/hotspot/share/gc/shared/isGCActiveMark.cpp
+++ b/src/hotspot/share/gc/shared/isGCActiveMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/isGCActiveMark.hpp"
#include "memory/universe.hpp"
diff --git a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
index cb36962e61e58..1ed3701fdab09 100644
--- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
+++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/serial/cardTableRS.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gcArguments.hpp"
@@ -57,8 +56,8 @@ static JVMFlag::Error MinPLABSizeBounds(const char* name, size_t value, bool ver
if ((GCConfig::is_gc_selected(CollectedHeap::G1) || GCConfig::is_gc_selected(CollectedHeap::Parallel)) &&
(value < PLAB::min_size())) {
JVMFlag::printError(verbose,
- "%s (" SIZE_FORMAT ") must be "
- "greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
+ "%s (%zu) must be "
+ "greater than or equal to ergonomic PLAB minimum size (%zu)\n",
name, value, PLAB::min_size());
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -70,8 +69,8 @@ JVMFlag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose) {
if ((GCConfig::is_gc_selected(CollectedHeap::G1) ||
GCConfig::is_gc_selected(CollectedHeap::Parallel)) && (value > PLAB::max_size())) {
JVMFlag::printError(verbose,
- "%s (" SIZE_FORMAT ") must be "
- "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
+ "%s (%zu) must be "
+ "less than or equal to ergonomic PLAB maximum size (%zu)\n",
name, value, PLAB::max_size());
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -99,8 +98,8 @@ JVMFlag::Error OldPLABSizeConstraintFunc(size_t value, bool verbose) {
JVMFlag::Error MinHeapFreeRatioConstraintFunc(uintx value, bool verbose) {
if (value > MaxHeapFreeRatio) {
JVMFlag::printError(verbose,
- "MinHeapFreeRatio (" UINTX_FORMAT ") must be "
- "less than or equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n",
+ "MinHeapFreeRatio (%zu) must be "
+ "less than or equal to MaxHeapFreeRatio (%zu)\n",
value, MaxHeapFreeRatio);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
@@ -111,8 +110,8 @@ JVMFlag::Error MinHeapFreeRatioConstraintFunc(uintx value, bool verbose) {
JVMFlag::Error MaxHeapFreeRatioConstraintFunc(uintx value, bool verbose) {
if (value < MinHeapFreeRatio) {
JVMFlag::printError(verbose,
- "MaxHeapFreeRatio (" UINTX_FORMAT ") must be "
- "greater than or equal to MinHeapFreeRatio (" UINTX_FORMAT ")\n",
+ "MaxHeapFreeRatio (%zu) must be "
+ "greater than or equal to MinHeapFreeRatio (%zu)\n",
value, MinHeapFreeRatio);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
@@ -124,8 +123,8 @@ static JVMFlag::Error CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(size_t maxHeap,
if ((softRef > 0) && ((maxHeap / M) > (max_uintx / softRef))) {
JVMFlag::printError(verbose,
"Desired lifetime of SoftReferences cannot be expressed correctly. "
- "MaxHeapSize (" SIZE_FORMAT ") or SoftRefLRUPolicyMSPerMB "
- "(" INTX_FORMAT ") is too large\n",
+ "MaxHeapSize (%zu) or SoftRefLRUPolicyMSPerMB "
+ "(%zd) is too large\n",
maxHeap, softRef);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
@@ -141,8 +140,8 @@ JVMFlag::Error MarkStackSizeConstraintFunc(size_t value, bool verbose) {
// value == 0 is handled by the range constraint.
if (value > MarkStackSizeMax) {
JVMFlag::printError(verbose,
- "MarkStackSize (" SIZE_FORMAT ") must be "
- "less than or equal to MarkStackSizeMax (" SIZE_FORMAT ")\n",
+ "MarkStackSize (%zu) must be "
+ "less than or equal to MarkStackSizeMax (%zu)\n",
value, MarkStackSizeMax);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
@@ -233,8 +232,8 @@ static JVMFlag::Error MaxSizeForAlignment(const char* name, size_t value, size_t
size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1));
if (value > aligned_max) {
JVMFlag::printError(verbose,
- "%s (" SIZE_FORMAT ") must be "
- "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
+ "%s (%zu) must be "
+ "less than or equal to aligned maximum value (%zu)\n",
name, value, aligned_max);
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -288,8 +287,8 @@ JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose) {
// Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx.
if (UseCompressedOops && FLAG_IS_ERGO(MaxHeapSize) && (value > (max_uintx - MaxHeapSize))) {
JVMFlag::printError(verbose,
- "HeapBaseMinAddress (" SIZE_FORMAT ") or MaxHeapSize (" SIZE_FORMAT ") is too large. "
- "Sum of them must be less than or equal to maximum of size_t (" SIZE_FORMAT ")\n",
+ "HeapBaseMinAddress (%zu) or MaxHeapSize (%zu) is too large. "
+ "Sum of them must be less than or equal to maximum of size_t (%zu)\n",
value, MaxHeapSize, max_uintx);
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -312,15 +311,15 @@ JVMFlag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose) {
// At least, alignment reserve area is needed.
if (value < ThreadLocalAllocBuffer::alignment_reserve_in_bytes()) {
JVMFlag::printError(verbose,
- "MinTLABSize (" SIZE_FORMAT ") must be "
- "greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n",
+ "MinTLABSize (%zu) must be "
+ "greater than or equal to reserved area in TLAB (%zu)\n",
value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes());
return JVMFlag::VIOLATES_CONSTRAINT;
}
if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) {
JVMFlag::printError(verbose,
- "MinTLABSize (" SIZE_FORMAT ") must be "
- "less than or equal to ergonomic TLAB maximum (" SIZE_FORMAT ")\n",
+ "MinTLABSize (%zu) must be "
+ "less than or equal to ergonomic TLAB maximum (%zu)\n",
value, ThreadLocalAllocBuffer::max_size() * HeapWordSize);
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -332,15 +331,15 @@ JVMFlag::Error TLABSizeConstraintFunc(size_t value, bool verbose) {
if (FLAG_IS_CMDLINE(TLABSize)) {
if (value < MinTLABSize) {
JVMFlag::printError(verbose,
- "TLABSize (" SIZE_FORMAT ") must be "
- "greater than or equal to MinTLABSize (" SIZE_FORMAT ")\n",
+ "TLABSize (%zu) must be "
+ "greater than or equal to MinTLABSize (%zu)\n",
value, MinTLABSize);
return JVMFlag::VIOLATES_CONSTRAINT;
}
if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) {
JVMFlag::printError(verbose,
- "TLABSize (" SIZE_FORMAT ") must be "
- "less than or equal to ergonomic TLAB maximum size (" SIZE_FORMAT ")\n",
+ "TLABSize (%zu) must be "
+ "less than or equal to ergonomic TLAB maximum size (%zu)\n",
value, (ThreadLocalAllocBuffer::max_size() * HeapWordSize));
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -357,8 +356,8 @@ JVMFlag::Error TLABWasteIncrementConstraintFunc(uintx value, bool verbose) {
// Compare with 'max_uintx' as ThreadLocalAllocBuffer::_refill_waste_limit is 'size_t'.
if (refill_waste_limit > (max_uintx - value)) {
JVMFlag::printError(verbose,
- "TLABWasteIncrement (" UINTX_FORMAT ") must be "
- "less than or equal to ergonomic TLAB waste increment maximum size(" SIZE_FORMAT ")\n",
+ "TLABWasteIncrement (%zu) must be "
+ "less than or equal to ergonomic TLAB waste increment maximum size(%zu)\n",
value, (max_uintx - refill_waste_limit));
return JVMFlag::VIOLATES_CONSTRAINT;
}
@@ -370,8 +369,8 @@ JVMFlag::Error SurvivorRatioConstraintFunc(uintx value, bool verbose) {
if (FLAG_IS_CMDLINE(SurvivorRatio) &&
(value > (MaxHeapSize / SpaceAlignment))) {
JVMFlag::printError(verbose,
- "SurvivorRatio (" UINTX_FORMAT ") must be "
- "less than or equal to ergonomic SurvivorRatio maximum (" SIZE_FORMAT ")\n",
+ "SurvivorRatio (%zu) must be "
+ "less than or equal to ergonomic SurvivorRatio maximum (%zu)\n",
value,
(MaxHeapSize / SpaceAlignment));
return JVMFlag::VIOLATES_CONSTRAINT;
@@ -383,8 +382,8 @@ JVMFlag::Error SurvivorRatioConstraintFunc(uintx value, bool verbose) {
JVMFlag::Error MetaspaceSizeConstraintFunc(size_t value, bool verbose) {
if (value > MaxMetaspaceSize) {
JVMFlag::printError(verbose,
- "MetaspaceSize (" SIZE_FORMAT ") must be "
- "less than or equal to MaxMetaspaceSize (" SIZE_FORMAT ")\n",
+ "MetaspaceSize (%zu) must be "
+ "less than or equal to MaxMetaspaceSize (%zu)\n",
value, MaxMetaspaceSize);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
@@ -395,8 +394,8 @@ JVMFlag::Error MetaspaceSizeConstraintFunc(size_t value, bool verbose) {
JVMFlag::Error MaxMetaspaceSizeConstraintFunc(size_t value, bool verbose) {
if (value < MetaspaceSize) {
JVMFlag::printError(verbose,
- "MaxMetaspaceSize (" SIZE_FORMAT ") must be "
- "greater than or equal to MetaspaceSize (" SIZE_FORMAT ")\n",
+ "MaxMetaspaceSize (%zu) must be "
+ "greater than or equal to MetaspaceSize (%zu)\n",
value, MaxMetaspaceSize);
return JVMFlag::VIOLATES_CONSTRAINT;
} else {
diff --git a/src/hotspot/share/gc/shared/locationPrinter.cpp b/src/hotspot/share/gc/shared/locationPrinter.cpp
index 62c5ce0df4706..b5efb540d459a 100644
--- a/src/hotspot/share/gc/shared/locationPrinter.cpp
+++ b/src/hotspot/share/gc/shared/locationPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/locationPrinter.hpp"
#include "memory/universe.hpp"
diff --git a/src/hotspot/share/gc/shared/markBitMap.cpp b/src/hotspot/share/gc/shared/markBitMap.cpp
index bc90032206c42..b2b1e80246226 100644
--- a/src/hotspot/share/gc/shared/markBitMap.cpp
+++ b/src/hotspot/share/gc/shared/markBitMap.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/markBitMap.inline.hpp"
#include "memory/universe.hpp"
diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp
index f96ec50e3b0a2..64ca463571890 100644
--- a/src/hotspot/share/gc/shared/memAllocator.cpp
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/vmClasses.hpp"
#include "gc/shared/allocTracer.hpp"
@@ -294,13 +293,13 @@ HeapWord* MemAllocator::mem_allocate_inside_tlab_slow(Allocation& allocation) co
mem = Universe::heap()->allocate_new_tlab(min_tlab_size, new_tlab_size, &allocation._allocated_tlab_size);
if (mem == nullptr) {
assert(allocation._allocated_tlab_size == 0,
- "Allocation failed, but actual size was updated. min: " SIZE_FORMAT
- ", desired: " SIZE_FORMAT ", actual: " SIZE_FORMAT,
+ "Allocation failed, but actual size was updated. min: %zu"
+ ", desired: %zu, actual: %zu",
min_tlab_size, new_tlab_size, allocation._allocated_tlab_size);
return nullptr;
}
assert(allocation._allocated_tlab_size != 0, "Allocation succeeded but actual size not updated. mem at: "
- PTR_FORMAT " min: " SIZE_FORMAT ", desired: " SIZE_FORMAT,
+ PTR_FORMAT " min: %zu, desired: %zu",
p2i(mem), min_tlab_size, new_tlab_size);
// ...and clear or zap just allocated TLAB, if needed.
diff --git a/src/hotspot/share/gc/shared/objectCountEventSender.cpp b/src/hotspot/share/gc/shared/objectCountEventSender.cpp
index ce78b84770869..a28c52e5c901d 100644
--- a/src/hotspot/share/gc/shared/objectCountEventSender.cpp
+++ b/src/hotspot/share/gc/shared/objectCountEventSender.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -23,7 +23,6 @@
*/
-#include "precompiled.hpp"
#include "gc/shared/gcId.hpp"
#include "gc/shared/objectCountEventSender.hpp"
#include "jfr/jfrEvents.hpp"
diff --git a/src/hotspot/share/gc/shared/oopStorage.cpp b/src/hotspot/share/gc/shared/oopStorage.cpp
index 2373d6b1d93a8..ae3e9c46197f1 100644
--- a/src/hotspot/share/gc/shared/oopStorage.cpp
+++ b/src/hotspot/share/gc/shared/oopStorage.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/oopStorage.inline.hpp"
#include "gc/shared/oopStorageParState.inline.hpp"
#include "logging/log.hpp"
@@ -323,7 +322,7 @@ void OopStorage::Block::atomic_add_allocated(uintx add) {
// facto verifies the precondition held; if there were any set bits in
// common, then after the add at least one of them will be zero.
uintx sum = Atomic::add(&_allocated_bitmask, add);
- assert((sum & add) == add, "some already present: " UINTX_FORMAT ":" UINTX_FORMAT,
+ assert((sum & add) == add, "some already present: %zu:%zu",
sum, add);
}
@@ -579,7 +578,7 @@ bool OopStorage::expand_active_array() {
assert_lock_strong(_allocation_mutex);
ActiveArray* old_array = _active_array;
size_t new_size = 2 * old_array->size();
- log_debug(oopstorage, blocks)("%s: expand active array " SIZE_FORMAT,
+ log_debug(oopstorage, blocks)("%s: expand active array %zu",
name(), new_size);
ActiveArray* new_array = ActiveArray::create(new_size,
mem_tag(),
@@ -1121,8 +1120,8 @@ bool OopStorage::BasicParState::claim_next_segment(IterationData* data) {
bool OopStorage::BasicParState::finish_iteration(const IterationData* data) const {
log_info(oopstorage, blocks, stats)
- ("Parallel iteration on %s: blocks = " SIZE_FORMAT
- ", processed = " SIZE_FORMAT " (%2.f%%)",
+ ("Parallel iteration on %s: blocks = %zu"
+ ", processed = %zu (%2.f%%)",
_storage->name(), _block_count, data->_processed,
percent_of(data->_processed, _block_count));
return false;
@@ -1171,7 +1170,7 @@ void OopStorage::print_on(outputStream* st) const {
double data_size = section_size * section_count;
double alloc_percentage = percent_of((double)allocations, blocks * data_size);
- st->print("%s: " SIZE_FORMAT " entries in " SIZE_FORMAT " blocks (%.F%%), " SIZE_FORMAT " bytes",
+ st->print("%s: %zu entries in %zu blocks (%.F%%), %zu bytes",
name(), allocations, blocks, alloc_percentage, total_memory_usage());
if (_concurrent_iteration_count > 0) {
st->print(", concurrent iteration active");
diff --git a/src/hotspot/share/gc/shared/oopStorageSet.cpp b/src/hotspot/share/gc/shared/oopStorageSet.cpp
index e3a9fccbad3dc..8ff9e1664b273 100644
--- a/src/hotspot/share/gc/shared/oopStorageSet.cpp
+++ b/src/hotspot/share/gc/shared/oopStorageSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/oopStorage.hpp"
#include "gc/shared/oopStorageSet.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/gc/shared/parallelCleaning.cpp b/src/hotspot/share/gc/shared/parallelCleaning.cpp
index 3671500995ea8..1b1eaf4d79ae2 100644
--- a/src/hotspot/share/gc/shared/parallelCleaning.cpp
+++ b/src/hotspot/share/gc/shared/parallelCleaning.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/stringTable.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/share/gc/shared/partialArraySplitter.cpp b/src/hotspot/share/gc/shared/partialArraySplitter.cpp
index 30a9a802bdbd3..12dd387fbfa5c 100644
--- a/src/hotspot/share/gc/shared/partialArraySplitter.cpp
+++ b/src/hotspot/share/gc/shared/partialArraySplitter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/partialArraySplitter.hpp"
#include "gc/shared/partialArrayState.hpp"
diff --git a/src/hotspot/share/gc/shared/partialArrayState.cpp b/src/hotspot/share/gc/shared/partialArrayState.cpp
index 60067c6547b86..f79e012a36d4f 100644
--- a/src/hotspot/share/gc/shared/partialArrayState.cpp
+++ b/src/hotspot/share/gc/shared/partialArrayState.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/partialArrayState.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/arena.hpp"
diff --git a/src/hotspot/share/gc/shared/partialArrayTaskStats.cpp b/src/hotspot/share/gc/shared/partialArrayTaskStats.cpp
index 210be11b9256d..ac8a380ec9ad0 100644
--- a/src/hotspot/share/gc/shared/partialArrayTaskStats.cpp
+++ b/src/hotspot/share/gc/shared/partialArrayTaskStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/partialArrayTaskStats.hpp"
#include "logging/log.hpp"
#include "logging/logHandle.hpp"
diff --git a/src/hotspot/share/gc/shared/partialArrayTaskStepper.cpp b/src/hotspot/share/gc/shared/partialArrayTaskStepper.cpp
index 6faa162ac7bed..d91ba347d6c8c 100644
--- a/src/hotspot/share/gc/shared/partialArrayTaskStepper.cpp
+++ b/src/hotspot/share/gc/shared/partialArrayTaskStepper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/partialArrayTaskStepper.hpp"
#include "oops/arrayOop.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/gc/shared/plab.cpp b/src/hotspot/share/gc/shared/plab.cpp
index ac2025e97a152..7b637709f11b9 100644
--- a/src/hotspot/share/gc/shared/plab.cpp
+++ b/src/hotspot/share/gc/shared/plab.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/plab.inline.hpp"
@@ -65,7 +64,7 @@ PLAB::PLAB(size_t desired_plab_sz_) :
_end(nullptr), _hard_end(nullptr), _allocated(0), _wasted(0), _undo_wasted(0)
{
assert(min_size() > CollectedHeap::lab_alignment_reserve(),
- "Minimum PLAB size " SIZE_FORMAT " must be larger than alignment reserve " SIZE_FORMAT " "
+ "Minimum PLAB size %zu must be larger than alignment reserve %zu "
"to be able to contain objects", min_size(), CollectedHeap::lab_alignment_reserve());
}
diff --git a/src/hotspot/share/gc/shared/preservedMarks.cpp b/src/hotspot/share/gc/shared/preservedMarks.cpp
index bc241fb5daf45..0576757524347 100644
--- a/src/hotspot/share/gc/shared/preservedMarks.cpp
+++ b/src/hotspot/share/gc/shared/preservedMarks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/fullGCForwarding.inline.hpp"
#include "gc/shared/preservedMarks.inline.hpp"
#include "gc/shared/workerThread.hpp"
@@ -67,10 +66,10 @@ void PreservedMarks::restore_and_increment(volatile size_t* const total_size_add
#ifndef PRODUCT
void PreservedMarks::assert_empty() {
- assert(_stack.is_empty(), "stack expected to be empty, size = " SIZE_FORMAT,
+ assert(_stack.is_empty(), "stack expected to be empty, size = %zu",
_stack.size());
assert(_stack.cache_size() == 0,
- "stack expected to have no cached segments, cache size = " SIZE_FORMAT,
+ "stack expected to have no cached segments, cache size = %zu",
_stack.cache_size());
}
#endif // ndef PRODUCT
diff --git a/src/hotspot/share/gc/shared/pretouchTask.cpp b/src/hotspot/share/gc/shared/pretouchTask.cpp
index 427d14fd4e7e3..e06c561b6a8ad 100644
--- a/src/hotspot/share/gc/shared/pretouchTask.cpp
+++ b/src/hotspot/share/gc/shared/pretouchTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/pretouchTask.hpp"
#include "logging/log.hpp"
@@ -43,7 +42,7 @@ PretouchTask::PretouchTask(const char* task_name,
_chunk_size(chunk_size) {
assert(chunk_size >= page_size,
- "Chunk size " SIZE_FORMAT " is smaller than page size " SIZE_FORMAT,
+ "Chunk size %zu is smaller than page size %zu",
chunk_size, page_size);
}
@@ -79,12 +78,12 @@ void PretouchTask::pretouch(const char* task_name, char* start_address, char* en
size_t num_chunks = ((total_bytes - 1) / chunk_size) + 1;
uint num_workers = (uint)MIN2(num_chunks, (size_t)pretouch_workers->max_workers());
- log_debug(gc, heap)("Running %s with %u workers for " SIZE_FORMAT " work units pre-touching " SIZE_FORMAT "B.",
+ log_debug(gc, heap)("Running %s with %u workers for %zu work units pre-touching %zuB.",
task.name(), num_workers, num_chunks, total_bytes);
pretouch_workers->run_task(&task, num_workers);
} else {
- log_debug(gc, heap)("Running %s pre-touching " SIZE_FORMAT "B.",
+ log_debug(gc, heap)("Running %s pre-touching %zuB.",
task.name(), total_bytes);
task.work(0);
}
diff --git a/src/hotspot/share/gc/shared/ptrQueue.cpp b/src/hotspot/share/gc/shared/ptrQueue.cpp
index 9723db8391298..fd7011700f472 100644
--- a/src/hotspot/share/gc/shared/ptrQueue.cpp
+++ b/src/hotspot/share/gc/shared/ptrQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/bufferNode.hpp"
#include "gc/shared/ptrQueue.hpp"
diff --git a/src/hotspot/share/gc/shared/referencePolicy.cpp b/src/hotspot/share/gc/shared/referencePolicy.cpp
index 22ef4eabbe6a1..d1867291479c2 100644
--- a/src/hotspot/share/gc/shared/referencePolicy.cpp
+++ b/src/hotspot/share/gc/shared/referencePolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp
index ff7530f2d32f3..0ee4ac134c2c4 100644
--- a/src/hotspot/share/gc/shared/referenceProcessor.cpp
+++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "gc/shared/collectedHeap.hpp"
@@ -175,7 +174,7 @@ size_t ReferenceProcessor::total_count(DiscoveredList lists[]) const {
#ifdef ASSERT
void ReferenceProcessor::verify_total_count_zero(DiscoveredList lists[], const char* type) {
size_t count = total_count(lists);
- assert(count == 0, "%ss must be empty but has " SIZE_FORMAT " elements", type, count);
+ assert(count == 0, "%ss must be empty but has %zu elements", type, count);
}
#endif
@@ -365,7 +364,7 @@ size_t ReferenceProcessor::process_discovered_list_work(DiscoveredList& refs_
refs_list.clear();
}
- log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT
+ log_develop_trace(gc, ref)(" Dropped %zu active Refs out of %zu"
" Refs in discovered list " PTR_FORMAT,
iter.removed(), iter.processed(), p2i(&refs_list));
return iter.removed();
@@ -559,10 +558,10 @@ void ReferenceProcessor::log_reflist(const char* prefix, DiscoveredList list[],
LogStream ls(lt);
ls.print("%s", prefix);
for (uint i = 0; i < num_active_queues; i++) {
- ls.print(SIZE_FORMAT " ", list[i].length());
+ ls.print("%zu ", list[i].length());
total += list[i].length();
}
- ls.print_cr("(" SIZE_FORMAT ")", total);
+ ls.print_cr("(%zu)", total);
}
#ifndef PRODUCT
@@ -574,7 +573,7 @@ void ReferenceProcessor::log_reflist_counts(DiscoveredList ref_lists[], uint num
log_reflist("", ref_lists, num_active_queues);
#ifdef ASSERT
for (uint i = num_active_queues; i < _max_num_queues; i++) {
- assert(ref_lists[i].length() == 0, SIZE_FORMAT " unexpected References in %u",
+ assert(ref_lists[i].length() == 0, "%zu unexpected References in %u",
ref_lists[i].length(), i);
}
#endif
@@ -1095,7 +1094,7 @@ bool ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_lis
}
if (iter.processed() > 0) {
- log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT " Refs in discovered list " PTR_FORMAT,
+ log_develop_trace(gc, ref)(" Dropped %zu Refs out of %zu Refs in discovered list " PTR_FORMAT,
iter.removed(), iter.processed(), p2i(&refs_list));
}
return false;
diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp
index 2ad55b95424f9..f4b30866d776e 100644
--- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp
+++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcTimer.hpp"
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
#include "gc/shared/referenceProcessor.inline.hpp"
diff --git a/src/hotspot/share/gc/shared/satbMarkQueue.cpp b/src/hotspot/share/gc/shared/satbMarkQueue.cpp
index a0efcc8e66ae8..6e33d27897ccc 100644
--- a/src/hotspot/share/gc/shared/satbMarkQueue.cpp
+++ b/src/hotspot/share/gc/shared/satbMarkQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/satbMarkQueue.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "logging/log.hpp"
@@ -54,8 +53,8 @@ static void print_satb_buffer(const char* name,
void** buf,
size_t index,
size_t capacity) {
- tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " index: " SIZE_FORMAT
- " capacity: " SIZE_FORMAT,
+ tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " index: %zu"
+ " capacity: %zu",
name, p2i(buf), index, capacity);
}
diff --git a/src/hotspot/share/gc/shared/scavengableNMethods.cpp b/src/hotspot/share/gc/shared/scavengableNMethods.cpp
index c619ddb764aeb..0dff5526911af 100644
--- a/src/hotspot/share/gc/shared/scavengableNMethods.cpp
+++ b/src/hotspot/share/gc/shared/scavengableNMethods.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/scavengableNMethods.hpp"
diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp
index 0eb9d2520b739..6a9b2b90f44db 100644
--- a/src/hotspot/share/gc/shared/space.cpp
+++ b/src/hotspot/share/gc/shared/space.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmClasses.hpp"
#include "classfile/vmSymbols.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/shared/spaceDecorator.cpp b/src/hotspot/share/gc/shared/spaceDecorator.cpp
index cb554f48e5911..b0668c56e2dc8 100644
--- a/src/hotspot/share/gc/shared/spaceDecorator.cpp
+++ b/src/hotspot/share/gc/shared/spaceDecorator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/spaceDecorator.hpp"
#include "utilities/copy.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp
index 7c37d642836d3..9ad8decec7e08 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmClasses.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp
index 3fa3df12891ec..50155a669515d 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/altHashing.hpp"
#include "gc/shared/stringdedup/stringDedupConfig.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp
index ab85c293941df..f4f69c8269ff6 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/stringTable.hpp"
#include "gc/shared/oopStorage.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.cpp
index cffda333b1335..28e5e9adf2002 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/stringdedup/stringDedupStat.hpp"
#include "logging/log.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupStorageUse.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupStorageUse.cpp
index ee5fc6db5d57e..175c63421e191 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupStorageUse.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupStorageUse.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/stringdedup/stringDedupStorageUse.hpp"
#include "runtime/atomic.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp
index ac8fc0759cafc..5c6628cba5cdd 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/altHashing.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/stringTable.hpp"
diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp
index ef983883e166a..49eb49ca4012a 100644
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/stringdedup/stringDedup.hpp"
#include "gc/shared/stringdedup/stringDedupProcessor.hpp"
#include "gc/shared/stringdedup/stringDedupThread.hpp"
diff --git a/src/hotspot/share/gc/shared/strongRootsScope.cpp b/src/hotspot/share/gc/shared/strongRootsScope.cpp
index 0839c72ca5d13..1316df68e5f9d 100644
--- a/src/hotspot/share/gc/shared/strongRootsScope.cpp
+++ b/src/hotspot/share/gc/shared/strongRootsScope.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/stringTable.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/strongRootsScope.hpp"
diff --git a/src/hotspot/share/gc/shared/suspendibleThreadSet.cpp b/src/hotspot/share/gc/shared/suspendibleThreadSet.cpp
index a0d83ac298da6..35a446de532e9 100644
--- a/src/hotspot/share/gc/shared/suspendibleThreadSet.cpp
+++ b/src/hotspot/share/gc/shared/suspendibleThreadSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/share/gc/shared/taskTerminator.cpp b/src/hotspot/share/gc/shared/taskTerminator.cpp
index cd225699f37fe..1353c3f8c8a06 100644
--- a/src/hotspot/share/gc/shared/taskTerminator.cpp
+++ b/src/hotspot/share/gc/shared/taskTerminator.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/taskTerminator.hpp"
#include "gc/shared/taskqueue.hpp"
diff --git a/src/hotspot/share/gc/shared/taskqueue.cpp b/src/hotspot/share/gc/shared/taskqueue.cpp
index 61e2899b6738d..a244ba454150b 100644
--- a/src/hotspot/share/gc/shared/taskqueue.cpp
+++ b/src/hotspot/share/gc/shared/taskqueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/taskqueue.hpp"
#include "oops/oop.inline.hpp"
#include "logging/log.hpp"
@@ -75,10 +74,9 @@ void TaskQueueStats::print_header(unsigned int line, outputStream* const stream,
void TaskQueueStats::print(outputStream* stream, unsigned int width) const
{
- #define FMT SIZE_FORMAT_W(*)
- stream->print(FMT, width, _stats[0]);
+ stream->print("%*zu", width, _stats[0]);
for (unsigned int i = 1; i < last_stat_id; ++i) {
- stream->print(" " FMT, width, _stats[i]);
+ stream->print(" %*zu", width, _stats[i]);
}
#undef FMT
}
diff --git a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp
index e967a65555a15..aa0079d814db9 100644
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/threadLocalAllocBuffer.inline.hpp"
@@ -164,7 +163,7 @@ void ThreadLocalAllocBuffer::resize() {
size_t aligned_new_size = align_object_size(new_size);
log_trace(gc, tlab)("TLAB new size: thread: " PTR_FORMAT " [id: %2d]"
- " refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT,
+ " refills %d alloc: %8.6f desired_size: %zu -> %zu",
p2i(thread()), thread()->osthread()->thread_id(),
_target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size);
@@ -263,7 +262,7 @@ void ThreadLocalAllocBuffer::startup_initialization() {
guarantee(Thread::current()->is_Java_thread(), "tlab initialization thread not Java thread");
Thread::current()->tlab().initialize();
- log_develop_trace(gc, tlab)("TLAB min: " SIZE_FORMAT " initial: " SIZE_FORMAT " max: " SIZE_FORMAT,
+ log_develop_trace(gc, tlab)("TLAB min: %zu initial: %zu max: %zu",
min_size(), Thread::current()->tlab().initial_desired_size(), max_size());
}
@@ -299,8 +298,8 @@ void ThreadLocalAllocBuffer::print_stats(const char* tag) {
double waste_percent = percent_of(waste, _allocated_size);
size_t tlab_used = Universe::heap()->tlab_used(thrd);
log.trace("TLAB: %s thread: " PTR_FORMAT " [id: %2d]"
- " desired_size: " SIZE_FORMAT "KB"
- " slow allocs: %d refill waste: " SIZE_FORMAT "B"
+ " desired_size: %zuKB"
+ " slow allocs: %d refill waste: %zuB"
" alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
" slow: %dB",
tag, p2i(thrd), thrd->osthread()->thread_id(),
@@ -451,8 +450,8 @@ void ThreadLocalAllocStats::publish() {
const double waste_percent = percent_of(waste, _total_allocations);
log_debug(gc, tlab)("TLAB totals: thrds: %d refills: %d max: %d"
" slow allocs: %d max %d waste: %4.1f%%"
- " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
- " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B",
+ " gc: %zuB max: %zuB"
+ " slow: %zuB max: %zuB",
_allocating_threads, _total_refills, _max_refills,
_total_slow_allocations, _max_slow_allocations, waste_percent,
_total_gc_waste * HeapWordSize, _max_gc_waste * HeapWordSize,
diff --git a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp
index 6910d9c186061..32a830a2bb138 100644
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -61,11 +61,11 @@ inline size_t ThreadLocalAllocBuffer::compute_size(size_t obj_size) {
// Make sure there's enough room for object and filler int[].
if (new_tlab_size < compute_min_size(obj_size)) {
// If there isn't enough room for the allocation, return failure.
- log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ") returns failure",
+ log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(%zu) returns failure",
obj_size);
return 0;
}
- log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ") returns " SIZE_FORMAT,
+ log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(%zu) returns %zu",
obj_size, new_tlab_size);
return new_tlab_size;
}
@@ -86,9 +86,9 @@ void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) {
_slow_allocations++;
log_develop_trace(gc, tlab)("TLAB: %s thread: " PTR_FORMAT " [id: %2d]"
- " obj: " SIZE_FORMAT
- " free: " SIZE_FORMAT
- " waste: " SIZE_FORMAT,
+ " obj: %zu"
+ " free: %zu"
+ " waste: %zu",
"slow", p2i(thread()), thread()->osthread()->thread_id(),
obj_size, free(), refill_waste_limit());
}
diff --git a/src/hotspot/share/gc/shared/weakProcessor.cpp b/src/hotspot/share/gc/shared/weakProcessor.cpp
index 8adf3fab7d5c1..d7de8b5d8a88a 100644
--- a/src/hotspot/share/gc/shared/weakProcessor.cpp
+++ b/src/hotspot/share/gc/shared/weakProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/stringTable.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/oopStorage.inline.hpp"
diff --git a/src/hotspot/share/gc/shared/weakProcessorTimes.cpp b/src/hotspot/share/gc/shared/weakProcessorTimes.cpp
index 64fc961162394..88fb309882446 100644
--- a/src/hotspot/share/gc/shared/weakProcessorTimes.cpp
+++ b/src/hotspot/share/gc/shared/weakProcessorTimes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/oopStorage.hpp"
#include "gc/shared/weakProcessor.hpp"
#include "gc/shared/weakProcessorTimes.hpp"
diff --git a/src/hotspot/share/gc/shared/workerDataArray.cpp b/src/hotspot/share/gc/shared/workerDataArray.cpp
index a16e3219255df..7b3e9e50cb464 100644
--- a/src/hotspot/share/gc/shared/workerDataArray.cpp
+++ b/src/hotspot/share/gc/shared/workerDataArray.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/workerDataArray.inline.hpp"
#include "utilities/ostream.hpp"
@@ -49,9 +48,9 @@ void WorkerDataArray::WDAPrinter::summary(outputStream* out, double min,
template <>
void WorkerDataArray::WDAPrinter::summary(outputStream* out, size_t min, double avg, size_t max, size_t diff, size_t sum, bool print_sum) {
- out->print(" Min: " SIZE_FORMAT ", Avg: %4.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT, min, avg, max, diff);
+ out->print(" Min: %zu, Avg: %4.1lf, Max: %zu, Diff: %zu", min, avg, max, diff);
if (print_sum) {
- out->print(", Sum: " SIZE_FORMAT, sum);
+ out->print(", Sum: %zu", sum);
}
}
@@ -75,7 +74,7 @@ void WorkerDataArray::WDAPrinter::details(const WorkerDataArray*
for (uint i = 0; i < phase->_length; ++i) {
size_t value = phase->get(i);
if (value != phase->uninitialized()) {
- out->print(" " SIZE_FORMAT, phase->get(i));
+ out->print(" %zu", phase->get(i));
} else {
out->print(" -");
}
diff --git a/src/hotspot/share/gc/shared/workerPolicy.cpp b/src/hotspot/share/gc/shared/workerPolicy.cpp
index 4ab178dd6a70f..7ab019d13d57f 100644
--- a/src/hotspot/share/gc/shared/workerPolicy.cpp
+++ b/src/hotspot/share/gc/shared/workerPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2021, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/workerPolicy.hpp"
#include "logging/log.hpp"
@@ -130,9 +129,9 @@ uint WorkerPolicy::calc_default_active_workers(uintx total_workers,
assert(new_active_workers <= total_workers, "Total workers not observed");
log_trace(gc, task)("WorkerPolicy::calc_default_active_workers() : "
- "active_workers(): " UINTX_FORMAT " new_active_workers: " UINTX_FORMAT " "
- "prev_active_workers: " UINTX_FORMAT "\n"
- " active_workers_by_JT: " UINTX_FORMAT " active_workers_by_heap_size: " UINTX_FORMAT,
+ "active_workers(): %zu new_active_workers: %zu "
+ "prev_active_workers: %zu\n"
+ " active_workers_by_JT: %zu active_workers_by_heap_size: %zu",
active_workers, new_active_workers, prev_active_workers,
active_workers_by_JT, active_workers_by_heap_size);
assert(new_active_workers > 0, "Always need at least 1");
diff --git a/src/hotspot/share/gc/shared/workerThread.cpp b/src/hotspot/share/gc/shared/workerThread.cpp
index 4dde8e3938797..ffeb3a4194b7b 100644
--- a/src/hotspot/share/gc/shared/workerThread.cpp
+++ b/src/hotspot/share/gc/shared/workerThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/workerThread.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/shared/workerUtils.cpp b/src/hotspot/share/gc/shared/workerUtils.cpp
index 41662092966df..40b78d3f6223b 100644
--- a/src/hotspot/share/gc/shared/workerUtils.cpp
+++ b/src/hotspot/share/gc/shared/workerUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/workerUtils.hpp"
#include "runtime/atomic.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
index ade0504b9730c..d27b98adc9f47 100644
--- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
+++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "c1/c1_IR.hpp"
#include "gc/shared/satbMarkQueue.hpp"
#include "gc/shenandoah/mode/shenandoahMode.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
index 9adc74aae3ae1..514cc8fd83913 100644
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
index fd127df3cdec3..860bcb38038ff 100644
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/shenandoah/c2/shenandoahSupport.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
index 94c544a7ea36b..02a363d239211 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcCause.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
@@ -96,8 +96,8 @@ void ShenandoahAdaptiveHeuristics::choose_collection_set_from_regiondata(Shenand
size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
size_t min_garbage = (free_target > actual_free ? (free_target - actual_free) : 0);
- log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: "
- SIZE_FORMAT "%s, Max Evacuation: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("Adaptive CSet Selection. Target Free: %zu%s, Actual Free: "
+ "%zu%s, Max Evacuation: %zu%s, Min Garbage: %zu%s",
byte_size_in_proper_unit(free_target), proper_unit_for_byte_size(free_target),
byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),
byte_size_in_proper_unit(max_cset), proper_unit_for_byte_size(max_cset),
@@ -142,7 +142,7 @@ void ShenandoahAdaptiveHeuristics::record_success_concurrent() {
if (available_sd > 0) {
double available_avg = _available.avg();
z_score = (double(available) - available_avg) / available_sd;
- log_debug(gc, ergo)("Available: " SIZE_FORMAT " %sB, z-score=%.3f. Average available: %.1f %sB +/- %.1f %sB.",
+ log_debug(gc, ergo)("Available: %zu %sB, z-score=%.3f. Average available: %.1f %sB +/- %.1f %sB.",
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
z_score,
byte_size_in_proper_unit(available_avg), proper_unit_for_byte_size(available_avg),
@@ -237,8 +237,8 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
size_t available = _space_info->soft_available();
size_t allocated = _space_info->bytes_allocated_since_gc_start();
- log_debug(gc)("should_start_gc? available: " SIZE_FORMAT ", soft_max_capacity: " SIZE_FORMAT
- ", allocated: " SIZE_FORMAT, available, capacity, allocated);
+ log_debug(gc)("should_start_gc? available: %zu, soft_max_capacity: %zu"
+ ", allocated: %zu", available, capacity, allocated);
// Track allocation rate even if we decide to start a cycle for other reasons.
double rate = _allocation_rate.sample(allocated);
@@ -246,7 +246,7 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
size_t min_threshold = min_free_threshold();
if (available < min_threshold) {
- log_trigger("Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",
+ log_trigger("Free (%zu%s) is below minimum threshold (%zu%s)",
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
byte_size_in_proper_unit(min_threshold), proper_unit_for_byte_size(min_threshold));
return true;
@@ -257,7 +257,7 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
if (_gc_times_learned < max_learn) {
size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold;
if (available < init_threshold) {
- log_trigger("Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "%s) is below initial threshold (" SIZE_FORMAT "%s)",
+ log_trigger("Learning %zu of %zu. Free (%zu%s) is below initial threshold (%zu%s)",
_gc_times_learned + 1, max_learn,
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
byte_size_in_proper_unit(init_threshold), proper_unit_for_byte_size(init_threshold));
@@ -282,12 +282,12 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
avg_cycle_time * 1000, byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate));
if (avg_cycle_time * avg_alloc_rate > allocation_headroom) {
log_trigger("Average GC time (%.2f ms) is above the time for average allocation rate (%.0f %sB/s)"
- " to deplete free headroom (" SIZE_FORMAT "%s) (margin of error = %.2f)",
+ " to deplete free headroom (%zu%s) (margin of error = %.2f)",
avg_cycle_time * 1000,
byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate),
byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
_margin_of_error_sd);
- log_info(gc, ergo)("Free headroom: " SIZE_FORMAT "%s (free) - " SIZE_FORMAT "%s (spike) - " SIZE_FORMAT "%s (penalties) = " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("Free headroom: %zu%s (free) - %zu%s (spike) - %zu%s (penalties) = %zu%s",
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
byte_size_in_proper_unit(spike_headroom), proper_unit_for_byte_size(spike_headroom),
byte_size_in_proper_unit(penalties), proper_unit_for_byte_size(penalties),
@@ -298,7 +298,7 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
bool is_spiking = _allocation_rate.is_spiking(rate, _spike_threshold_sd);
if (is_spiking && avg_cycle_time > allocation_headroom / rate) {
- log_trigger("Average GC time (%.2f ms) is above the time for instantaneous allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (spike threshold = %.2f)",
+ log_trigger("Average GC time (%.2f ms) is above the time for instantaneous allocation rate (%.0f %sB/s) to deplete free headroom (%zu%s) (spike threshold = %.2f)",
avg_cycle_time * 1000,
byte_size_in_proper_unit(rate), proper_unit_for_byte_size(rate),
byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp
index cdae9bb1285a2..63a4e74fb1d23 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
index 2c7594e10dc5d..9d98ff6bf7379 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
#include "gc/shenandoah/heuristics/shenandoahCompactHeuristics.hpp"
@@ -58,7 +58,7 @@ bool ShenandoahCompactHeuristics::should_start_gc() {
size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;
if (available < min_threshold) {
- log_trigger("Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",
+ log_trigger("Free (%zu%s) is below minimum threshold (%zu%s)",
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
byte_size_in_proper_unit(min_threshold), proper_unit_for_byte_size(min_threshold));
return true;
@@ -66,7 +66,7 @@ bool ShenandoahCompactHeuristics::should_start_gc() {
size_t bytes_allocated = _space_info->bytes_allocated_since_gc_start();
if (bytes_allocated > threshold_bytes_allocated) {
- log_trigger("Allocated since last cycle (" SIZE_FORMAT "%s) is larger than allocation threshold (" SIZE_FORMAT "%s)",
+ log_trigger("Allocated since last cycle (%zu%s) is larger than allocation threshold (%zu%s)",
byte_size_in_proper_unit(bytes_allocated), proper_unit_for_byte_size(bytes_allocated),
byte_size_in_proper_unit(threshold_bytes_allocated), proper_unit_for_byte_size(threshold_bytes_allocated));
return true;
@@ -81,7 +81,7 @@ void ShenandoahCompactHeuristics::choose_collection_set_from_regiondata(Shenando
// Do not select too large CSet that would overflow the available free space
size_t max_cset = actual_free * 3 / 4;
- log_info(gc, ergo)("CSet Selection. Actual Free: " SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("CSet Selection. Actual Free: %zu%s, Max CSet: %zu%s",
byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),
byte_size_in_proper_unit(max_cset), proper_unit_for_byte_size(max_cset));
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp
index 5b6d82d97a4c9..757cab8f68682 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/heuristics/shenandoahGenerationalHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
@@ -134,7 +133,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
bool reg_live = region->has_live();
bool bm_live = heap->complete_marking_context()->is_marked(cast_to_oop(region->bottom()));
assert(reg_live == bm_live,
- "Humongous liveness and marks should agree. Region live: %s; Bitmap live: %s; Region Live Words: " SIZE_FORMAT,
+ "Humongous liveness and marks should agree. Region live: %s; Bitmap live: %s; Region Live Words: %zu",
BOOL_TO_STR(reg_live), BOOL_TO_STR(bm_live), region->get_live_data_words());
#endif
if (!region->has_live()) {
@@ -158,8 +157,8 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
}
heap->old_generation()->set_expected_humongous_region_promotions(humongous_regions_promoted);
heap->old_generation()->set_expected_regular_region_promotions(regular_regions_promoted_in_place);
- log_info(gc, ergo)("Planning to promote in place " SIZE_FORMAT " humongous regions and " SIZE_FORMAT
- " regular regions, spanning a total of " SIZE_FORMAT " used bytes",
+ log_info(gc, ergo)("Planning to promote in place %zu humongous regions and %zu"
+ " regular regions, spanning a total of %zu used bytes",
humongous_regions_promoted, regular_regions_promoted_in_place,
humongous_regions_promoted * ShenandoahHeapRegion::region_size_bytes() +
regular_regions_promoted_usage);
@@ -168,7 +167,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
// given the amount of immediately reclaimable garbage. If we do, figure out the collection set.
assert (immediate_garbage <= total_garbage,
- "Cannot have more immediate garbage than total garbage: " SIZE_FORMAT "%s vs " SIZE_FORMAT "%s",
+ "Cannot have more immediate garbage than total garbage: %zu%s vs %zu%s",
byte_size_in_proper_unit(immediate_garbage), proper_unit_for_byte_size(immediate_garbage),
byte_size_in_proper_unit(total_garbage), proper_unit_for_byte_size(total_garbage));
@@ -193,9 +192,9 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
size_t collectable_garbage = collection_set->garbage() + immediate_garbage;
size_t collectable_garbage_percent = (total_garbage == 0) ? 0 : (collectable_garbage * 100 / total_garbage);
- log_info(gc, ergo)("Collectable Garbage: " SIZE_FORMAT "%s (" SIZE_FORMAT "%%), "
- "Immediate: " SIZE_FORMAT "%s (" SIZE_FORMAT "%%), " SIZE_FORMAT " regions, "
- "CSet: " SIZE_FORMAT "%s (" SIZE_FORMAT "%%), " SIZE_FORMAT " regions",
+ log_info(gc, ergo)("Collectable Garbage: %zu%s (%zu%%), "
+ "Immediate: %zu%s (%zu%%), %zu regions, "
+ "CSet: %zu%s (%zu%%), %zu regions",
byte_size_in_proper_unit(collectable_garbage),
proper_unit_for_byte_size(collectable_garbage),
@@ -216,10 +215,10 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
size_t promote_evac_bytes = collection_set->get_young_bytes_to_be_promoted();
size_t old_evac_bytes = collection_set->get_old_bytes_reserved_for_evacuation();
size_t total_evac_bytes = young_evac_bytes + promote_evac_bytes + old_evac_bytes;
- log_info(gc, ergo)("Evacuation Targets: YOUNG: " SIZE_FORMAT "%s, "
- "PROMOTE: " SIZE_FORMAT "%s, "
- "OLD: " SIZE_FORMAT "%s, "
- "TOTAL: " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("Evacuation Targets: YOUNG: %zu%s, "
+ "PROMOTE: %zu%s, "
+ "OLD: %zu%s, "
+ "TOTAL: %zu%s",
byte_size_in_proper_unit(young_evac_bytes), proper_unit_for_byte_size(young_evac_bytes),
byte_size_in_proper_unit(promote_evac_bytes), proper_unit_for_byte_size(promote_evac_bytes),
byte_size_in_proper_unit(old_evac_bytes), proper_unit_for_byte_size(old_evac_bytes),
@@ -282,8 +281,8 @@ void ShenandoahGenerationalHeuristics::log_cset_composition(ShenandoahCollection
size_t collected_young = cset->get_young_bytes_reserved_for_evacuation();
log_info(gc, ergo)(
- "Chosen CSet evacuates young: " SIZE_FORMAT "%s (of which at least: " SIZE_FORMAT "%s are to be promoted), "
- "old: " SIZE_FORMAT "%s",
+ "Chosen CSet evacuates young: %zu%s (of which at least: %zu%s are to be promoted), "
+ "old: %zu%s",
byte_size_in_proper_unit(collected_young), proper_unit_for_byte_size(collected_young),
byte_size_in_proper_unit(collected_promoted), proper_unit_for_byte_size(collected_promoted),
byte_size_in_proper_unit(collected_old), proper_unit_for_byte_size(collected_old));
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp
index 4c1e6b7bdff1e..919f6c88afa9e 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/heuristics/shenandoahGlobalHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahGlobalGeneration.hpp"
@@ -92,8 +91,8 @@ void ShenandoahGlobalHeuristics::choose_global_collection_set(ShenandoahCollecti
size_t free_target = (capacity * ShenandoahMinFreeThreshold) / 100 + max_young_cset;
size_t min_garbage = (free_target > actual_free) ? (free_target - actual_free) : 0;
- log_info(gc, ergo)("Adaptive CSet Selection for GLOBAL. Max Young Evacuation: " SIZE_FORMAT
- "%s, Max Old Evacuation: " SIZE_FORMAT "%s, Actual Free: " SIZE_FORMAT "%s.",
+ log_info(gc, ergo)("Adaptive CSet Selection for GLOBAL. Max Young Evacuation: %zu"
+ "%s, Max Old Evacuation: %zu%s, Actual Free: %zu%s.",
byte_size_in_proper_unit(max_young_cset), proper_unit_for_byte_size(max_young_cset),
byte_size_in_proper_unit(max_old_cset), proper_unit_for_byte_size(max_old_cset),
byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free));
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp
index c2ad809f43a2f..fe0d82a72e367 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gcCause.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
@@ -121,7 +121,7 @@ void ShenandoahHeuristics::choose_collection_set(ShenandoahCollectionSet* collec
bool reg_live = region->has_live();
bool bm_live = ctx->is_marked(cast_to_oop(region->bottom()));
assert(reg_live == bm_live,
- "Humongous liveness and marks should agree. Region live: %s; Bitmap live: %s; Region Live Words: " SIZE_FORMAT,
+ "Humongous liveness and marks should agree. Region live: %s; Bitmap live: %s; Region Live Words: %zu",
BOOL_TO_STR(reg_live), BOOL_TO_STR(bm_live), region->get_live_data_words());
#endif
if (!region->has_live()) {
@@ -142,7 +142,7 @@ void ShenandoahHeuristics::choose_collection_set(ShenandoahCollectionSet* collec
// given the amount of immediately reclaimable garbage. If we do, figure out the collection set.
assert (immediate_garbage <= total_garbage,
- "Cannot have more immediate garbage than total garbage: " SIZE_FORMAT "%s vs " SIZE_FORMAT "%s",
+ "Cannot have more immediate garbage than total garbage: %zu%s vs %zu%s",
byte_size_in_proper_unit(immediate_garbage), proper_unit_for_byte_size(immediate_garbage),
byte_size_in_proper_unit(total_garbage), proper_unit_for_byte_size(total_garbage));
@@ -156,9 +156,9 @@ void ShenandoahHeuristics::choose_collection_set(ShenandoahCollectionSet* collec
size_t collectable_garbage = collection_set->garbage() + immediate_garbage;
size_t collectable_garbage_percent = (total_garbage == 0) ? 0 : (collectable_garbage * 100 / total_garbage);
- log_info(gc, ergo)("Collectable Garbage: " SIZE_FORMAT "%s (" SIZE_FORMAT "%%), "
- "Immediate: " SIZE_FORMAT "%s (" SIZE_FORMAT "%%), " SIZE_FORMAT " regions, "
- "CSet: " SIZE_FORMAT "%s (" SIZE_FORMAT "%%), " SIZE_FORMAT " regions",
+ log_info(gc, ergo)("Collectable Garbage: %zu%s (%zu%%), "
+ "Immediate: %zu%s (%zu%%), %zu regions, "
+ "CSet: %zu%s (%zu%%), %zu regions",
byte_size_in_proper_unit(collectable_garbage),
proper_unit_for_byte_size(collectable_garbage),
@@ -194,7 +194,7 @@ bool ShenandoahHeuristics::should_start_gc() {
if (_guaranteed_gc_interval > 0) {
double last_time_ms = (os::elapsedTime() - _last_cycle_end) * 1000;
if (last_time_ms > _guaranteed_gc_interval) {
- log_trigger("Time since last GC (%.0f ms) is larger than guaranteed interval (" UINTX_FORMAT " ms)",
+ log_trigger("Time since last GC (%.0f ms) is larger than guaranteed interval (%zu ms)",
last_time_ms, _guaranteed_gc_interval);
return true;
}
@@ -209,7 +209,7 @@ bool ShenandoahHeuristics::should_degenerate_cycle() {
void ShenandoahHeuristics::adjust_penalty(intx step) {
assert(0 <= _gc_time_penalties && _gc_time_penalties <= 100,
- "In range before adjustment: " INTX_FORMAT, _gc_time_penalties);
+ "In range before adjustment: %zd", _gc_time_penalties);
intx new_val = _gc_time_penalties + step;
if (new_val < 0) {
@@ -221,7 +221,7 @@ void ShenandoahHeuristics::adjust_penalty(intx step) {
_gc_time_penalties = new_val;
assert(0 <= _gc_time_penalties && _gc_time_penalties <= 100,
- "In range after adjustment: " INTX_FORMAT, _gc_time_penalties);
+ "In range after adjustment: %zd", _gc_time_penalties);
}
void ShenandoahHeuristics::log_trigger(const char* fmt, ...) {
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp
index abb2b7b266ad7..0393a2bb3664a 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
@@ -122,7 +121,7 @@ bool ShenandoahOldHeuristics::prime_collection_set(ShenandoahCollectionSet* coll
}
size_t remaining_old_evacuation_budget = old_evacuation_budget;
- log_debug(gc)("Choose old regions for mixed collection: old evacuation budget: " SIZE_FORMAT "%s, candidates: %u",
+ log_debug(gc)("Choose old regions for mixed collection: old evacuation budget: %zu%s, candidates: %u",
byte_size_in_proper_unit(old_evacuation_budget), proper_unit_for_byte_size(old_evacuation_budget),
unprocessed_old_collection_candidates());
@@ -362,7 +361,7 @@ void ShenandoahOldHeuristics::prepare_for_old_collections() {
immediate_regions++;
immediate_garbage += garbage;
size_t region_count = heap->trash_humongous_region_at(region);
- log_debug(gc)("Trashed " SIZE_FORMAT " regions for humongous object.", region_count);
+ log_debug(gc)("Trashed %zu regions for humongous object.", region_count);
}
} else if (region->is_trash()) {
// Count humongous objects made into trash here.
@@ -443,7 +442,7 @@ void ShenandoahOldHeuristics::prepare_for_old_collections() {
while ((defrag_count < bound_on_additional_regions) &&
(total_uncollected_old_regions < 7 * span_of_uncollected_regions / 8)) {
ShenandoahHeapRegion* r = candidates[_last_old_collection_candidate].get_region();
- assert(r->is_regular() || r->is_regular_pinned(), "Region " SIZE_FORMAT " has wrong state for collection: %s",
+ assert(r->is_regular() || r->is_regular_pinned(), "Region %zu has wrong state for collection: %s",
r->index(), ShenandoahHeapRegion::region_state_to_string(r->state()));
const size_t region_garbage = r->garbage();
const size_t region_free = r->free();
@@ -466,12 +465,12 @@ void ShenandoahOldHeuristics::prepare_for_old_collections() {
const size_t mixed_evac_live = old_candidates * region_size_bytes - (candidates_garbage + unfragmented);
set_unprocessed_old_collection_candidates_live_memory(mixed_evac_live);
- log_info(gc, ergo)("Old-Gen Collectable Garbage: " PROPERFMT " consolidated with free: " PROPERFMT ", over " SIZE_FORMAT " regions",
+ log_info(gc, ergo)("Old-Gen Collectable Garbage: " PROPERFMT " consolidated with free: " PROPERFMT ", over %zu regions",
PROPERFMTARGS(collectable_garbage), PROPERFMTARGS(unfragmented), old_candidates);
- log_info(gc, ergo)("Old-Gen Immediate Garbage: " PROPERFMT " over " SIZE_FORMAT " regions",
+ log_info(gc, ergo)("Old-Gen Immediate Garbage: " PROPERFMT " over %zu regions",
PROPERFMTARGS(immediate_garbage), immediate_regions);
- log_info(gc, ergo)("Old regions selected for defragmentation: " SIZE_FORMAT, defrag_count);
- log_info(gc, ergo)("Old regions not selected: " SIZE_FORMAT, total_uncollected_old_regions);
+ log_info(gc, ergo)("Old regions selected for defragmentation: %zu", defrag_count);
+ log_info(gc, ergo)("Old regions not selected: %zu", total_uncollected_old_regions);
if (unprocessed_old_collection_candidates() > 0) {
_old_generation->transition_to(ShenandoahOldGeneration::EVACUATING);
@@ -608,7 +607,7 @@ void ShenandoahOldHeuristics::set_trigger_if_old_is_overgrown() {
size_t trigger_threshold = _old_gen->usage_trigger_threshold();
// Detects unsigned arithmetic underflow
assert(old_used <= _heap->capacity(),
- "Old used (" SIZE_FORMAT ", " SIZE_FORMAT") must not be more than heap capacity (" SIZE_FORMAT ")",
+ "Old used (%zu, %zu) must not be more than heap capacity (%zu)",
_old_gen->used(), _old_gen->get_humongous_waste(), _heap->capacity());
if (old_used > trigger_threshold) {
_growth_trigger = true;
@@ -635,7 +634,7 @@ bool ShenandoahOldHeuristics::should_start_gc() {
const size_t old_gen_capacity = _old_generation->max_capacity();
const size_t heap_capacity = heap->capacity();
const double percent = percent_of(old_gen_capacity, heap_capacity);
- log_trigger("Expansion failure, current size: " SIZE_FORMAT "%s which is %.1f%% of total heap size",
+ log_trigger("Expansion failure, current size: %zu%s which is %.1f%% of total heap size",
byte_size_in_proper_unit(old_gen_capacity), proper_unit_for_byte_size(old_gen_capacity), percent);
return true;
}
@@ -655,8 +654,8 @@ bool ShenandoahOldHeuristics::should_start_gc() {
const size_t fragmented_free = used_regions_size - used;
log_trigger("Old has become fragmented: "
- SIZE_FORMAT "%s available bytes spread between range spanned from "
- SIZE_FORMAT " to " SIZE_FORMAT " (" SIZE_FORMAT "), density: %.1f%%",
+ "%zu%s available bytes spread between range spanned from "
+ "%zu to %zu (%zu), density: %.1f%%",
byte_size_in_proper_unit(fragmented_free), proper_unit_for_byte_size(fragmented_free),
first_old_region, last_old_region, span_of_old_regions, density * 100);
return true;
@@ -673,8 +672,8 @@ bool ShenandoahOldHeuristics::should_start_gc() {
if ((current_usage < ignore_threshold) &&
((consecutive_young_cycles = heap->shenandoah_policy()->consecutive_young_gc_count())
< ShenandoahDoNotIgnoreGrowthAfterYoungCycles)) {
- log_debug(gc)("Ignoring Trigger: Old has overgrown: usage (" SIZE_FORMAT "%s) is below threshold ("
- SIZE_FORMAT "%s) after " SIZE_FORMAT " consecutive completed young GCs",
+ log_debug(gc)("Ignoring Trigger: Old has overgrown: usage (%zu%s) is below threshold ("
+ "%zu%s) after %zu consecutive completed young GCs",
byte_size_in_proper_unit(current_usage), proper_unit_for_byte_size(current_usage),
byte_size_in_proper_unit(ignore_threshold), proper_unit_for_byte_size(ignore_threshold),
consecutive_young_cycles);
@@ -683,7 +682,7 @@ bool ShenandoahOldHeuristics::should_start_gc() {
const size_t live_at_previous_old = _old_generation->get_live_bytes_after_last_mark();
const double percent_growth = percent_of(current_usage - live_at_previous_old, live_at_previous_old);
log_trigger("Old has overgrown, live at end of previous OLD marking: "
- SIZE_FORMAT "%s, current usage: " SIZE_FORMAT "%s, percent growth: %.1f%%",
+ "%zu%s, current usage: %zu%s, percent growth: %.1f%%",
byte_size_in_proper_unit(live_at_previous_old), proper_unit_for_byte_size(live_at_previous_old),
byte_size_in_proper_unit(current_usage), proper_unit_for_byte_size(current_usage), percent_growth);
return true;
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp
index 7c65482d8c4f8..a0f209b0d20dd 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
@@ -60,7 +60,7 @@ void ShenandoahPassiveHeuristics::choose_collection_set_from_regiondata(Shenando
size_t available = MAX2(max_capacity / 100 * ShenandoahEvacReserve, actual_free);
size_t max_cset = (size_t)(available / ShenandoahEvacWaste);
- log_info(gc, ergo)("CSet Selection. Actual Free: " SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("CSet Selection. Actual Free: %zu%s, Max CSet: %zu%s",
byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),
byte_size_in_proper_unit(max_cset), proper_unit_for_byte_size(max_cset));
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp
index db179d0a80a81..8918d1b3d946a 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahStaticHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
@@ -52,7 +52,7 @@ bool ShenandoahStaticHeuristics::should_start_gc() {
size_t threshold_available = capacity / 100 * ShenandoahMinFreeThreshold;
if (available < threshold_available) {
- log_trigger("Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",
+ log_trigger("Free (%zu%s) is below minimum threshold (%zu%s)",
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
byte_size_in_proper_unit(threshold_available), proper_unit_for_byte_size(threshold_available));
return true;
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp
index ced406611b1e0..8e983f62ce192 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp"
#include "gc/shenandoah/heuristics/shenandoahYoungHeuristics.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
@@ -82,7 +81,7 @@ void ShenandoahYoungHeuristics::choose_young_collection_set(ShenandoahCollection
log_info(gc, ergo)(
- "Adaptive CSet Selection for YOUNG. Max Evacuation: " SIZE_FORMAT "%s, Actual Free: " SIZE_FORMAT "%s.",
+ "Adaptive CSet Selection for YOUNG. Max Evacuation: %zu%s, Actual Free: %zu%s.",
byte_size_in_proper_unit(max_cset), proper_unit_for_byte_size(max_cset),
byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free));
@@ -150,7 +149,7 @@ bool ShenandoahYoungHeuristics::should_start_gc() {
// If concurrent weak root processing is in progress, it means the old cycle has chosen mixed collection
// candidates, but has not completed. There is no point in trying to start the young cycle before the old
// cycle completes.
- log_trigger("Expedite mixed evacuation of " SIZE_FORMAT " regions", mixed_candidates);
+ log_trigger("Expedite mixed evacuation of %zu regions", mixed_candidates);
return true;
}
@@ -221,4 +220,3 @@ size_t ShenandoahYoungHeuristics::bytes_of_allocation_runway_before_gc_trigger(s
size_t evac_min_threshold = (anticipated_available > threshold)? anticipated_available - threshold: 0;
return MIN3(evac_slack_spiking, evac_slack_avg, evac_min_threshold);
}
-
diff --git a/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.cpp b/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.cpp
index 3a34a9aa6a88a..6c8858341555d 100644
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.cpp
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahYoungHeuristics.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
#include "gc/shenandoah/mode/shenandoahGenerationalMode.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/mode/shenandoahMode.cpp b/src/hotspot/share/gc/shenandoah/mode/shenandoahMode.cpp
index 126062ab9931a..5ef21719ed474 100644
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahMode.cpp
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahMode.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp"
#include "gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp"
#include "gc/shenandoah/heuristics/shenandoahCompactHeuristics.hpp"
@@ -51,4 +50,3 @@ ShenandoahHeuristics* ShenandoahMode::initialize_heuristics(ShenandoahSpaceInfo*
ShouldNotReachHere();
return nullptr;
}
-
diff --git a/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp b/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp
index 5c0ec2f884f03..893321db1dc2f 100644
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
#include "gc/shenandoah/heuristics/shenandoahSpaceInfo.hpp"
#include "gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/mode/shenandoahSATBMode.cpp b/src/hotspot/share/gc/shenandoah/mode/shenandoahSATBMode.cpp
index f5023c7cae963..7ac2d7b818f79 100644
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahSATBMode.cpp
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahSATBMode.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
#include "gc/shenandoah/mode/shenandoahSATBMode.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp b/src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp
index 7c574a9d0dd7e..94c98b78f1bc0 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/mode/shenandoahGenerationalMode.hpp"
#include "gc/shenandoah/shenandoahAgeCensus.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -32,8 +31,8 @@ ShenandoahAgeCensus::ShenandoahAgeCensus() {
assert(ShenandoahHeap::heap()->mode()->is_generational(), "Only in generational mode");
if (ShenandoahGenerationalMinTenuringAge > ShenandoahGenerationalMaxTenuringAge) {
vm_exit_during_initialization(
- err_msg("ShenandoahGenerationalMinTenuringAge=" SIZE_FORMAT
- " should be no more than ShenandoahGenerationalMaxTenuringAge=" SIZE_FORMAT,
+ err_msg("ShenandoahGenerationalMinTenuringAge=%zu"
+ " should be no more than ShenandoahGenerationalMaxTenuringAge=%zu",
ShenandoahGenerationalMinTenuringAge, ShenandoahGenerationalMaxTenuringAge));
}
@@ -247,7 +246,7 @@ void ShenandoahAgeCensus::update_tenuring_threshold() {
_tenuring_threshold[_epoch] = tt;
}
print();
- log_trace(gc, age)("New tenuring threshold " UINTX_FORMAT " (min " UINTX_FORMAT ", max " UINTX_FORMAT")",
+ log_trace(gc, age)("New tenuring threshold %zu (min %zu, max %zu)",
(uintx) _tenuring_threshold[_epoch], ShenandoahGenerationalMinTenuringAge, ShenandoahGenerationalMaxTenuringAge);
}
@@ -326,7 +325,7 @@ double ShenandoahAgeCensus::mortality_rate(size_t prev_pop, size_t cur_pop) {
// or increased.
if (cur_pop > prev_pop) {
log_trace(gc, age)
- (" (dark matter) Cohort population " SIZE_FORMAT_W(10) " to " SIZE_FORMAT_W(10),
+ (" (dark matter) Cohort population %10zu to %10zu",
prev_pop*oopSize, cur_pop*oopSize);
}
return 0.0;
@@ -355,7 +354,7 @@ void ShenandoahAgeCensus::print() {
// Suppress printing when everything is zero
if (prev_pop + cur_pop > 0) {
log_info(gc, age)
- (" - age %3u: prev " SIZE_FORMAT_W(10) " bytes, curr " SIZE_FORMAT_W(10) " bytes, mortality %.2f ",
+ (" - age %3u: prev %10zu bytes, curr %10zu bytes, mortality %.2f ",
i, prev_pop*oopSize, cur_pop*oopSize, mr);
}
total += cur_pop;
@@ -374,8 +373,8 @@ void ShenandoahNoiseStats::print(size_t total) {
float f_aged = (float)aged/(float)total;
float f_clamped = (float)clamped/(float)total;
float f_young = (float)young/(float)total;
- log_info(gc, age)("Skipped: " SIZE_FORMAT_W(10) " (%.2f), R-Aged: " SIZE_FORMAT_W(10) " (%.2f), "
- "Clamped: " SIZE_FORMAT_W(10) " (%.2f), R-Young: " SIZE_FORMAT_W(10) " (%.2f)",
+ log_info(gc, age)("Skipped: %10zu (%.2f), R-Aged: %10zu (%.2f), "
+ "Clamped: %10zu (%.2f), R-Young: %10zu (%.2f)",
skipped*oopSize, f_skipped, aged*oopSize, f_aged,
clamped*oopSize, f_clamped, young*oopSize, f_young);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp
index fa3f9019af425..cd1949b19ad51 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2018, 2022, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/fullGCForwarding.hpp"
#include "gc/shared/gcArguments.hpp"
#include "gc/shared/tlab_globals.hpp"
@@ -60,7 +60,7 @@ void ShenandoahArguments::initialize() {
if (UseLargePages) {
size_t large_page_size = os::large_page_size();
if ((align_up(MaxHeapSize, large_page_size) / large_page_size) < ShenandoahHeapRegion::MIN_NUM_REGIONS) {
- warning("Large pages size (" SIZE_FORMAT "K) is too large to afford page-sized regions, disabling uncommit",
+ warning("Large pages size (%zuK) is too large to afford page-sized regions, disabling uncommit",
os::large_page_size() / K);
FLAG_SET_DEFAULT(ShenandoahUncommit, false);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp
index 437646becce6a..ffafcc5840d78 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahForwarding.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
index 62067bccb1ed7..10dc344657fe4 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
index f3ce9418d35de..5d00688f67119 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
@@ -67,8 +67,7 @@ inline oop ShenandoahBarrierSet::load_reference_barrier_mutator(oop obj, T* load
oop fwd = resolve_forwarded_not_null_mutator(obj);
if (obj == fwd) {
- assert(_heap->is_evacuation_in_progress(),
- "evac should be in progress");
+ assert(_heap->is_evacuation_in_progress(), "evac should be in progress");
Thread* const t = Thread::current();
ShenandoahEvacOOMScope scope(t);
fwd = _heap->evacuate_object(obj, t);
@@ -86,8 +85,8 @@ inline oop ShenandoahBarrierSet::load_reference_barrier(oop obj) {
if (!ShenandoahLoadRefBarrier) {
return obj;
}
- if (_heap->has_forwarded_objects() &&
- _heap->in_collection_set(obj)) { // Subsumes null-check
+ if (_heap->has_forwarded_objects() && _heap->in_collection_set(obj)) {
+ // Subsumes null-check
assert(obj != nullptr, "cset check must have subsumed null-check");
oop fwd = resolve_forwarded_not_null(obj);
if (obj == fwd && _heap->is_evacuation_in_progress()) {
@@ -381,7 +380,7 @@ void ShenandoahBarrierSet::arraycopy_work(T* src, size_t count) {
// this barrier will be called with ENQUEUE=true and HAS_FWD=false, even though the young generation
// may have forwarded objects. In this case, the `arraycopy_work` is first called with HAS_FWD=true and
// ENQUEUE=false.
- assert(HAS_FWD == _heap->has_forwarded_objects() || (_heap->gc_state() & ShenandoahHeap::OLD_MARKING) != 0,
+ assert(HAS_FWD == _heap->has_forwarded_objects() || _heap->is_concurrent_old_mark_in_progress(),
"Forwarded object status is sane");
// This function cannot be called to handle marking and evacuation at the same time (they operate on
// different sides of the copy).
@@ -418,10 +417,10 @@ void ShenandoahBarrierSet::arraycopy_barrier(T* src, T* dst, size_t count) {
return;
}
- int gc_state = _heap->gc_state();
+ char gc_state = ShenandoahThreadLocalData::gc_state(Thread::current());
if ((gc_state & ShenandoahHeap::EVACUATION) != 0) {
arraycopy_evacuation(src, count);
- } else if ((gc_state & ShenandoahHeap::UPDATEREFS) != 0) {
+ } else if ((gc_state & ShenandoahHeap::UPDATE_REFS) != 0) {
arraycopy_update(src, count);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp
index 3b7bf9864deb0..8b83cc6b32cf9 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp
@@ -95,8 +95,7 @@ void ShenandoahBarrierSet::clone_barrier(oop obj) {
assert(ShenandoahCloneBarrier, "only get here with clone barriers enabled");
shenandoah_assert_correct(nullptr, obj);
- int gc_state = _heap->gc_state();
- if ((gc_state & ShenandoahHeap::EVACUATION) != 0) {
+ if (_heap->is_evacuation_in_progress()) {
clone_evacuation(obj);
} else {
clone_update(obj);
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp
index 7b30e1ecbac70..c6e6108fda81c 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSetNMethod.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetStackChunk.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetStackChunk.cpp
index 658b1da090233..224d9e1870a80 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetStackChunk.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetStackChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
#include "gc/shenandoah/shenandoahBarrierSetStackChunk.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.cpp
index fb0de2bc74106..af18a8219b1a3 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBreakpoint.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/concurrentGCBreakpoints.hpp"
#include "gc/shenandoah/shenandoahBreakpoint.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCardStats.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCardStats.cpp
index ef2d6e134b2e2..fc59af99817e1 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCardStats.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCardStats.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. *
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahCardStats.hpp"
#include "logging/log.hpp"
@@ -31,9 +31,9 @@
#ifndef PRODUCT
void ShenandoahCardStats::log() const {
if (ShenandoahEnableCardStats) {
- log_info(gc,remset)("Card stats: dirty " SIZE_FORMAT " (max run: " SIZE_FORMAT "),"
- " clean " SIZE_FORMAT " (max run: " SIZE_FORMAT "),"
- " dirty scans/objs " SIZE_FORMAT,
+ log_info(gc,remset)("Card stats: dirty %zu (max run: %zu),"
+ " clean %zu (max run: %zu),"
+ " dirty scans/objs %zu",
_dirty_card_cnt, _max_dirty_run,
_clean_card_cnt, _max_clean_run,
_dirty_scan_obj_cnt);
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCardTable.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCardTable.cpp
index 692144344d077..05bb5d00d8fdf 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCardTable.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCardTable.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahCardTable.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahUtils.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp
index 657cd681f4f64..49d2df0cc936c 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/classUnloadingContext.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp
index 4d521d2e7f071..c27b790fbf7dd 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, 2023, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAgeCensus.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
@@ -186,7 +185,7 @@ ShenandoahHeapRegion* ShenandoahCollectionSet::next() {
void ShenandoahCollectionSet::print_on(outputStream* out) const {
out->print_cr("Collection Set: Regions: "
- SIZE_FORMAT ", Garbage: " SIZE_FORMAT "%s, Live: " SIZE_FORMAT "%s, Used: " SIZE_FORMAT "%s", count(),
+ "%zu, Garbage: %zu%s, Live: %zu%s, Used: %zu%s", count(),
byte_size_in_proper_unit(garbage()), proper_unit_for_byte_size(garbage()),
byte_size_in_proper_unit(live()), proper_unit_for_byte_size(live()),
byte_size_in_proper_unit(used()), proper_unit_for_byte_size(used()));
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp
index 42500ae877892..782db285c2ad0 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2013, 2021, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahGC.hpp"
@@ -179,7 +179,7 @@ void ShenandoahCollectorPolicy::print_gc_stats(outputStream* out) const {
out->cr();
size_t completed_gcs = _success_full_gcs + _success_degenerated_gcs + _success_concurrent_gcs + _success_old_gcs;
- out->print_cr(SIZE_FORMAT_W(5) " Completed GCs", completed_gcs);
+ out->print_cr("%5zu Completed GCs", completed_gcs);
size_t explicit_requests = 0;
size_t implicit_requests = 0;
@@ -193,48 +193,48 @@ void ShenandoahCollectorPolicy::print_gc_stats(outputStream* out) const {
implicit_requests += cause_count;
}
const char* desc = GCCause::to_string(cause);
- out->print_cr(" " SIZE_FORMAT_W(5) " caused by %s (%.2f%%)", cause_count, desc, percent_of(cause_count, completed_gcs));
+ out->print_cr(" %5zu caused by %s (%.2f%%)", cause_count, desc, percent_of(cause_count, completed_gcs));
}
}
out->cr();
- out->print_cr(SIZE_FORMAT_W(5) " Successful Concurrent GCs (%.2f%%)", _success_concurrent_gcs, percent_of(_success_concurrent_gcs, completed_gcs));
+ out->print_cr("%5zu Successful Concurrent GCs (%.2f%%)", _success_concurrent_gcs, percent_of(_success_concurrent_gcs, completed_gcs));
if (ExplicitGCInvokesConcurrent) {
- out->print_cr(" " SIZE_FORMAT_W(5) " invoked explicitly (%.2f%%)", explicit_requests, percent_of(explicit_requests, _success_concurrent_gcs));
+ out->print_cr(" %5zu invoked explicitly (%.2f%%)", explicit_requests, percent_of(explicit_requests, _success_concurrent_gcs));
}
if (ShenandoahImplicitGCInvokesConcurrent) {
- out->print_cr(" " SIZE_FORMAT_W(5) " invoked implicitly (%.2f%%)", implicit_requests, percent_of(implicit_requests, _success_concurrent_gcs));
+ out->print_cr(" %5zu invoked implicitly (%.2f%%)", implicit_requests, percent_of(implicit_requests, _success_concurrent_gcs));
}
- out->print_cr(" " SIZE_FORMAT_W(5) " abbreviated (%.2f%%)", _abbreviated_concurrent_gcs, percent_of(_abbreviated_concurrent_gcs, _success_concurrent_gcs));
+ out->print_cr(" %5zu abbreviated (%.2f%%)", _abbreviated_concurrent_gcs, percent_of(_abbreviated_concurrent_gcs, _success_concurrent_gcs));
out->cr();
if (ShenandoahHeap::heap()->mode()->is_generational()) {
- out->print_cr(SIZE_FORMAT_W(5) " Completed Old GCs (%.2f%%)", _success_old_gcs, percent_of(_success_old_gcs, completed_gcs));
- out->print_cr(" " SIZE_FORMAT_W(5) " mixed", _mixed_gcs);
- out->print_cr(" " SIZE_FORMAT_W(5) " interruptions", _interrupted_old_gcs);
+ out->print_cr("%5zu Completed Old GCs (%.2f%%)", _success_old_gcs, percent_of(_success_old_gcs, completed_gcs));
+ out->print_cr(" %5zu mixed", _mixed_gcs);
+ out->print_cr(" %5zu interruptions", _interrupted_old_gcs);
out->cr();
}
size_t degenerated_gcs = _alloc_failure_degenerated_upgrade_to_full + _success_degenerated_gcs;
- out->print_cr(SIZE_FORMAT_W(5) " Degenerated GCs (%.2f%%)", degenerated_gcs, percent_of(degenerated_gcs, completed_gcs));
- out->print_cr(" " SIZE_FORMAT_W(5) " upgraded to Full GC (%.2f%%)", _alloc_failure_degenerated_upgrade_to_full, percent_of(_alloc_failure_degenerated_upgrade_to_full, degenerated_gcs));
- out->print_cr(" " SIZE_FORMAT_W(5) " caused by allocation failure (%.2f%%)", _alloc_failure_degenerated, percent_of(_alloc_failure_degenerated, degenerated_gcs));
- out->print_cr(" " SIZE_FORMAT_W(5) " abbreviated (%.2f%%)", _abbreviated_degenerated_gcs, percent_of(_abbreviated_degenerated_gcs, degenerated_gcs));
+ out->print_cr("%5zu Degenerated GCs (%.2f%%)", degenerated_gcs, percent_of(degenerated_gcs, completed_gcs));
+ out->print_cr(" %5zu upgraded to Full GC (%.2f%%)", _alloc_failure_degenerated_upgrade_to_full, percent_of(_alloc_failure_degenerated_upgrade_to_full, degenerated_gcs));
+ out->print_cr(" %5zu caused by allocation failure (%.2f%%)", _alloc_failure_degenerated, percent_of(_alloc_failure_degenerated, degenerated_gcs));
+ out->print_cr(" %5zu abbreviated (%.2f%%)", _abbreviated_degenerated_gcs, percent_of(_abbreviated_degenerated_gcs, degenerated_gcs));
for (int c = 0; c < ShenandoahGC::_DEGENERATED_LIMIT; c++) {
if (_degen_point_counts[c] > 0) {
const char* desc = ShenandoahGC::degen_point_to_string((ShenandoahGC::ShenandoahDegenPoint)c);
- out->print_cr(" " SIZE_FORMAT_W(5) " happened at %s", _degen_point_counts[c], desc);
+ out->print_cr(" %5zu happened at %s", _degen_point_counts[c], desc);
}
}
out->cr();
- out->print_cr(SIZE_FORMAT_W(5) " Full GCs (%.2f%%)", _success_full_gcs, percent_of(_success_full_gcs, completed_gcs));
+ out->print_cr("%5zu Full GCs (%.2f%%)", _success_full_gcs, percent_of(_success_full_gcs, completed_gcs));
if (!ExplicitGCInvokesConcurrent) {
- out->print_cr(" " SIZE_FORMAT_W(5) " invoked explicitly (%.2f%%)", explicit_requests, percent_of(explicit_requests, _success_concurrent_gcs));
+ out->print_cr(" %5zu invoked explicitly (%.2f%%)", explicit_requests, percent_of(explicit_requests, _success_concurrent_gcs));
}
if (!ShenandoahImplicitGCInvokesConcurrent) {
- out->print_cr(" " SIZE_FORMAT_W(5) " invoked implicitly (%.2f%%)", implicit_requests, percent_of(implicit_requests, _success_concurrent_gcs));
+ out->print_cr(" %5zu invoked implicitly (%.2f%%)", implicit_requests, percent_of(implicit_requests, _success_concurrent_gcs));
}
- out->print_cr(" " SIZE_FORMAT_W(5) " caused by allocation failure (%.2f%%)", _alloc_failure_full, percent_of(_alloc_failure_full, _success_full_gcs));
- out->print_cr(" " SIZE_FORMAT_W(5) " upgraded from Degenerated GC (%.2f%%)", _alloc_failure_degenerated_upgrade_to_full, percent_of(_alloc_failure_degenerated_upgrade_to_full, _success_full_gcs));
+ out->print_cr(" %5zu caused by allocation failure (%.2f%%)", _alloc_failure_full, percent_of(_alloc_failure_full, _success_full_gcs));
+ out->print_cr(" %5zu upgraded from Degenerated GC (%.2f%%)", _alloc_failure_degenerated_upgrade_to_full, percent_of(_alloc_failure_degenerated_upgrade_to_full, _success_full_gcs));
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
index b1c2e72ef82b6..5ac7ceeab05dd 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "gc/shared/collectorCounters.hpp"
@@ -192,20 +191,26 @@ bool ShenandoahConcurrentGC::collect(GCCause::Cause cause) {
return false;
}
+ // Evacuation is complete, retire gc labs
+ heap->concurrent_prepare_for_update_refs();
+
// Perform update-refs phase.
- vmop_entry_init_updaterefs();
- entry_updaterefs();
- if (check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_updaterefs)) {
+ if (ShenandoahVerify || ShenandoahPacing) {
+ vmop_entry_init_update_refs();
+ }
+
+ entry_update_refs();
+ if (check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_update_refs)) {
return false;
}
// Concurrent update thread roots
entry_update_thread_roots();
- if (check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_updaterefs)) {
+ if (check_cancellation_and_abort(ShenandoahDegenPoint::_degenerated_update_refs)) {
return false;
}
- vmop_entry_final_updaterefs();
+ vmop_entry_final_update_refs();
// Update references freed up collection set, kick the cleanup to reclaim the space.
entry_cleanup_complete();
@@ -259,7 +264,7 @@ void ShenandoahConcurrentGC::vmop_entry_final_mark() {
VMThread::execute(&op); // jump to entry_final_mark under safepoint
}
-void ShenandoahConcurrentGC::vmop_entry_init_updaterefs() {
+void ShenandoahConcurrentGC::vmop_entry_init_update_refs() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
TraceCollectorStats tcs(heap->monitoring_support()->stw_collection_counters());
ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::init_update_refs_gross);
@@ -269,7 +274,7 @@ void ShenandoahConcurrentGC::vmop_entry_init_updaterefs() {
VMThread::execute(&op);
}
-void ShenandoahConcurrentGC::vmop_entry_final_updaterefs() {
+void ShenandoahConcurrentGC::vmop_entry_final_update_refs() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
TraceCollectorStats tcs(heap->monitoring_support()->stw_collection_counters());
ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::final_update_refs_gross);
@@ -314,16 +319,16 @@ void ShenandoahConcurrentGC::entry_final_mark() {
op_final_mark();
}
-void ShenandoahConcurrentGC::entry_init_updaterefs() {
+void ShenandoahConcurrentGC::entry_init_update_refs() {
static const char* msg = "Pause Init Update Refs";
ShenandoahPausePhase gc_phase(msg, ShenandoahPhaseTimings::init_update_refs);
EventMark em("%s", msg);
// No workers used in this phase, no setup required
- op_init_updaterefs();
+ op_init_update_refs();
}
-void ShenandoahConcurrentGC::entry_final_updaterefs() {
+void ShenandoahConcurrentGC::entry_final_update_refs() {
static const char* msg = "Pause Final Update Refs";
ShenandoahPausePhase gc_phase(msg, ShenandoahPhaseTimings::final_update_refs);
EventMark em("%s", msg);
@@ -332,7 +337,7 @@ void ShenandoahConcurrentGC::entry_final_updaterefs() {
ShenandoahWorkerPolicy::calc_workers_for_final_update_ref(),
"final reference update");
- op_final_updaterefs();
+ op_final_update_refs();
}
void ShenandoahConcurrentGC::entry_final_roots() {
@@ -551,7 +556,7 @@ void ShenandoahConcurrentGC::entry_update_thread_roots() {
op_update_thread_roots();
}
-void ShenandoahConcurrentGC::entry_updaterefs() {
+void ShenandoahConcurrentGC::entry_update_refs() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
static const char* msg = "Concurrent update references";
@@ -563,7 +568,7 @@ void ShenandoahConcurrentGC::entry_updaterefs() {
"concurrent reference update");
heap->try_inject_alloc_failure();
- op_updaterefs();
+ op_update_refs();
}
void ShenandoahConcurrentGC::entry_cleanup_complete() {
@@ -593,7 +598,7 @@ class ShenandoahInitMarkUpdateRegionStateClosure : public ShenandoahHeapRegionCl
ShenandoahInitMarkUpdateRegionStateClosure() : _ctx(ShenandoahHeap::heap()->marking_context()) {}
void heap_region_do(ShenandoahHeapRegion* r) {
- assert(!r->has_live(), "Region " SIZE_FORMAT " should have no live data", r->index());
+ assert(!r->has_live(), "Region %zu should have no live data", r->index());
if (r->is_active()) {
// Check if region needs updating its TAMS. We have updated it already during concurrent
// reset, so it is very likely we don't need to do another write here. Since most regions
@@ -603,7 +608,7 @@ class ShenandoahInitMarkUpdateRegionStateClosure : public ShenandoahHeapRegionCl
}
} else {
assert(_ctx->top_at_mark_start(r) == r->top(),
- "Region " SIZE_FORMAT " should already have correct TAMS", r->index());
+ "Region %zu should already have correct TAMS", r->index());
}
}
@@ -748,10 +753,6 @@ void ShenandoahConcurrentGC::op_final_mark() {
heap->verifier()->verify_after_concmark();
}
}
-
- if (VerifyAfterGC) {
- Universe::verify();
- }
}
}
}
@@ -920,8 +921,8 @@ class ShenandoahConcurrentWeakRootsEvacUpdateTask : public WorkerTask {
}
// If we are going to perform concurrent class unloading later on, we need to
- // cleanup the weak oops in CLD and determinate nmethod's unloading state, so that we
- // can cleanup immediate garbage sooner.
+ // clean up the weak oops in CLD and determine nmethod's unloading state, so that we
+ // can clean up immediate garbage sooner.
if (ShenandoahHeap::heap()->unload_classes()) {
// Applies ShenandoahIsCLDAlive closure to CLDs, native barrier will either null the
// CLD's holder or evacuate it.
@@ -947,21 +948,10 @@ void ShenandoahConcurrentGC::op_weak_roots() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
assert(heap->is_concurrent_weak_root_in_progress(), "Only during this phase");
// Concurrent weak root processing
- {
- ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_roots_work);
- ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_roots_work);
- ShenandoahConcurrentWeakRootsEvacUpdateTask task(ShenandoahPhaseTimings::conc_weak_roots_work);
- heap->workers()->run_task(&task);
- }
-
- // Perform handshake to flush out dead oops
- {
- ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_roots_rendezvous);
- heap->rendezvous_threads("Shenandoah Concurrent Weak Roots");
- }
- // We can only toggle concurrent_weak_root_in_progress flag
- // at a safepoint, so that mutators see a consistent
- // value. The flag will be cleared at the next safepoint.
+ ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_roots_work);
+ ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_roots_work);
+ ShenandoahConcurrentWeakRootsEvacUpdateTask task(ShenandoahPhaseTimings::conc_weak_roots_work);
+ heap->workers()->run_task(&task);
}
void ShenandoahConcurrentGC::op_class_unloading() {
@@ -1056,21 +1046,17 @@ void ShenandoahConcurrentGC::op_evacuate() {
ShenandoahHeap::heap()->evacuate_collection_set(true /*concurrent*/);
}
-void ShenandoahConcurrentGC::op_init_updaterefs() {
+void ShenandoahConcurrentGC::op_init_update_refs() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
- heap->set_evacuation_in_progress(false);
- heap->set_concurrent_weak_root_in_progress(false);
- heap->prepare_update_heap_references(true /*concurrent*/);
- heap->set_update_refs_in_progress(true);
if (ShenandoahVerify) {
- heap->verifier()->verify_before_updaterefs();
+ heap->verifier()->verify_before_update_refs();
}
if (ShenandoahPacing) {
- heap->pacer()->setup_for_updaterefs();
+ heap->pacer()->setup_for_update_refs();
}
}
-void ShenandoahConcurrentGC::op_updaterefs() {
+void ShenandoahConcurrentGC::op_update_refs() {
ShenandoahHeap::heap()->update_heap_references(true /*concurrent*/);
}
@@ -1102,7 +1088,7 @@ void ShenandoahConcurrentGC::op_update_thread_roots() {
Handshake::execute(&cl);
}
-void ShenandoahConcurrentGC::op_final_updaterefs() {
+void ShenandoahConcurrentGC::op_final_update_refs() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "must be at safepoint");
assert(!heap->_update_refs_iterator.has_next(), "Should have finished update references");
@@ -1150,7 +1136,7 @@ void ShenandoahConcurrentGC::op_final_updaterefs() {
}
if (ShenandoahVerify) {
- heap->verifier()->verify_after_updaterefs();
+ heap->verifier()->verify_after_update_refs();
}
if (VerifyAfterGC) {
@@ -1178,6 +1164,10 @@ void ShenandoahConcurrentGC::op_final_roots() {
ShenandoahGenerationalHeap::heap()->update_region_ages(_generation->complete_marking_context());
}
}
+
+ if (VerifyAfterGC) {
+ Universe::verify();
+ }
}
void ShenandoahConcurrentGC::op_cleanup_complete() {
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.hpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.hpp
index a1837068a7cc0..b4c858bb24551 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.hpp
@@ -67,16 +67,16 @@ class ShenandoahConcurrentGC : public ShenandoahGC {
// call the entry method below
void vmop_entry_init_mark();
void vmop_entry_final_mark();
- void vmop_entry_init_updaterefs();
- void vmop_entry_final_updaterefs();
+ void vmop_entry_init_update_refs();
+ void vmop_entry_final_update_refs();
void vmop_entry_final_roots();
// Entry methods to normally STW GC operations. These set up logging, monitoring
// and workers for net VM operation
void entry_init_mark();
void entry_final_mark();
- void entry_init_updaterefs();
- void entry_final_updaterefs();
+ void entry_init_update_refs();
+ void entry_final_update_refs();
void entry_final_roots();
// Entry methods to normally concurrent GC operations. These set up logging, monitoring
@@ -93,7 +93,7 @@ class ShenandoahConcurrentGC : public ShenandoahGC {
void entry_cleanup_early();
void entry_evacuate();
void entry_update_thread_roots();
- void entry_updaterefs();
+ void entry_update_refs();
void entry_cleanup_complete();
// Called when the collection set is empty, but the generational mode has regions to promote in place
@@ -112,10 +112,10 @@ class ShenandoahConcurrentGC : public ShenandoahGC {
void op_strong_roots();
void op_cleanup_early();
void op_evacuate();
- void op_init_updaterefs();
- void op_updaterefs();
+ void op_init_update_refs();
+ void op_update_refs();
void op_update_thread_roots();
- void op_final_updaterefs();
+ void op_final_update_refs();
void op_final_roots();
void op_cleanup_complete();
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
index 1709844a8c39a..1feb19f6e4a9a 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/satbMarkQueue.hpp"
#include "gc/shared/strongRootsScope.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
index 136ac22d840ff..7208a0926828e 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahConcurrentGC.hpp"
#include "gc/shenandoah/shenandoahControlThread.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahController.cpp b/src/hotspot/share/gc/shenandoah/shenandoahController.cpp
index effa4a8f1fc9c..a4d5a57234918 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahController.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahController.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -21,7 +22,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shenandoah/shenandoahController.hpp"
@@ -61,7 +61,7 @@ void ShenandoahController::handle_alloc_failure(ShenandoahAllocRequest& req, boo
if (try_set_alloc_failure_gc(is_humongous)) {
// Only report the first allocation failure
- log_info(gc)("Failed to allocate %s, " SIZE_FORMAT "%s",
+ log_info(gc)("Failed to allocate %s, %zu%s",
req.type_string(),
byte_size_in_proper_unit(req.size() * HeapWordSize), proper_unit_for_byte_size(req.size() * HeapWordSize));
@@ -84,7 +84,7 @@ void ShenandoahController::handle_alloc_failure_evac(size_t words) {
if (try_set_alloc_failure_gc(is_humongous)) {
// Only report the first allocation failure
- log_info(gc)("Failed to allocate " SIZE_FORMAT "%s for evacuation",
+ log_info(gc)("Failed to allocate %zu%s for evacuation",
byte_size_in_proper_unit(words * HeapWordSize), proper_unit_for_byte_size(words * HeapWordSize));
}
@@ -109,4 +109,3 @@ bool ShenandoahController::try_set_alloc_failure_gc(bool is_humongous) {
bool ShenandoahController::is_alloc_failure_gc() {
return _alloc_failure_gc.is_set();
}
-
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp
index 7d2690ef5f614..95d8543f46ab7 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
@@ -264,15 +263,15 @@ void ShenandoahDegenGC::op_degenerated() {
// If heuristics thinks we should do the cycle, this flag would be set,
// and we need to do update-refs. Otherwise, it would be the shortcut cycle.
if (heap->has_forwarded_objects()) {
- op_init_updaterefs();
+ op_init_update_refs();
assert(!heap->cancelled_gc(), "STW reference update can not OOM");
} else {
_abbreviated = true;
}
- case _degenerated_updaterefs:
+ case _degenerated_update_refs:
if (heap->has_forwarded_objects()) {
- op_updaterefs();
+ op_update_refs();
op_update_roots();
assert(!heap->cancelled_gc(), "STW reference update can not OOM");
}
@@ -387,16 +386,16 @@ void ShenandoahDegenGC::op_evacuate() {
ShenandoahHeap::heap()->evacuate_collection_set(false /* concurrent*/);
}
-void ShenandoahDegenGC::op_init_updaterefs() {
+void ShenandoahDegenGC::op_init_update_refs() {
// Evacuation has completed
ShenandoahHeap* const heap = ShenandoahHeap::heap();
heap->prepare_update_heap_references(false /*concurrent*/);
heap->set_update_refs_in_progress(true);
}
-void ShenandoahDegenGC::op_updaterefs() {
+void ShenandoahDegenGC::op_update_refs() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
- ShenandoahGCPhase phase(ShenandoahPhaseTimings::degen_gc_updaterefs);
+ ShenandoahGCPhase phase(ShenandoahPhaseTimings::degen_gc_update_refs);
// Handed over from concurrent update references phase
heap->update_heap_references(false /*concurrent*/);
@@ -412,7 +411,7 @@ void ShenandoahDegenGC::op_update_roots() {
heap->update_heap_region_states(false /*concurrent*/);
if (ShenandoahVerify) {
- heap->verifier()->verify_after_updaterefs();
+ heap->verifier()->verify_after_update_refs();
}
if (VerifyAfterGC) {
@@ -447,7 +446,7 @@ const char* ShenandoahDegenGC::degen_event_message(ShenandoahDegenPoint point) c
SHENANDOAH_RETURN_EVENT_MESSAGE(_generation->type(), "Pause Degenerated GC", " (Mark)");
case _degenerated_evac:
SHENANDOAH_RETURN_EVENT_MESSAGE(_generation->type(), "Pause Degenerated GC", " (Evacuation)");
- case _degenerated_updaterefs:
+ case _degenerated_update_refs:
SHENANDOAH_RETURN_EVENT_MESSAGE(_generation->type(), "Pause Degenerated GC", " (Update Refs)");
default:
ShouldNotReachHere();
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.hpp b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.hpp
index 8dc8ecea75fb2..971bd67eb0df8 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.hpp
@@ -53,8 +53,8 @@ class ShenandoahDegenGC : public ShenandoahGC {
void op_cleanup_early();
void op_evacuate();
- void op_init_updaterefs();
- void op_updaterefs();
+ void op_init_update_refs();
+ void op_update_refs();
void op_update_roots();
void op_cleanup_complete();
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp
index 8334126b6f829..9c84ac41e8415 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahEvacOOMHandler.inline.hpp"
#include "gc/shenandoah/shenandoahUtils.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahEvacTracker.cpp b/src/hotspot/share/gc/shenandoah/shenandoahEvacTracker.cpp
index ededb99b24ecf..3ddc8bf636e91 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahEvacTracker.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahEvacTracker.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -21,7 +22,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAgeCensus.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -84,8 +84,8 @@ void ShenandoahEvacuationStats::print_on(outputStream* st) {
#ifndef PRODUCT
size_t abandoned_size = _bytes_attempted - _bytes_completed;
size_t abandoned_count = _evacuations_attempted - _evacuations_completed;
- st->print_cr("Evacuated " SIZE_FORMAT "%s across " SIZE_FORMAT " objects, "
- "abandoned " SIZE_FORMAT "%s across " SIZE_FORMAT " objects.",
+ st->print_cr("Evacuated %zu%s across %zu objects, "
+ "abandoned %zu%s across %zu objects.",
byte_size_in_proper_unit(_bytes_completed), proper_unit_for_byte_size(_bytes_completed),
_evacuations_completed,
byte_size_in_proper_unit(abandoned_size), proper_unit_for_byte_size(abandoned_size),
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
index 89a04d23cec92..138e032074831 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/tlab_globals.hpp"
#include "gc/shenandoah/shenandoahAffiliation.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
@@ -65,7 +65,7 @@ class ShenandoahLeftRightIterator {
bool has_next() const {
if (_idx <= _end) {
- assert(_partitions->in_free_set(_partition, _idx), "Boundaries or find_last_set_bit failed: " SSIZE_FORMAT, _idx);
+ assert(_partitions->in_free_set(_partition, _idx), "Boundaries or find_last_set_bit failed: %zd", _idx);
return true;
}
return false;
@@ -96,7 +96,7 @@ class ShenandoahRightLeftIterator {
bool has_next() const {
if (_idx >= _end) {
- assert(_partitions->in_free_set(_partition, _idx), "Boundaries or find_last_set_bit failed: " SSIZE_FORMAT, _idx);
+ assert(_partitions->in_free_set(_partition, _idx), "Boundaries or find_last_set_bit failed: %zd", _idx);
return true;
}
return false;
@@ -114,17 +114,17 @@ class ShenandoahRightLeftIterator {
#ifndef PRODUCT
void ShenandoahRegionPartitions::dump_bitmap() const {
- log_debug(gc)("Mutator range [" SSIZE_FORMAT ", " SSIZE_FORMAT "], Collector range [" SSIZE_FORMAT ", " SSIZE_FORMAT
- "], Old Collector range [" SSIZE_FORMAT ", " SSIZE_FORMAT "]",
+ log_debug(gc)("Mutator range [%zd, %zd], Collector range [%zd, %zd"
+ "], Old Collector range [%zd, %zd]",
_leftmosts[int(ShenandoahFreeSetPartitionId::Mutator)],
_rightmosts[int(ShenandoahFreeSetPartitionId::Mutator)],
_leftmosts[int(ShenandoahFreeSetPartitionId::Collector)],
_rightmosts[int(ShenandoahFreeSetPartitionId::Collector)],
_leftmosts[int(ShenandoahFreeSetPartitionId::OldCollector)],
_rightmosts[int(ShenandoahFreeSetPartitionId::OldCollector)]);
- log_debug(gc)("Empty Mutator range [" SSIZE_FORMAT ", " SSIZE_FORMAT
- "], Empty Collector range [" SSIZE_FORMAT ", " SSIZE_FORMAT
- "], Empty Old Collecto range [" SSIZE_FORMAT ", " SSIZE_FORMAT "]",
+ log_debug(gc)("Empty Mutator range [%zd, %zd"
+ "], Empty Collector range [%zd, %zd"
+ "], Empty Old Collecto range [%zd, %zd]",
_leftmosts_empty[int(ShenandoahFreeSetPartitionId::Mutator)],
_rightmosts_empty[int(ShenandoahFreeSetPartitionId::Mutator)],
_leftmosts_empty[int(ShenandoahFreeSetPartitionId::Collector)],
@@ -156,7 +156,7 @@ void ShenandoahRegionPartitions::dump_bitmap_row(idx_t region_idx) const {
uintx old_collector_bits = _membership[int(ShenandoahFreeSetPartitionId::OldCollector)].bits_at(aligned_idx);
uintx free_bits = mutator_bits | collector_bits | old_collector_bits;
uintx notfree_bits = ~free_bits;
- log_debug(gc)(SSIZE_FORMAT_W(6) ": " SIZE_FORMAT_X_0 " 0x" SIZE_FORMAT_X_0 " 0x" SIZE_FORMAT_X_0 " 0x" SIZE_FORMAT_X_0,
+ log_debug(gc)("%6zd : " SIZE_FORMAT_X_0 " 0x" SIZE_FORMAT_X_0 " 0x" SIZE_FORMAT_X_0 " 0x" SIZE_FORMAT_X_0,
aligned_idx, mutator_bits, collector_bits, old_collector_bits, notfree_bits);
}
#endif
@@ -272,7 +272,7 @@ void ShenandoahRegionPartitions::increase_used(ShenandoahFreeSetPartitionId whic
assert (which_partition < NumPartitions, "Partition must be valid");
_used[int(which_partition)] += bytes;
assert (_used[int(which_partition)] <= _capacity[int(which_partition)],
- "Must not use (" SIZE_FORMAT ") more than capacity (" SIZE_FORMAT ") after increase by " SIZE_FORMAT,
+ "Must not use (%zu) more than capacity (%zu) after increase by %zu",
_used[int(which_partition)], _capacity[int(which_partition)], bytes);
}
@@ -337,7 +337,7 @@ void ShenandoahRegionPartitions::retire_range_from_partition(
ShenandoahFreeSetPartitionId partition, idx_t low_idx, idx_t high_idx) {
// Note: we may remove from free partition even if region is not entirely full, such as when available < PLAB::min_size()
- assert ((low_idx < _max) && (high_idx < _max), "Both indices are sane: " SIZE_FORMAT " and " SIZE_FORMAT " < " SIZE_FORMAT,
+ assert ((low_idx < _max) && (high_idx < _max), "Both indices are sane: %zu and %zu < %zu",
low_idx, high_idx, _max);
assert (partition < NumPartitions, "Cannot remove from free partitions if not already free");
@@ -352,7 +352,7 @@ void ShenandoahRegionPartitions::retire_range_from_partition(
void ShenandoahRegionPartitions::retire_from_partition(ShenandoahFreeSetPartitionId partition, idx_t idx, size_t used_bytes) {
// Note: we may remove from free partition even if region is not entirely full, such as when available < PLAB::min_size()
- assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT, idx, _max);
+ assert (idx < _max, "index is sane: %zu < %zu", idx, _max);
assert (partition < NumPartitions, "Cannot remove from free partitions if not already free");
assert (in_free_set(partition, idx), "Must be in partition to remove from partition");
@@ -366,7 +366,7 @@ void ShenandoahRegionPartitions::retire_from_partition(ShenandoahFreeSetPartitio
}
void ShenandoahRegionPartitions::make_free(idx_t idx, ShenandoahFreeSetPartitionId which_partition, size_t available) {
- assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT, idx, _max);
+ assert (idx < _max, "index is sane: %zu < %zu", idx, _max);
assert (membership(idx) == ShenandoahFreeSetPartitionId::NotFree, "Cannot make free if already free");
assert (which_partition < NumPartitions, "selected free partition must be valid");
assert (available <= _region_size_bytes, "Available cannot exceed region size");
@@ -398,14 +398,14 @@ bool ShenandoahRegionPartitions::available_implies_empty(size_t available_in_reg
void ShenandoahRegionPartitions::move_from_partition_to_partition(idx_t idx, ShenandoahFreeSetPartitionId orig_partition,
ShenandoahFreeSetPartitionId new_partition, size_t available) {
ShenandoahHeapRegion* r = ShenandoahHeap::heap()->get_region(idx);
- assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT, idx, _max);
+ assert (idx < _max, "index is sane: %zu < %zu", idx, _max);
assert (orig_partition < NumPartitions, "Original partition must be valid");
assert (new_partition < NumPartitions, "New partition must be valid");
assert (available <= _region_size_bytes, "Available cannot exceed region size");
assert (_membership[int(orig_partition)].is_set(idx), "Cannot move from partition unless in partition");
assert ((r != nullptr) && ((r->is_trash() && (available == _region_size_bytes)) ||
(r->used() + available == _region_size_bytes)),
- "Used: " SIZE_FORMAT " + available: " SIZE_FORMAT " should equal region size: " SIZE_FORMAT,
+ "Used: %zu + available: %zu should equal region size: %zu",
ShenandoahHeap::heap()->get_region(idx)->used(), available, _region_size_bytes);
// Expected transitions:
@@ -422,13 +422,13 @@ void ShenandoahRegionPartitions::move_from_partition_to_partition(idx_t idx, She
(is_young_collector_partition(orig_partition) && is_mutator_partition(new_partition)) ||
(is_old_collector_partition(orig_partition)
&& available_implies_empty(available) && is_mutator_partition(new_partition)),
- "Unexpected movement between partitions, available: " SIZE_FORMAT ", _region_size_bytes: " SIZE_FORMAT
+ "Unexpected movement between partitions, available: %zu, _region_size_bytes: %zu"
", orig_partition: %s, new_partition: %s",
available, _region_size_bytes, partition_name(orig_partition), partition_name(new_partition));
size_t used = _region_size_bytes - available;
assert (_used[int(orig_partition)] >= used,
- "Orig partition used: " SIZE_FORMAT " must exceed moved used: " SIZE_FORMAT " within region " SSIZE_FORMAT,
+ "Orig partition used: %zu must exceed moved used: %zu within region %zd",
_used[int(orig_partition)], used, idx);
_membership[int(orig_partition)].clear_bit(idx);
@@ -451,7 +451,7 @@ const char* ShenandoahRegionPartitions::partition_membership_name(idx_t idx) con
}
inline ShenandoahFreeSetPartitionId ShenandoahRegionPartitions::membership(idx_t idx) const {
- assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT, idx, _max);
+ assert (idx < _max, "index is sane: %zu < %zu", idx, _max);
ShenandoahFreeSetPartitionId result = ShenandoahFreeSetPartitionId::NotFree;
for (uint partition_id = 0; partition_id < UIntNumPartitions; partition_id++) {
if (_membership[partition_id].is_set(idx)) {
@@ -464,7 +464,7 @@ inline ShenandoahFreeSetPartitionId ShenandoahRegionPartitions::membership(idx_t
#ifdef ASSERT
inline bool ShenandoahRegionPartitions::partition_id_matches(idx_t idx, ShenandoahFreeSetPartitionId test_partition) const {
- assert (idx < _max, "index is sane: " SIZE_FORMAT " < " SIZE_FORMAT, idx, _max);
+ assert (idx < _max, "index is sane: %zu < %zu", idx, _max);
assert (test_partition < ShenandoahFreeSetPartitionId::NotFree, "must be a valid partition");
return membership(idx) == test_partition;
@@ -543,7 +543,7 @@ idx_t ShenandoahRegionPartitions::leftmost_empty(ShenandoahFreeSetPartitionId wh
}
for (idx_t idx = find_index_of_next_available_region(which_partition, _leftmosts_empty[int(which_partition)]);
idx < max_regions; ) {
- assert(in_free_set(which_partition, idx), "Boundaries or find_last_set_bit failed: " SSIZE_FORMAT, idx);
+ assert(in_free_set(which_partition, idx), "Boundaries or find_last_set_bit failed: %zd", idx);
if (_free_set->alloc_capacity(idx) == _region_size_bytes) {
_leftmosts_empty[int(which_partition)] = idx;
return idx;
@@ -562,7 +562,7 @@ idx_t ShenandoahRegionPartitions::rightmost_empty(ShenandoahFreeSetPartitionId w
}
for (idx_t idx = find_index_of_previous_available_region(which_partition, _rightmosts_empty[int(which_partition)]);
idx >= 0; ) {
- assert(in_free_set(which_partition, idx), "Boundaries or find_last_set_bit failed: " SSIZE_FORMAT, idx);
+ assert(in_free_set(which_partition, idx), "Boundaries or find_last_set_bit failed: %zd", idx);
if (_free_set->alloc_capacity(idx) == _region_size_bytes) {
_rightmosts_empty[int(which_partition)] = idx;
return idx;
@@ -625,103 +625,103 @@ void ShenandoahRegionPartitions::assert_bounds() {
// Performance invariants. Failing these would not break the free partition, but performance would suffer.
assert (leftmost(ShenandoahFreeSetPartitionId::Mutator) <= _max,
- "leftmost in bounds: " SSIZE_FORMAT " < " SSIZE_FORMAT, leftmost(ShenandoahFreeSetPartitionId::Mutator), _max);
+ "leftmost in bounds: %zd < %zd", leftmost(ShenandoahFreeSetPartitionId::Mutator), _max);
assert (rightmost(ShenandoahFreeSetPartitionId::Mutator) < _max,
- "rightmost in bounds: " SSIZE_FORMAT " < " SSIZE_FORMAT, rightmost(ShenandoahFreeSetPartitionId::Mutator), _max);
+ "rightmost in bounds: %zd < %zd", rightmost(ShenandoahFreeSetPartitionId::Mutator), _max);
assert (leftmost(ShenandoahFreeSetPartitionId::Mutator) == _max
|| partition_id_matches(leftmost(ShenandoahFreeSetPartitionId::Mutator), ShenandoahFreeSetPartitionId::Mutator),
- "leftmost region should be free: " SSIZE_FORMAT, leftmost(ShenandoahFreeSetPartitionId::Mutator));
+ "leftmost region should be free: %zd", leftmost(ShenandoahFreeSetPartitionId::Mutator));
assert (leftmost(ShenandoahFreeSetPartitionId::Mutator) == _max
|| partition_id_matches(rightmost(ShenandoahFreeSetPartitionId::Mutator), ShenandoahFreeSetPartitionId::Mutator),
- "rightmost region should be free: " SSIZE_FORMAT, rightmost(ShenandoahFreeSetPartitionId::Mutator));
+ "rightmost region should be free: %zd", rightmost(ShenandoahFreeSetPartitionId::Mutator));
// If Mutator partition is empty, leftmosts will both equal max, rightmosts will both equal zero.
// Likewise for empty region partitions.
idx_t beg_off = leftmosts[int(ShenandoahFreeSetPartitionId::Mutator)];
idx_t end_off = rightmosts[int(ShenandoahFreeSetPartitionId::Mutator)];
assert (beg_off >= leftmost(ShenandoahFreeSetPartitionId::Mutator),
- "free regions before the leftmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free regions before the leftmost: %zd, bound %zd",
beg_off, leftmost(ShenandoahFreeSetPartitionId::Mutator));
assert (end_off <= rightmost(ShenandoahFreeSetPartitionId::Mutator),
- "free regions past the rightmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free regions past the rightmost: %zd, bound %zd",
end_off, rightmost(ShenandoahFreeSetPartitionId::Mutator));
beg_off = empty_leftmosts[int(ShenandoahFreeSetPartitionId::Mutator)];
end_off = empty_rightmosts[int(ShenandoahFreeSetPartitionId::Mutator)];
assert (beg_off >= leftmost_empty(ShenandoahFreeSetPartitionId::Mutator),
- "free empty regions before the leftmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free empty regions before the leftmost: %zd, bound %zd",
beg_off, leftmost_empty(ShenandoahFreeSetPartitionId::Mutator));
assert (end_off <= rightmost_empty(ShenandoahFreeSetPartitionId::Mutator),
- "free empty regions past the rightmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free empty regions past the rightmost: %zd, bound %zd",
end_off, rightmost_empty(ShenandoahFreeSetPartitionId::Mutator));
// Performance invariants. Failing these would not break the free partition, but performance would suffer.
- assert (leftmost(ShenandoahFreeSetPartitionId::Collector) <= _max, "leftmost in bounds: " SSIZE_FORMAT " < " SSIZE_FORMAT,
+ assert (leftmost(ShenandoahFreeSetPartitionId::Collector) <= _max, "leftmost in bounds: %zd < %zd",
leftmost(ShenandoahFreeSetPartitionId::Collector), _max);
- assert (rightmost(ShenandoahFreeSetPartitionId::Collector) < _max, "rightmost in bounds: " SSIZE_FORMAT " < " SSIZE_FORMAT,
+ assert (rightmost(ShenandoahFreeSetPartitionId::Collector) < _max, "rightmost in bounds: %zd < %zd",
rightmost(ShenandoahFreeSetPartitionId::Collector), _max);
assert (leftmost(ShenandoahFreeSetPartitionId::Collector) == _max
|| partition_id_matches(leftmost(ShenandoahFreeSetPartitionId::Collector), ShenandoahFreeSetPartitionId::Collector),
- "leftmost region should be free: " SSIZE_FORMAT, leftmost(ShenandoahFreeSetPartitionId::Collector));
+ "leftmost region should be free: %zd", leftmost(ShenandoahFreeSetPartitionId::Collector));
assert (leftmost(ShenandoahFreeSetPartitionId::Collector) == _max
|| partition_id_matches(rightmost(ShenandoahFreeSetPartitionId::Collector), ShenandoahFreeSetPartitionId::Collector),
- "rightmost region should be free: " SSIZE_FORMAT, rightmost(ShenandoahFreeSetPartitionId::Collector));
+ "rightmost region should be free: %zd", rightmost(ShenandoahFreeSetPartitionId::Collector));
// If Collector partition is empty, leftmosts will both equal max, rightmosts will both equal zero.
// Likewise for empty region partitions.
beg_off = leftmosts[int(ShenandoahFreeSetPartitionId::Collector)];
end_off = rightmosts[int(ShenandoahFreeSetPartitionId::Collector)];
assert (beg_off >= leftmost(ShenandoahFreeSetPartitionId::Collector),
- "free regions before the leftmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free regions before the leftmost: %zd, bound %zd",
beg_off, leftmost(ShenandoahFreeSetPartitionId::Collector));
assert (end_off <= rightmost(ShenandoahFreeSetPartitionId::Collector),
- "free regions past the rightmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free regions past the rightmost: %zd, bound %zd",
end_off, rightmost(ShenandoahFreeSetPartitionId::Collector));
beg_off = empty_leftmosts[int(ShenandoahFreeSetPartitionId::Collector)];
end_off = empty_rightmosts[int(ShenandoahFreeSetPartitionId::Collector)];
assert (beg_off >= _leftmosts_empty[int(ShenandoahFreeSetPartitionId::Collector)],
- "free empty regions before the leftmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free empty regions before the leftmost: %zd, bound %zd",
beg_off, leftmost_empty(ShenandoahFreeSetPartitionId::Collector));
assert (end_off <= _rightmosts_empty[int(ShenandoahFreeSetPartitionId::Collector)],
- "free empty regions past the rightmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free empty regions past the rightmost: %zd, bound %zd",
end_off, rightmost_empty(ShenandoahFreeSetPartitionId::Collector));
// Performance invariants. Failing these would not break the free partition, but performance would suffer.
- assert (leftmost(ShenandoahFreeSetPartitionId::OldCollector) <= _max, "leftmost in bounds: " SSIZE_FORMAT " < " SSIZE_FORMAT,
+ assert (leftmost(ShenandoahFreeSetPartitionId::OldCollector) <= _max, "leftmost in bounds: %zd < %zd",
leftmost(ShenandoahFreeSetPartitionId::OldCollector), _max);
- assert (rightmost(ShenandoahFreeSetPartitionId::OldCollector) < _max, "rightmost in bounds: " SSIZE_FORMAT " < " SSIZE_FORMAT,
+ assert (rightmost(ShenandoahFreeSetPartitionId::OldCollector) < _max, "rightmost in bounds: %zd < %zd",
rightmost(ShenandoahFreeSetPartitionId::OldCollector), _max);
assert (leftmost(ShenandoahFreeSetPartitionId::OldCollector) == _max
|| partition_id_matches(leftmost(ShenandoahFreeSetPartitionId::OldCollector),
ShenandoahFreeSetPartitionId::OldCollector),
- "leftmost region should be free: " SSIZE_FORMAT, leftmost(ShenandoahFreeSetPartitionId::OldCollector));
+ "leftmost region should be free: %zd", leftmost(ShenandoahFreeSetPartitionId::OldCollector));
assert (leftmost(ShenandoahFreeSetPartitionId::OldCollector) == _max
|| partition_id_matches(rightmost(ShenandoahFreeSetPartitionId::OldCollector),
ShenandoahFreeSetPartitionId::OldCollector),
- "rightmost region should be free: " SSIZE_FORMAT, rightmost(ShenandoahFreeSetPartitionId::OldCollector));
+ "rightmost region should be free: %zd", rightmost(ShenandoahFreeSetPartitionId::OldCollector));
// If OldCollector partition is empty, leftmosts will both equal max, rightmosts will both equal zero.
// Likewise for empty region partitions.
beg_off = leftmosts[int(ShenandoahFreeSetPartitionId::OldCollector)];
end_off = rightmosts[int(ShenandoahFreeSetPartitionId::OldCollector)];
assert (beg_off >= leftmost(ShenandoahFreeSetPartitionId::OldCollector),
- "free regions before the leftmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free regions before the leftmost: %zd, bound %zd",
beg_off, leftmost(ShenandoahFreeSetPartitionId::OldCollector));
assert (end_off <= rightmost(ShenandoahFreeSetPartitionId::OldCollector),
- "free regions past the rightmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free regions past the rightmost: %zd, bound %zd",
end_off, rightmost(ShenandoahFreeSetPartitionId::OldCollector));
beg_off = empty_leftmosts[int(ShenandoahFreeSetPartitionId::OldCollector)];
end_off = empty_rightmosts[int(ShenandoahFreeSetPartitionId::OldCollector)];
assert (beg_off >= _leftmosts_empty[int(ShenandoahFreeSetPartitionId::OldCollector)],
- "free empty regions before the leftmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free empty regions before the leftmost: %zd, bound %zd",
beg_off, leftmost_empty(ShenandoahFreeSetPartitionId::OldCollector));
assert (end_off <= _rightmosts_empty[int(ShenandoahFreeSetPartitionId::OldCollector)],
- "free empty regions past the rightmost: " SSIZE_FORMAT ", bound " SSIZE_FORMAT,
+ "free empty regions past the rightmost: %zd, bound %zd",
end_off, rightmost_empty(ShenandoahFreeSetPartitionId::OldCollector));
}
#endif
@@ -937,7 +937,7 @@ HeapWord* ShenandoahFreeSet::try_allocate_from_mutator(ShenandoahAllocRequest& r
}
// Region r is entirely empty. If try_allocate_in fails on region r, something else is really wrong.
// Don't bother to retry with other regions.
- log_debug(gc, free)("Flipped region " SIZE_FORMAT " to gc for request: " PTR_FORMAT, idx, p2i(&req));
+ log_debug(gc, free)("Flipped region %zu to gc for request: " PTR_FORMAT, idx, p2i(&req));
return try_allocate_in(r, req, in_new_region);
}
}
@@ -996,8 +996,10 @@ HeapWord* ShenandoahFreeSet::allocate_aligned_plab(size_t size, ShenandoahAllocR
}
HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, ShenandoahAllocRequest& req, bool& in_new_region) {
- assert (has_alloc_capacity(r), "Performance: should avoid full regions on this path: " SIZE_FORMAT, r->index());
+ assert (has_alloc_capacity(r), "Performance: should avoid full regions on this path: %zu", r->index());
if (_heap->is_concurrent_weak_root_in_progress() && r->is_trash()) {
+ // We cannot use this region for allocation when weak roots are in progress because the collector may need
+ // to reference unmarked oops during concurrent classunloading.
return nullptr;
}
HeapWord* result = nullptr;
@@ -1005,9 +1007,10 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah
in_new_region = r->is_empty();
if (in_new_region) {
- log_debug(gc)("Using new region (" SIZE_FORMAT ") for %s (" PTR_FORMAT ").",
- r->index(), ShenandoahAllocRequest::alloc_type_to_string(req.type()), p2i(&req));
- assert(!r->is_affiliated(), "New region " SIZE_FORMAT " should be unaffiliated", r->index());
+ log_debug(gc, free)("Using new region (%zu) for %s (" PTR_FORMAT ").",
+ r->index(), ShenandoahAllocRequest::alloc_type_to_string(req.type()), p2i(&req));
+ assert(!r->is_affiliated(), "New region %zu should be unaffiliated", r->index());
+
r->set_affiliation(req.affiliation());
if (r->is_old()) {
// Any OLD region allocated during concurrent coalesce-and-fill does not need to be coalesced and filled because
@@ -1026,10 +1029,10 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah
assert(ctx->top_at_mark_start(r) == r->bottom(), "Newly established allocation region starts with TAMS equal to bottom");
assert(ctx->is_bitmap_range_within_region_clear(ctx->top_bitmap(r), r->end()), "Bitmap above top_bitmap() must be clear");
#endif
- log_debug(gc)("Using new region (" SIZE_FORMAT ") for %s (" PTR_FORMAT ").",
- r->index(), ShenandoahAllocRequest::alloc_type_to_string(req.type()), p2i(&req));
+ log_debug(gc, free)("Using new region (%zu) for %s (" PTR_FORMAT ").",
+ r->index(), ShenandoahAllocRequest::alloc_type_to_string(req.type()), p2i(&req));
} else {
- assert(r->is_affiliated(), "Region " SIZE_FORMAT " that is not new should be affiliated", r->index());
+ assert(r->is_affiliated(), "Region %zu that is not new should be affiliated", r->index());
if (r->affiliation() != req.affiliation()) {
assert(_heap->mode()->is_generational(), "Request for %s from %s region should only happen in generational mode.",
req.affiliation_name(), r->affiliation_name());
@@ -1060,8 +1063,8 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah
req.set_actual_size(adjusted_size);
} else {
// Otherwise, leave result == nullptr because the adjusted size is smaller than min size.
- log_trace(gc, free)("Failed to shrink PLAB request (" SIZE_FORMAT ") in region " SIZE_FORMAT " to " SIZE_FORMAT
- " because min_size() is " SIZE_FORMAT, req.size(), r->index(), adjusted_size, req.min_size());
+ log_trace(gc, free)("Failed to shrink PLAB request (%zu) in region %zu to %zu"
+ " because min_size() is %zu", req.size(), r->index(), adjusted_size, req.min_size());
}
} else {
// This is a GCLAB or a TLAB allocation
@@ -1072,11 +1075,11 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah
}
if (adjusted_size >= req.min_size()) {
result = r->allocate(adjusted_size, req);
- assert (result != nullptr, "Allocation must succeed: free " SIZE_FORMAT ", actual " SIZE_FORMAT, free, adjusted_size);
+ assert (result != nullptr, "Allocation must succeed: free %zu, actual %zu", free, adjusted_size);
req.set_actual_size(adjusted_size);
} else {
- log_trace(gc, free)("Failed to shrink TLAB or GCLAB request (" SIZE_FORMAT ") in region " SIZE_FORMAT " to " SIZE_FORMAT
- " because min_size() is " SIZE_FORMAT, req.size(), r->index(), adjusted_size, req.min_size());
+ log_trace(gc, free)("Failed to shrink TLAB or GCLAB request (%zu) in region %zu to %zu"
+ " because min_size() is %zu", req.size(), r->index(), adjusted_size, req.min_size());
}
}
} else {
@@ -1292,7 +1295,7 @@ void ShenandoahFreeSet::flip_to_old_gc(ShenandoahHeapRegion* r) {
_heap->old_generation()->augment_evacuation_reserve(region_capacity);
bool transferred = gen_heap->generation_sizer()->transfer_to_old(1);
if (!transferred) {
- log_warning(gc, free)("Forcing transfer of " SIZE_FORMAT " to old reserve.", idx);
+ log_warning(gc, free)("Forcing transfer of %zu to old reserve.", idx);
gen_heap->generation_sizer()->force_transfer_to_old(1);
}
// We do not ensure that the region is no longer trash, relying on try_allocate_in(), which always comes next,
@@ -1424,23 +1427,24 @@ void ShenandoahFreeSet::find_regions_with_alloc_capacity(size_t &young_cset_regi
}
}
}
- log_debug(gc)(" At end of prep_to_rebuild, mutator_leftmost: " SIZE_FORMAT
- ", mutator_rightmost: " SIZE_FORMAT
- ", mutator_leftmost_empty: " SIZE_FORMAT
- ", mutator_rightmost_empty: " SIZE_FORMAT
- ", mutator_regions: " SIZE_FORMAT
- ", mutator_used: " SIZE_FORMAT,
- mutator_leftmost, mutator_rightmost, mutator_leftmost_empty, mutator_rightmost_empty,
- mutator_regions, mutator_used);
-
- log_debug(gc)(" old_collector_leftmost: " SIZE_FORMAT
- ", old_collector_rightmost: " SIZE_FORMAT
- ", old_collector_leftmost_empty: " SIZE_FORMAT
- ", old_collector_rightmost_empty: " SIZE_FORMAT
- ", old_collector_regions: " SIZE_FORMAT
- ", old_collector_used: " SIZE_FORMAT,
- old_collector_leftmost, old_collector_rightmost, old_collector_leftmost_empty, old_collector_rightmost_empty,
- old_collector_regions, old_collector_used);
+ log_debug(gc, free)(" At end of prep_to_rebuild, mutator_leftmost: %zu"
+ ", mutator_rightmost: %zu"
+ ", mutator_leftmost_empty: %zu"
+ ", mutator_rightmost_empty: %zu"
+ ", mutator_regions: %zu"
+ ", mutator_used: %zu",
+ mutator_leftmost, mutator_rightmost, mutator_leftmost_empty, mutator_rightmost_empty,
+ mutator_regions, mutator_used);
+
+ log_debug(gc, free)(" old_collector_leftmost: %zu"
+ ", old_collector_rightmost: %zu"
+ ", old_collector_leftmost_empty: %zu"
+ ", old_collector_rightmost_empty: %zu"
+ ", old_collector_regions: %zu"
+ ", old_collector_used: %zu",
+ old_collector_leftmost, old_collector_rightmost, old_collector_leftmost_empty, old_collector_rightmost_empty,
+ old_collector_regions, old_collector_used);
+
idx_t rightmost_idx = (mutator_leftmost == max_regions)? -1: (idx_t) mutator_rightmost;
idx_t rightmost_empty_idx = (mutator_leftmost_empty == max_regions)? -1: (idx_t) mutator_rightmost_empty;
@@ -1450,12 +1454,12 @@ void ShenandoahFreeSet::find_regions_with_alloc_capacity(size_t &young_cset_regi
rightmost_empty_idx = (old_collector_leftmost_empty == max_regions)? -1: (idx_t) old_collector_rightmost_empty;
_partitions.establish_old_collector_intervals(old_collector_leftmost, rightmost_idx, old_collector_leftmost_empty,
rightmost_empty_idx, old_collector_regions, old_collector_used);
- log_debug(gc)(" After find_regions_with_alloc_capacity(), Mutator range [" SSIZE_FORMAT ", " SSIZE_FORMAT "],"
- " Old Collector range [" SSIZE_FORMAT ", " SSIZE_FORMAT "]",
- _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector));
+ log_debug(gc, free)(" After find_regions_with_alloc_capacity(), Mutator range [%zd, %zd],"
+ " Old Collector range [%zd, %zd]",
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector));
}
// Returns number of regions transferred, adds transferred bytes to var argument bytes_transferred
@@ -1466,7 +1470,6 @@ size_t ShenandoahFreeSet::transfer_empty_regions_from_collector_set_to_mutator_s
const size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes();
size_t transferred_regions = 0;
ShenandoahLeftRightIterator iterator(&_partitions, which_collector, true);
- idx_t rightmost = _partitions.rightmost_empty(which_collector);
for (idx_t idx = iterator.current(); transferred_regions < max_xfer_regions && iterator.has_next(); idx = iterator.next()) {
// Note: can_allocate_from() denotes that region is entirely empty
if (can_allocate_from(idx)) {
@@ -1534,8 +1537,8 @@ void ShenandoahFreeSet::move_regions_from_collector_to_mutator(size_t max_xfer_r
}
size_t total_xfer = collector_xfer + old_collector_xfer;
- log_info(gc, ergo)("At start of update refs, moving " SIZE_FORMAT "%s to Mutator free set from Collector Reserve ("
- SIZE_FORMAT "%s) and from Old Collector Reserve (" SIZE_FORMAT "%s)",
+ log_info(gc, ergo)("At start of update refs, moving %zu%s to Mutator free set from Collector Reserve ("
+ "%zu%s) and from Old Collector Reserve (%zu%s)",
byte_size_in_proper_unit(total_xfer), proper_unit_for_byte_size(total_xfer),
byte_size_in_proper_unit(collector_xfer), proper_unit_for_byte_size(collector_xfer),
byte_size_in_proper_unit(old_collector_xfer), proper_unit_for_byte_size(old_collector_xfer));
@@ -1571,11 +1574,11 @@ void ShenandoahFreeSet::establish_generation_sizes(size_t young_region_count, si
if (new_old_capacity > original_old_capacity) {
size_t region_count = (new_old_capacity - original_old_capacity) / region_size_bytes;
- log_info(gc, ergo)("Transfer " SIZE_FORMAT " region(s) from %s to %s, yielding increased size: " PROPERFMT,
+ log_info(gc, ergo)("Transfer %zu region(s) from %s to %s, yielding increased size: " PROPERFMT,
region_count, young_gen->name(), old_gen->name(), PROPERFMTARGS(new_old_capacity));
} else if (new_old_capacity < original_old_capacity) {
size_t region_count = (original_old_capacity - new_old_capacity) / region_size_bytes;
- log_info(gc, ergo)("Transfer " SIZE_FORMAT " region(s) from %s to %s, yielding increased size: " PROPERFMT,
+ log_info(gc, ergo)("Transfer %zu region(s) from %s to %s, yielding increased size: " PROPERFMT,
region_count, old_gen->name(), young_gen->name(), PROPERFMTARGS(new_young_capacity));
}
// This balances generations, so clear any pending request to balance.
@@ -1653,7 +1656,7 @@ void ShenandoahFreeSet::compute_young_and_old_reserves(size_t young_cset_regions
young_reserve_result = young_generation->get_evacuation_reserve();
old_reserve_result = promoted_reserve + old_evac_reserve;
assert(old_reserve_result <= old_available,
- "Cannot reserve (" SIZE_FORMAT " + " SIZE_FORMAT") more OLD than is available: " SIZE_FORMAT,
+ "Cannot reserve (%zu + %zu) more OLD than is available: %zu",
promoted_reserve, old_evac_reserve, old_available);
} else {
// We are rebuilding at end of GC, so we set aside budgets specified on command line (or defaults)
@@ -1712,13 +1715,14 @@ void ShenandoahFreeSet::reserve_regions(size_t to_reserve, size_t to_reserve_old
// OLD regions that have available memory are already in the old_collector free set.
_partitions.move_from_partition_to_partition(idx, ShenandoahFreeSetPartitionId::Mutator,
ShenandoahFreeSetPartitionId::OldCollector, ac);
- log_debug(gc)(" Shifting region " SIZE_FORMAT " from mutator_free to old_collector_free", idx);
- log_debug(gc)(" Shifted Mutator range [" SSIZE_FORMAT ", " SSIZE_FORMAT "],"
- " Old Collector range [" SSIZE_FORMAT ", " SSIZE_FORMAT "]",
- _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector));
+ log_trace(gc, free)(" Shifting region %zu from mutator_free to old_collector_free", idx);
+ log_trace(gc, free)(" Shifted Mutator range [%zd, %zd],"
+ " Old Collector range [%zd, %zd]",
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector));
+
old_region_count++;
continue;
}
@@ -1735,13 +1739,14 @@ void ShenandoahFreeSet::reserve_regions(size_t to_reserve, size_t to_reserve_old
// collection set, and they are easily evacuated because they have low density of live objects.
_partitions.move_from_partition_to_partition(idx, ShenandoahFreeSetPartitionId::Mutator,
ShenandoahFreeSetPartitionId::Collector, ac);
- log_debug(gc)(" Shifting region " SIZE_FORMAT " from mutator_free to collector_free", idx);
- log_debug(gc)(" Shifted Mutator range [" SSIZE_FORMAT ", " SSIZE_FORMAT "],"
- " Collector range [" SSIZE_FORMAT ", " SSIZE_FORMAT "]",
- _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.leftmost(ShenandoahFreeSetPartitionId::Collector),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::Collector));
+ log_trace(gc, free)(" Shifting region %zu from mutator_free to collector_free", idx);
+ log_trace(gc, free)(" Shifted Mutator range [%zd, %zd],"
+ " Collector range [%zd, %zd]",
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::Collector),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::Collector));
+
}
}
@@ -1753,8 +1758,8 @@ void ShenandoahFreeSet::reserve_regions(size_t to_reserve, size_t to_reserve_old
}
size_t reserve = _partitions.available_in(ShenandoahFreeSetPartitionId::Collector);
if (reserve < to_reserve) {
- log_debug(gc)("Wanted " PROPERFMT " for young reserve, but only reserved: " PROPERFMT,
- PROPERFMTARGS(to_reserve), PROPERFMTARGS(reserve));
+ log_info(gc, free)("Wanted " PROPERFMT " for young reserve, but only reserved: " PROPERFMT,
+ PROPERFMTARGS(to_reserve), PROPERFMTARGS(reserve));
}
}
}
@@ -1805,34 +1810,42 @@ void ShenandoahFreeSet::log_status() {
#ifdef ASSERT
// Dump of the FreeSet details is only enabled if assertions are enabled
- if (LogTarget(Debug, gc, free)::is_enabled()) {
+ LogTarget(Debug, gc, free) debug_free;
+ if (debug_free.is_enabled()) {
#define BUFFER_SIZE 80
+ LogStream ls(debug_free);
char buffer[BUFFER_SIZE];
for (uint i = 0; i < BUFFER_SIZE; i++) {
buffer[i] = '\0';
}
- log_debug(gc)("FreeSet map legend:"
- " M:mutator_free C:collector_free O:old_collector_free"
- " H:humongous ~:retired old _:retired young");
- log_debug(gc)(" mutator free range [" SIZE_FORMAT ".." SIZE_FORMAT "] allocating from %s, "
- " collector free range [" SIZE_FORMAT ".." SIZE_FORMAT "], "
- "old collector free range [" SIZE_FORMAT ".." SIZE_FORMAT "] allocates from %s",
- _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
- _partitions.alloc_from_left_bias(ShenandoahFreeSetPartitionId::Mutator)? "left to right": "right to left",
- _partitions.leftmost(ShenandoahFreeSetPartitionId::Collector),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::Collector),
- _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector),
- _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector),
- _partitions.alloc_from_left_bias(ShenandoahFreeSetPartitionId::OldCollector)? "left to right": "right to left");
+
+ ls.cr();
+ ls.print_cr("Mutator free range [%zd..%zd] allocating from %s",
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::Mutator),
+ _partitions.alloc_from_left_bias(ShenandoahFreeSetPartitionId::Mutator)? "left to right": "right to left");
+
+ ls.print_cr("Collector free range [%zd..%zd] allocating from %s",
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::Collector),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::Collector),
+ _partitions.alloc_from_left_bias(ShenandoahFreeSetPartitionId::Collector)? "left to right": "right to left");
+
+ ls.print_cr("Old collector free range [%zd..%zd] allocates from %s",
+ _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector),
+ _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector),
+ _partitions.alloc_from_left_bias(ShenandoahFreeSetPartitionId::OldCollector)? "left to right": "right to left");
+ ls.cr();
+ ls.print_cr("FreeSet map legend:");
+ ls.print_cr(" M/m:mutator, C/c:collector O/o:old_collector (Empty/Occupied)");
+ ls.print_cr(" H/h:humongous, X/x:no alloc capacity, ~/_:retired (Old/Young)");
for (uint i = 0; i < _heap->num_regions(); i++) {
ShenandoahHeapRegion *r = _heap->get_region(i);
uint idx = i % 64;
if ((i != 0) && (idx == 0)) {
- log_debug(gc)(" %6u: %s", i-64, buffer);
+ ls.print_cr(" %6u: %s", i-64, buffer);
}
if (_partitions.in_free_set(ShenandoahFreeSetPartitionId::Mutator, i)) {
size_t capacity = alloc_capacity(r);
@@ -1846,17 +1859,11 @@ void ShenandoahFreeSet::log_status() {
size_t capacity = alloc_capacity(r);
buffer[idx] = (capacity == ShenandoahHeapRegion::region_size_bytes()) ? 'O' : 'o';
} else if (r->is_humongous()) {
- if (r->is_old()) {
- buffer[idx] = 'H';
- } else {
- buffer[idx] = 'h';
- }
+ buffer[idx] = (r->is_old() ? 'H' : 'h');
+ } else if (alloc_capacity(r) == 0) {
+ buffer[idx] = (r->is_old() ? 'X' : 'x');
} else {
- if (r->is_old()) {
- buffer[idx] = '~';
- } else {
- buffer[idx] = '_';
- }
+ buffer[idx] = (r->is_old() ? '~' : '_');
}
}
uint remnant = _heap->num_regions() % 64;
@@ -1865,7 +1872,7 @@ void ShenandoahFreeSet::log_status() {
} else {
remnant = 64;
}
- log_debug(gc)(" %6u: %s", (uint) (_heap->num_regions() - remnant), buffer);
+ ls.print_cr(" %6u: %s", (uint) (_heap->num_regions() - remnant), buffer);
}
#endif
@@ -1914,7 +1921,7 @@ void ShenandoahFreeSet::log_status() {
// retired, the sum of used and capacities within regions that are still in the Mutator free partition may not match
// my internally tracked values of used() and free().
assert(free == total_free, "Free memory should match");
- ls.print("Free: " SIZE_FORMAT "%s, Max: " SIZE_FORMAT "%s regular, " SIZE_FORMAT "%s humongous, ",
+ ls.print("Free: %zu%s, Max: %zu%s regular, %zu%s humongous, ",
byte_size_in_proper_unit(total_free), proper_unit_for_byte_size(total_free),
byte_size_in_proper_unit(max), proper_unit_for_byte_size(max),
byte_size_in_proper_unit(max_humongous), proper_unit_for_byte_size(max_humongous)
@@ -1927,7 +1934,7 @@ void ShenandoahFreeSet::log_status() {
} else {
frag_ext = 0;
}
- ls.print(SIZE_FORMAT "%% external, ", frag_ext);
+ ls.print("%zu%% external, ", frag_ext);
size_t frag_int;
if (_partitions.count(ShenandoahFreeSetPartitionId::Mutator) > 0) {
@@ -1936,8 +1943,8 @@ void ShenandoahFreeSet::log_status() {
} else {
frag_int = 0;
}
- ls.print(SIZE_FORMAT "%% internal; ", frag_int);
- ls.print("Used: " SIZE_FORMAT "%s, Mutator Free: " SIZE_FORMAT,
+ ls.print("%zu%% internal; ", frag_int);
+ ls.print("Used: %zu%s, Mutator Free: %zu",
byte_size_in_proper_unit(total_used), proper_unit_for_byte_size(total_used),
_partitions.count(ShenandoahFreeSetPartitionId::Mutator));
}
@@ -1957,7 +1964,7 @@ void ShenandoahFreeSet::log_status() {
total_used += r->used();
}
}
- ls.print(" Collector Reserve: " SIZE_FORMAT "%s, Max: " SIZE_FORMAT "%s; Used: " SIZE_FORMAT "%s",
+ ls.print(" Collector Reserve: %zu%s, Max: %zu%s; Used: %zu%s",
byte_size_in_proper_unit(total_free), proper_unit_for_byte_size(total_free),
byte_size_in_proper_unit(max), proper_unit_for_byte_size(max),
byte_size_in_proper_unit(total_used), proper_unit_for_byte_size(total_used));
@@ -1978,7 +1985,7 @@ void ShenandoahFreeSet::log_status() {
total_used += r->used();
}
}
- ls.print_cr(" Old Collector Reserve: " SIZE_FORMAT "%s, Max: " SIZE_FORMAT "%s; Used: " SIZE_FORMAT "%s",
+ ls.print_cr(" Old Collector Reserve: %zu%s, Max: %zu%s; Used: %zu%s",
byte_size_in_proper_unit(total_free), proper_unit_for_byte_size(total_free),
byte_size_in_proper_unit(max), proper_unit_for_byte_size(max),
byte_size_in_proper_unit(total_used), proper_unit_for_byte_size(total_used));
@@ -1998,7 +2005,7 @@ HeapWord* ShenandoahFreeSet::allocate(ShenandoahAllocRequest& req, bool& in_new_
case ShenandoahAllocRequest::_alloc_gclab:
case ShenandoahAllocRequest::_alloc_tlab:
in_new_region = false;
- assert(false, "Trying to allocate TLAB in humongous region: " SIZE_FORMAT, req.size());
+ assert(false, "Trying to allocate TLAB in humongous region: %zu", req.size());
return nullptr;
default:
ShouldNotReachHere();
@@ -2010,20 +2017,20 @@ HeapWord* ShenandoahFreeSet::allocate(ShenandoahAllocRequest& req, bool& in_new_
}
void ShenandoahFreeSet::print_on(outputStream* out) const {
- out->print_cr("Mutator Free Set: " SIZE_FORMAT "", _partitions.count(ShenandoahFreeSetPartitionId::Mutator));
+ out->print_cr("Mutator Free Set: %zu", _partitions.count(ShenandoahFreeSetPartitionId::Mutator));
ShenandoahLeftRightIterator mutator(const_cast(&_partitions), ShenandoahFreeSetPartitionId::Mutator);
for (idx_t index = mutator.current(); mutator.has_next(); index = mutator.next()) {
_heap->get_region(index)->print_on(out);
}
- out->print_cr("Collector Free Set: " SIZE_FORMAT "", _partitions.count(ShenandoahFreeSetPartitionId::Collector));
+ out->print_cr("Collector Free Set: %zu", _partitions.count(ShenandoahFreeSetPartitionId::Collector));
ShenandoahLeftRightIterator collector(const_cast(&_partitions), ShenandoahFreeSetPartitionId::Collector);
for (idx_t index = collector.current(); collector.has_next(); index = collector.next()) {
_heap->get_region(index)->print_on(out);
}
if (_heap->mode()->is_generational()) {
- out->print_cr("Old Collector Free Set: " SIZE_FORMAT "", _partitions.count(ShenandoahFreeSetPartitionId::OldCollector));
+ out->print_cr("Old Collector Free Set: %zu", _partitions.count(ShenandoahFreeSetPartitionId::OldCollector));
for (idx_t index = _partitions.leftmost(ShenandoahFreeSetPartitionId::OldCollector);
index <= _partitions.rightmost(ShenandoahFreeSetPartitionId::OldCollector); index++) {
if (_partitions.in_free_set(ShenandoahFreeSetPartitionId::OldCollector, index)) {
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp
index 2847d7c78ba18..c83de047e976c 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2014, 2021, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/continuationGCSupport.hpp"
@@ -501,7 +501,7 @@ void ShenandoahFullGC::calculate_target_humongous_objects() {
size_t to_begin = heap->num_regions();
size_t to_end = heap->num_regions();
- log_debug(gc)("Full GC calculating target humongous objects from end " SIZE_FORMAT, to_end);
+ log_debug(gc)("Full GC calculating target humongous objects from end %zu", to_end);
for (size_t c = heap->num_regions(); c > 0; c--) {
ShenandoahHeapRegion *r = heap->get_region(c - 1);
if (r->is_humongous_continuation() || (r->new_top() == r->bottom())) {
@@ -550,7 +550,7 @@ class ShenandoahEnsureHeapActiveClosure: public ShenandoahHeapRegionClosure {
if (r->is_empty_uncommitted()) {
r->make_committed_bypass();
}
- assert (r->is_committed(), "only committed regions in heap now, see region " SIZE_FORMAT, r->index());
+ assert (r->is_committed(), "only committed regions in heap now, see region %zu", r->index());
// Record current region occupancy: this communicates empty regions are free
// to the rest of Full GC code.
@@ -572,14 +572,14 @@ class ShenandoahTrashImmediateGarbageClosure: public ShenandoahHeapRegionClosure
if (r->is_humongous_start()) {
oop humongous_obj = cast_to_oop(r->bottom());
if (!_ctx->is_marked(humongous_obj)) {
- assert(!r->has_live(), "Region " SIZE_FORMAT " is not marked, should not have live", r->index());
+ assert(!r->has_live(), "Region %zu is not marked, should not have live", r->index());
_heap->trash_humongous_region_at(r);
} else {
- assert(r->has_live(), "Region " SIZE_FORMAT " should have live", r->index());
+ assert(r->has_live(), "Region %zu should have live", r->index());
}
} else if (r->is_humongous_continuation()) {
// If we hit continuation, the non-live humongous starts should have been trashed already
- assert(r->humongous_start_region()->has_live(), "Region " SIZE_FORMAT " should have live", r->index());
+ assert(r->humongous_start_region()->has_live(), "Region %zu should have live", r->index());
} else if (r->is_regular()) {
if (!r->has_live()) {
r->make_trash_immediate();
@@ -715,8 +715,8 @@ void ShenandoahFullGC::distribute_slices(ShenandoahHeapRegionSet** worker_slices
ShenandoahHeapRegion* r = it.next();
while (r != nullptr) {
size_t idx = r->index();
- assert(ShenandoahPrepareForCompactionTask::is_candidate_region(r), "Sanity: " SIZE_FORMAT, idx);
- assert(!map.at(idx), "No region distributed twice: " SIZE_FORMAT, idx);
+ assert(ShenandoahPrepareForCompactionTask::is_candidate_region(r), "Sanity: %zu", idx);
+ assert(!map.at(idx), "No region distributed twice: %zu", idx);
map.at_put(idx, true);
r = it.next();
}
@@ -725,7 +725,7 @@ void ShenandoahFullGC::distribute_slices(ShenandoahHeapRegionSet** worker_slices
for (size_t rid = 0; rid < n_regions; rid++) {
bool is_candidate = ShenandoahPrepareForCompactionTask::is_candidate_region(heap->get_region(rid));
bool is_distributed = map.at(rid);
- assert(is_distributed || !is_candidate, "All candidates are distributed: " SIZE_FORMAT, rid);
+ assert(is_distributed || !is_candidate, "All candidates are distributed: %zu", rid);
}
#endif
}
@@ -1045,9 +1045,9 @@ void ShenandoahFullGC::compact_humongous_objects() {
size_t new_start = heap->heap_region_index_containing(FullGCForwarding::forwardee(old_obj));
size_t new_end = new_start + num_regions - 1;
assert(old_start != new_start, "must be real move");
- assert(r->is_stw_move_allowed(), "Region " SIZE_FORMAT " should be movable", r->index());
+ assert(r->is_stw_move_allowed(), "Region %zu should be movable", r->index());
- log_debug(gc)("Full GC compaction moves humongous object from region " SIZE_FORMAT " to region " SIZE_FORMAT, old_start, new_start);
+ log_debug(gc)("Full GC compaction moves humongous object from region %zu to region %zu", old_start, new_start);
Copy::aligned_conjoint_words(r->bottom(), heap->get_region(new_start)->bottom(), words_size);
ContinuationGCSupport::relativize_stack_chunk(cast_to_oop(r->bottom()));
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp
index 99ee88d98d126..5a1e8b67694d7 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGC.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/workerThread.hpp"
@@ -45,7 +44,7 @@ const char* ShenandoahGC::degen_point_to_string(ShenandoahDegenPoint point) {
return "Mark";
case _degenerated_evac:
return "Evacuation";
- case _degenerated_updaterefs:
+ case _degenerated_update_refs:
return "Update References";
default:
ShouldNotReachHere();
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGC.hpp b/src/hotspot/share/gc/shenandoah/shenandoahGC.hpp
index 37b228489177c..f10d5eef969da 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGC.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGC.hpp
@@ -53,7 +53,7 @@ class ShenandoahGC : public StackObj {
_degenerated_roots,
_degenerated_mark,
_degenerated_evac,
- _degenerated_updaterefs,
+ _degenerated_update_refs,
_DEGENERATED_LIMIT
};
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
index c72940c3c3a75..d00d5168ee7c3 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahCollectionSetPreselector.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
@@ -419,7 +419,7 @@ void ShenandoahGeneration::adjust_evacuation_budgets(ShenandoahHeap* const heap,
if (old_evacuated_committed > old_evacuation_reserve) {
// This should only happen due to round-off errors when enforcing ShenandoahOldEvacWaste
assert(old_evacuated_committed <= (33 * old_evacuation_reserve) / 32,
- "Round-off errors should be less than 3.125%%, committed: " SIZE_FORMAT ", reserved: " SIZE_FORMAT,
+ "Round-off errors should be less than 3.125%%, committed: %zu, reserved: %zu",
old_evacuated_committed, old_evacuation_reserve);
old_evacuated_committed = old_evacuation_reserve;
// Leave old_evac_reserve as previously configured
@@ -449,13 +449,13 @@ void ShenandoahGeneration::adjust_evacuation_budgets(ShenandoahHeap* const heap,
// This can happen due to round-off errors when adding the results of truncated integer arithmetic.
// We've already truncated old_evacuated_committed. Truncate young_advance_promoted_reserve_used here.
assert(young_advance_promoted_reserve_used <= (33 * (old_available - old_evacuated_committed)) / 32,
- "Round-off errors should be less than 3.125%%, committed: " SIZE_FORMAT ", reserved: " SIZE_FORMAT,
+ "Round-off errors should be less than 3.125%%, committed: %zu, reserved: %zu",
young_advance_promoted_reserve_used, old_available - old_evacuated_committed);
young_advance_promoted_reserve_used = old_available - old_evacuated_committed;
old_consumed = old_evacuated_committed + young_advance_promoted_reserve_used;
}
- assert(old_available >= old_consumed, "Cannot consume (" SIZE_FORMAT ") more than is available (" SIZE_FORMAT ")",
+ assert(old_available >= old_consumed, "Cannot consume (%zu) more than is available (%zu)",
old_consumed, old_available);
size_t excess_old = old_available - old_consumed;
size_t unaffiliated_old_regions = old_generation->free_unaffiliated_regions();
@@ -494,10 +494,10 @@ void ShenandoahGeneration::adjust_evacuation_budgets(ShenandoahHeap* const heap,
if (regions_to_xfer > 0) {
bool result = ShenandoahGenerationalHeap::cast(heap)->generation_sizer()->transfer_to_young(regions_to_xfer);
assert(excess_old >= regions_to_xfer * region_size_bytes,
- "Cannot transfer (" SIZE_FORMAT ", " SIZE_FORMAT ") more than excess old (" SIZE_FORMAT ")",
+ "Cannot transfer (%zu, %zu) more than excess old (%zu)",
regions_to_xfer, region_size_bytes, excess_old);
excess_old -= regions_to_xfer * region_size_bytes;
- log_debug(gc, ergo)("%s transferred " SIZE_FORMAT " excess regions to young before start of evacuation",
+ log_debug(gc, ergo)("%s transferred %zu excess regions to young before start of evacuation",
result? "Successfully": "Unsuccessfully", regions_to_xfer);
}
@@ -527,7 +527,7 @@ inline void assert_no_in_place_promotions() {
public:
void heap_region_do(ShenandoahHeapRegion *r) override {
assert(r->get_top_before_promote() == nullptr,
- "Region " SIZE_FORMAT " should not be ready for in-place promotion", r->index());
+ "Region %zu should not be ready for in-place promotion", r->index());
}
} cl;
ShenandoahHeap::heap()->heap_region_iterate(&cl);
@@ -671,8 +671,8 @@ size_t ShenandoahGeneration::select_aged_regions(size_t old_available) {
// We keep going even if one region is excluded from selection because we need to accumulate all eligible
// regions that are not preselected into promo_potential
}
- log_debug(gc)("Preselected " SIZE_FORMAT " regions containing " SIZE_FORMAT " live bytes,"
- " consuming: " SIZE_FORMAT " of budgeted: " SIZE_FORMAT,
+ log_debug(gc)("Preselected %zu regions containing %zu live bytes,"
+ " consuming: %zu of budgeted: %zu",
selected_regions, selected_live, old_consumed, old_available);
}
@@ -724,7 +724,7 @@ void ShenandoahGeneration::prepare_regions_and_collection_set(bool concurrent) {
// We use integer division so anything up to just less than 2 is considered
// reasonable, and the "+1" is to avoid divide-by-zero.
assert((total_pop+1)/(total_census+1) == 1, "Extreme divergence: "
- SIZE_FORMAT "/" SIZE_FORMAT, total_pop, total_census);
+ "%zu/%zu", total_pop, total_census);
#endif
}
@@ -941,7 +941,7 @@ void ShenandoahGeneration::increase_humongous_waste(size_t bytes) {
void ShenandoahGeneration::decrease_humongous_waste(size_t bytes) {
if (bytes > 0) {
assert(ShenandoahHeap::heap()->is_full_gc_in_progress() || (_humongous_waste >= bytes),
- "Waste (" SIZE_FORMAT ") cannot be negative (after subtracting " SIZE_FORMAT ")", _humongous_waste, bytes);
+ "Waste (%zu) cannot be negative (after subtracting %zu)", _humongous_waste, bytes);
Atomic::sub(&_humongous_waste, bytes);
}
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationSizer.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationSizer.cpp
index dfbc6b673ffab..c6827878cd1f2 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationSizer.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationSizer.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/shenandoahGeneration.hpp"
#include "gc/shenandoah/shenandoahGenerationSizer.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -51,8 +50,8 @@ ShenandoahGenerationSizer::ShenandoahGenerationSizer()
if (NewSize > MaxNewSize) {
if (FLAG_IS_CMDLINE(MaxNewSize)) {
- log_warning(gc, ergo)("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). "
- "A new max generation size of " SIZE_FORMAT "k will be used.",
+ log_warning(gc, ergo)("NewSize (%zuk) is greater than the MaxNewSize (%zuk). "
+ "A new max generation size of %zuk will be used.",
NewSize/K, MaxNewSize/K, NewSize/K);
}
FLAG_SET_ERGO(MaxNewSize, NewSize);
@@ -138,7 +137,7 @@ bool ShenandoahGenerationSizer::transfer_regions(ShenandoahGeneration* src, Shen
src->decrease_capacity(bytes_to_transfer);
dst->increase_capacity(bytes_to_transfer);
const size_t new_size = dst->max_capacity();
- log_info(gc, ergo)("Transfer " SIZE_FORMAT " region(s) from %s to %s, yielding increased size: " PROPERFMT,
+ log_info(gc, ergo)("Transfer %zu region(s) from %s to %s, yielding increased size: " PROPERFMT,
regions, src->name(), dst->name(), PROPERFMTARGS(new_size));
return true;
}
@@ -190,7 +189,7 @@ void ShenandoahGenerationSizer::force_transfer_to_old(size_t regions) const {
young_gen->decrease_capacity(bytes_to_transfer);
old_gen->increase_capacity(bytes_to_transfer);
const size_t new_size = old_gen->max_capacity();
- log_info(gc, ergo)("Forcing transfer of " SIZE_FORMAT " region(s) from %s to %s, yielding increased size: " PROPERFMT,
+ log_info(gc, ergo)("Forcing transfer of %zu region(s) from %s to %s, yielding increased size: " PROPERFMT,
regions, young_gen->name(), old_gen->name(), PROPERFMTARGS(new_size));
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp
index 33af35c6b9555..8144b32aee076 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/mode/shenandoahMode.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp
index 9dcdf002b7e8c..5672463799af4 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
#include "gc/shenandoah/shenandoahGenerationalEvacuationTask.hpp"
@@ -89,7 +88,7 @@ void ShenandoahGenerationalEvacuationTask::do_work() {
}
void log_region(const ShenandoahHeapRegion* r, LogStream* ls) {
- ls->print_cr("GenerationalEvacuationTask, looking at %s region " SIZE_FORMAT ", (age: %d) [%s, %s, %s]",
+ ls->print_cr("GenerationalEvacuationTask, looking at %s region %zu, (age: %d) [%s, %s, %s]",
r->is_old()? "old": r->is_young()? "young": "free", r->index(), r->age(),
r->is_active()? "active": "inactive",
r->is_humongous()? (r->is_humongous_start()? "humongous_start": "humongous_continuation"): "regular",
@@ -126,7 +125,7 @@ void ShenandoahGenerationalEvacuationTask::evacuate_and_promote_regions() {
}
if (r->is_cset()) {
- assert(r->has_live(), "Region " SIZE_FORMAT " should have been reclaimed early", r->index());
+ assert(r->has_live(), "Region %zu should have been reclaimed early", r->index());
_heap->marked_object_iterate(r, &cl);
if (ShenandoahPacing) {
_heap->pacer()->report_evac(r->used() >> LogHeapWordSize);
@@ -177,11 +176,11 @@ void ShenandoahGenerationalEvacuationTask::promote_in_place(ShenandoahHeapRegion
const size_t old_garbage_threshold = (ShenandoahHeapRegion::region_size_bytes() * ShenandoahOldGarbageThreshold) / 100;
shenandoah_assert_generations_reconciled();
assert(!_heap->is_concurrent_old_mark_in_progress(), "Cannot promote in place during old marking");
- assert(region->garbage_before_padded_for_promote() < old_garbage_threshold, "Region " SIZE_FORMAT " has too much garbage for promotion", region->index());
+ assert(region->garbage_before_padded_for_promote() < old_garbage_threshold, "Region %zu has too much garbage for promotion", region->index());
assert(region->is_young(), "Only young regions can be promoted");
assert(region->is_regular(), "Use different service to promote humongous regions");
assert(region->age() >= _tenuring_threshold, "Only promote regions that are sufficiently aged");
- assert(region->get_top_before_promote() == tams, "Region " SIZE_FORMAT " has been used for allocations before promotion", region->index());
+ assert(region->get_top_before_promote() == tams, "Region %zu has been used for allocations before promotion", region->index());
}
ShenandoahOldGeneration* const old_gen = _heap->old_generation();
@@ -280,7 +279,7 @@ void ShenandoahGenerationalEvacuationTask::promote_humongous(ShenandoahHeapRegio
// We promote humongous objects unconditionally, without checking for availability. We adjust
// usage totals, including humongous waste, after evacuation is done.
- log_debug(gc)("promoting humongous region " SIZE_FORMAT ", spanning " SIZE_FORMAT, region->index(), spanned_regions);
+ log_debug(gc)("promoting humongous region %zu, spanning %zu", region->index(), spanned_regions);
young_gen->decrease_used(used_bytes);
young_gen->decrease_humongous_waste(humongous_waste);
@@ -294,7 +293,7 @@ void ShenandoahGenerationalEvacuationTask::promote_humongous(ShenandoahHeapRegio
// in the last humongous region that is not spanned by obj is currently not used.
for (size_t i = region->index(); i < index_limit; i++) {
ShenandoahHeapRegion* r = _heap->get_region(i);
- log_debug(gc)("promoting humongous region " SIZE_FORMAT ", from " PTR_FORMAT " to " PTR_FORMAT,
+ log_debug(gc)("promoting humongous region %zu, from " PTR_FORMAT " to " PTR_FORMAT,
r->index(), p2i(r->bottom()), p2i(r->top()));
// We mark the entire humongous object's range as dirty after loop terminates, so no need to dirty the range here
r->set_affiliation(OLD_GENERATION);
@@ -314,13 +313,12 @@ void ShenandoahGenerationalEvacuationTask::promote_humongous(ShenandoahHeapRegio
if (obj->is_typeArray()) {
// Primitive arrays don't need to be scanned.
- log_debug(gc)("Clean cards for promoted humongous object (Region " SIZE_FORMAT ") from " PTR_FORMAT " to " PTR_FORMAT,
+ log_debug(gc)("Clean cards for promoted humongous object (Region %zu) from " PTR_FORMAT " to " PTR_FORMAT,
region->index(), p2i(humongous_bottom), p2i(humongous_bottom + obj->size()));
scanner->mark_range_as_clean(humongous_bottom, obj->size());
} else {
- log_debug(gc)("Dirty cards for promoted humongous object (Region " SIZE_FORMAT ") from " PTR_FORMAT " to " PTR_FORMAT,
+ log_debug(gc)("Dirty cards for promoted humongous object (Region %zu) from " PTR_FORMAT " to " PTR_FORMAT,
region->index(), p2i(humongous_bottom), p2i(humongous_bottom + obj->size()));
scanner->mark_range_as_dirty(humongous_bottom, obj->size());
}
}
-
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalFullGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalFullGC.cpp
index fe38c996bd81c..a54f219faefc3 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalFullGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalFullGC.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,9 +23,6 @@
*
*/
-
-#include "precompiled.hpp"
-
#include "gc/shared/fullGCForwarding.inline.hpp"
#include "gc/shared/preservedMarks.inline.hpp"
#include "gc/shenandoah/shenandoahGenerationalFullGC.hpp"
@@ -219,7 +217,7 @@ ShenandoahPrepareForGenerationalCompactionObjectClosure::ShenandoahPrepareForGen
}
void ShenandoahPrepareForGenerationalCompactionObjectClosure::set_from_region(ShenandoahHeapRegion* from_region) {
- log_debug(gc)("Worker %u compacting %s Region " SIZE_FORMAT " which had used " SIZE_FORMAT " and %s live",
+ log_debug(gc)("Worker %u compacting %s Region %zu which had used %zu and %s live",
_worker_id, from_region->affiliation_name(),
from_region->index(), from_region->used(), from_region->has_live()? "has": "does not have");
@@ -248,7 +246,7 @@ void ShenandoahPrepareForGenerationalCompactionObjectClosure::finish() {
void ShenandoahPrepareForGenerationalCompactionObjectClosure::finish_old_region() {
if (_old_to_region != nullptr) {
- log_debug(gc)("Planned compaction into Old Region " SIZE_FORMAT ", used: " SIZE_FORMAT " tabulated by worker %u",
+ log_debug(gc)("Planned compaction into Old Region %zu, used: %zu tabulated by worker %u",
_old_to_region->index(), _old_compact_point - _old_to_region->bottom(), _worker_id);
_old_to_region->set_new_top(_old_compact_point);
_old_to_region = nullptr;
@@ -257,7 +255,7 @@ void ShenandoahPrepareForGenerationalCompactionObjectClosure::finish_old_region(
void ShenandoahPrepareForGenerationalCompactionObjectClosure::finish_young_region() {
if (_young_to_region != nullptr) {
- log_debug(gc)("Worker %u planned compaction into Young Region " SIZE_FORMAT ", used: " SIZE_FORMAT,
+ log_debug(gc)("Worker %u planned compaction into Young Region %zu, used: %zu",
_worker_id, _young_to_region->index(), _young_compact_point - _young_to_region->bottom());
_young_to_region->set_new_top(_young_compact_point);
_young_to_region = nullptr;
@@ -307,7 +305,7 @@ void ShenandoahPrepareForGenerationalCompactionObjectClosure::do_object(oop p) {
if (_old_compact_point + obj_size > _old_to_region->end()) {
ShenandoahHeapRegion* new_to_region;
- log_debug(gc)("Worker %u finishing old region " SIZE_FORMAT ", compact_point: " PTR_FORMAT ", obj_size: " SIZE_FORMAT
+ log_debug(gc)("Worker %u finishing old region %zu, compact_point: " PTR_FORMAT ", obj_size: %zu"
", &compact_point[obj_size]: " PTR_FORMAT ", region end: " PTR_FORMAT, _worker_id, _old_to_region->index(),
p2i(_old_compact_point), obj_size, p2i(_old_compact_point + obj_size), p2i(_old_to_region->end()));
@@ -354,7 +352,7 @@ void ShenandoahPrepareForGenerationalCompactionObjectClosure::do_object(oop p) {
if (_young_compact_point + obj_size > _young_to_region->end()) {
ShenandoahHeapRegion* new_to_region;
- log_debug(gc)("Worker %u finishing young region " SIZE_FORMAT ", compact_point: " PTR_FORMAT ", obj_size: " SIZE_FORMAT
+ log_debug(gc)("Worker %u finishing young region %zu, compact_point: " PTR_FORMAT ", obj_size: %zu"
", &compact_point[obj_size]: " PTR_FORMAT ", region end: " PTR_FORMAT, _worker_id, _young_to_region->index(),
p2i(_young_compact_point), obj_size, p2i(_young_compact_point + obj_size), p2i(_young_to_region->end()));
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp
index 2ad35fcb288b4..09b985e3b8d55 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/shenandoahAgeCensus.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
@@ -460,20 +459,20 @@ HeapWord* ShenandoahGenerationalHeap::allocate_from_plab_slow(Thread* thread, si
size_t future_size = MIN2(cur_size * 2, plab_max_size());
// Doubling, starting at a card-multiple, should give us a card-multiple. (Ceiling and floor
// are card multiples.)
- assert(is_aligned(future_size, CardTable::card_size_in_words()), "Card multiple by construction, future_size: " SIZE_FORMAT
- ", card_size: " SIZE_FORMAT ", cur_size: " SIZE_FORMAT ", max: " SIZE_FORMAT,
+ assert(is_aligned(future_size, CardTable::card_size_in_words()), "Card multiple by construction, future_size: %zu"
+ ", card_size: %zu, cur_size: %zu, max: %zu",
future_size, (size_t) CardTable::card_size_in_words(), cur_size, plab_max_size());
// Record new heuristic value even if we take any shortcut. This captures
// the case when moderately-sized objects always take a shortcut. At some point,
// heuristics should catch up with them. Note that the requested cur_size may
// not be honored, but we remember that this is the preferred size.
- log_debug(gc, free)("Set new PLAB size: " SIZE_FORMAT, future_size);
+ log_debug(gc, free)("Set new PLAB size: %zu", future_size);
ShenandoahThreadLocalData::set_plab_size(thread, future_size);
if (cur_size < size) {
// The PLAB to be allocated is still not large enough to hold the object. Fall back to shared allocation.
// This avoids retiring perfectly good PLABs in order to represent a single large object allocation.
- log_debug(gc, free)("Current PLAB size (" SIZE_FORMAT ") is too small for " SIZE_FORMAT, cur_size, size);
+ log_debug(gc, free)("Current PLAB size (%zu) is too small for %zu", cur_size, size);
return nullptr;
}
@@ -570,7 +569,7 @@ void ShenandoahGenerationalHeap::retire_plab(PLAB* plab, Thread* thread) {
if (top != nullptr && plab->waste() > original_waste && is_in_old(top)) {
// If retiring the plab created a filler object, then we need to register it with our card scanner so it can
// safely walk the region backing the plab.
- log_debug(gc)("retire_plab() is registering remnant of size " SIZE_FORMAT " at " PTR_FORMAT,
+ log_debug(gc)("retire_plab() is registering remnant of size %zu at " PTR_FORMAT,
plab->waste() - original_waste, p2i(top));
// No lock is necessary because the PLAB memory is aligned on card boundaries.
old_generation()->card_scan()->register_object_without_lock(top);
@@ -714,7 +713,7 @@ void ShenandoahGenerationalHeap::TransferResult::print_on(const char* when, outp
ShenandoahOldGeneration* const old_gen = heap->old_generation();
const size_t young_available = young_gen->available();
const size_t old_available = old_gen->available();
- ss->print_cr("After %s, %s " SIZE_FORMAT " regions to %s to prepare for next gc, old available: "
+ ss->print_cr("After %s, %s %zu regions to %s to prepare for next gc, old available: "
PROPERFMT ", young_available: " PROPERFMT,
when,
success? "successfully transferred": "failed to transfer", region_count, region_destination,
@@ -819,7 +818,7 @@ class ShenandoahGenerationalUpdateHeapRefsTask : public WorkerTask {
HeapWord* update_watermark = r->get_update_watermark();
assert(update_watermark >= r->bottom(), "sanity");
- log_debug(gc)("Update refs worker " UINT32_FORMAT ", looking at region " SIZE_FORMAT, worker_id, r->index());
+ log_debug(gc)("Update refs worker " UINT32_FORMAT ", looking at region %zu", worker_id, r->index());
bool region_progress = false;
if (r->is_active() && !r->is_cset()) {
if (r->is_young()) {
@@ -845,13 +844,13 @@ class ShenandoahGenerationalUpdateHeapRefsTask : public WorkerTask {
// updated.
assert(r->get_update_watermark() == r->bottom(),
- "%s Region " SIZE_FORMAT " is_active but not recognized as YOUNG or OLD so must be newly transitioned from FREE",
+ "%s Region %zu is_active but not recognized as YOUNG or OLD so must be newly transitioned from FREE",
r->affiliation_name(), r->index());
}
}
if (region_progress && ShenandoahPacing) {
- _heap->pacer()->report_updaterefs(pointer_delta(update_watermark, r->bottom()));
+ _heap->pacer()->report_update_refs(pointer_delta(update_watermark, r->bottom()));
}
if (_heap->check_cancelled_gc_and_yield(CONCURRENT)) {
@@ -911,7 +910,7 @@ class ShenandoahGenerationalUpdateHeapRefsTask : public WorkerTask {
}
if (ShenandoahPacing) {
- _heap->pacer()->report_updaterefs(pointer_delta(end_of_range, start_of_range));
+ _heap->pacer()->report_update_refs(pointer_delta(end_of_range, start_of_range));
}
}
}
@@ -1071,7 +1070,7 @@ void ShenandoahGenerationalHeap::complete_degenerated_cycle() {
shenandoah_assert_heaplocked_or_safepoint();
if (is_concurrent_old_mark_in_progress()) {
// This is still necessary for degenerated cycles because the degeneration point may occur
- // after final mark of the young generation. See ShenandoahConcurrentGC::op_final_updaterefs for
+ // after final mark of the young generation. See ShenandoahConcurrentGC::op_final_update_refs for
// a more detailed explanation.
old_generation()->transfer_pointers_from_satb();
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp
index 9b13c7c95af78..230fff162527b 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAgeCensus.hpp"
#include "gc/shenandoah/heuristics/shenandoahGlobalHeuristics.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
index d75a9234a63d2..4cc030b97366e 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveHeapWriter.hpp"
#include "classfile/systemDictionary.hpp"
@@ -102,6 +101,7 @@
#include "runtime/orderAccess.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/stackWatermarkSet.hpp"
+#include "runtime/threads.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/events.hpp"
@@ -145,7 +145,7 @@ class ShenandoahPretouchBitmapTask : public WorkerTask {
while (r != nullptr) {
size_t start = r->index() * ShenandoahHeapRegion::region_size_bytes() / MarkBitMap::heap_map_factor();
size_t end = (r->index() + 1) * ShenandoahHeapRegion::region_size_bytes() / MarkBitMap::heap_map_factor();
- assert (end <= _bitmap_size, "end is sane: " SIZE_FORMAT " < " SIZE_FORMAT, end, _bitmap_size);
+ assert (end <= _bitmap_size, "end is sane: %zu < %zu", end, _bitmap_size);
if (r->is_committed()) {
os::pretouch_memory(_bitmap_base + start, _bitmap_base + end, _page_size);
@@ -186,7 +186,7 @@ jint ShenandoahHeap::initialize() {
_num_regions = ShenandoahHeapRegion::region_count();
assert(_num_regions == (max_byte_size / reg_size_bytes),
- "Regions should cover entire heap exactly: " SIZE_FORMAT " != " SIZE_FORMAT "/" SIZE_FORMAT,
+ "Regions should cover entire heap exactly: %zu != %zu/%zu",
_num_regions, max_byte_size, reg_size_bytes);
size_t num_committed_regions = init_byte_size / reg_size_bytes;
@@ -276,7 +276,7 @@ jint ShenandoahHeap::initialize() {
guarantee(bitmap_bytes_per_region != 0,
"Bitmap bytes per region should not be zero");
guarantee(is_power_of_2(bitmap_bytes_per_region),
- "Bitmap bytes per region should be power of two: " SIZE_FORMAT, bitmap_bytes_per_region);
+ "Bitmap bytes per region should be power of two: %zu", bitmap_bytes_per_region);
if (bitmap_page_size > bitmap_bytes_per_region) {
_bitmap_regions_per_slice = bitmap_page_size / bitmap_bytes_per_region;
@@ -287,11 +287,11 @@ jint ShenandoahHeap::initialize() {
}
guarantee(_bitmap_regions_per_slice >= 1,
- "Should have at least one region per slice: " SIZE_FORMAT,
+ "Should have at least one region per slice: %zu",
_bitmap_regions_per_slice);
guarantee(((_bitmap_bytes_per_slice) % bitmap_page_size) == 0,
- "Bitmap slices should be page-granular: bps = " SIZE_FORMAT ", page size = " SIZE_FORMAT,
+ "Bitmap slices should be page-granular: bps = %zu, page size = %zu",
_bitmap_bytes_per_slice, bitmap_page_size);
ReservedSpace bitmap = reserve(_bitmap_size, bitmap_page_size);
@@ -583,12 +583,12 @@ ShenandoahHeap::ShenandoahHeap(ShenandoahCollectorPolicy* policy) :
void ShenandoahHeap::print_on(outputStream* st) const {
st->print_cr("Shenandoah Heap");
- st->print_cr(" " SIZE_FORMAT "%s max, " SIZE_FORMAT "%s soft max, " SIZE_FORMAT "%s committed, " SIZE_FORMAT "%s used",
+ st->print_cr(" %zu%s max, %zu%s soft max, %zu%s committed, %zu%s used",
byte_size_in_proper_unit(max_capacity()), proper_unit_for_byte_size(max_capacity()),
byte_size_in_proper_unit(soft_max_capacity()), proper_unit_for_byte_size(soft_max_capacity()),
byte_size_in_proper_unit(committed()), proper_unit_for_byte_size(committed()),
byte_size_in_proper_unit(used()), proper_unit_for_byte_size(used()));
- st->print_cr(" " SIZE_FORMAT " x " SIZE_FORMAT"%s regions",
+ st->print_cr(" %zu x %zu %s regions",
num_regions(),
byte_size_in_proper_unit(ShenandoahHeapRegion::region_size_bytes()),
proper_unit_for_byte_size(ShenandoahHeapRegion::region_size_bytes()));
@@ -644,7 +644,6 @@ class ShenandoahInitWorkerGCLABClosure : public ThreadClosure {
public:
void do_thread(Thread* thread) {
assert(thread != nullptr, "Sanity");
- assert(thread->is_Worker_thread(), "Only worker thread expected");
ShenandoahThreadLocalData::initialize_gclab(thread);
}
};
@@ -663,6 +662,9 @@ void ShenandoahHeap::post_initialize() {
// gclab can not be initialized early during VM startup, as it can not determinate its max_size.
// Now, we will let WorkerThreads to initialize gclab when new worker is created.
_workers->set_initialize_gclab();
+
+ // Note that the safepoint workers may require gclabs if the threads are used to create a heap dump
+ // during a concurrent evacuation phase.
if (_safepoint_workers != nullptr) {
_safepoint_workers->threads_do(&init_gclabs);
_safepoint_workers->set_initialize_gclab();
@@ -786,14 +788,14 @@ size_t ShenandoahHeap::max_capacity() const {
size_t ShenandoahHeap::soft_max_capacity() const {
size_t v = Atomic::load(&_soft_max_size);
assert(min_capacity() <= v && v <= max_capacity(),
- "Should be in bounds: " SIZE_FORMAT " <= " SIZE_FORMAT " <= " SIZE_FORMAT,
+ "Should be in bounds: %zu <= %zu <= %zu",
min_capacity(), v, max_capacity());
return v;
}
void ShenandoahHeap::set_soft_max_capacity(size_t v) {
assert(min_capacity() <= v && v <= max_capacity(),
- "Should be in bounds: " SIZE_FORMAT " <= " SIZE_FORMAT " <= " SIZE_FORMAT,
+ "Should be in bounds: %zu <= %zu <= %zu",
min_capacity(), v, max_capacity());
Atomic::store(&_soft_max_size, v);
}
@@ -840,7 +842,7 @@ bool ShenandoahHeap::check_soft_max_changed() {
new_soft_max = MAX2(min_capacity(), new_soft_max);
new_soft_max = MIN2(max_capacity(), new_soft_max);
if (new_soft_max != old_soft_max) {
- log_info(gc)("Soft Max Heap Size: " SIZE_FORMAT "%s -> " SIZE_FORMAT "%s",
+ log_info(gc)("Soft Max Heap Size: %zu%s -> %zu%s",
byte_size_in_proper_unit(old_soft_max), proper_unit_for_byte_size(old_soft_max),
byte_size_in_proper_unit(new_soft_max), proper_unit_for_byte_size(new_soft_max)
);
@@ -879,13 +881,13 @@ HeapWord* ShenandoahHeap::allocate_from_gclab_slow(Thread* thread, size_t size)
// Record new heuristic value even if we take any shortcut. This captures
// the case when moderately-sized objects always take a shortcut. At some point,
// heuristics should catch up with them.
- log_debug(gc, free)("Set new GCLAB size: " SIZE_FORMAT, new_size);
+ log_debug(gc, free)("Set new GCLAB size: %zu", new_size);
ShenandoahThreadLocalData::set_gclab_size(thread, new_size);
if (new_size < size) {
// New size still does not fit the object. Fall back to shared allocation.
// This avoids retiring perfectly good GCLABs, when we encounter a large object.
- log_debug(gc, free)("New gclab size (" SIZE_FORMAT ") is too small for " SIZE_FORMAT, new_size, size);
+ log_debug(gc, free)("New gclab size (%zu) is too small for %zu", new_size, size);
return nullptr;
}
@@ -994,8 +996,8 @@ HeapWord* ShenandoahHeap::allocate_memory(ShenandoahAllocRequest& req) {
}
if (log_develop_is_enabled(Debug, gc, alloc)) {
ResourceMark rm;
- log_debug(gc, alloc)("Thread: %s, Result: " PTR_FORMAT ", Request: %s, Size: " SIZE_FORMAT
- ", Original: " SIZE_FORMAT ", Latest: " SIZE_FORMAT,
+ log_debug(gc, alloc)("Thread: %s, Result: " PTR_FORMAT ", Request: %s, Size: %zu"
+ ", Original: %zu, Latest: %zu",
Thread::current()->name(), p2i(result), req.type_string(), req.size(),
original_count, get_gc_no_progress_count());
}
@@ -1024,7 +1026,7 @@ HeapWord* ShenandoahHeap::allocate_memory(ShenandoahAllocRequest& req) {
size_t actual = req.actual_size();
assert (req.is_lab_alloc() || (requested == actual),
- "Only LAB allocations are elastic: %s, requested = " SIZE_FORMAT ", actual = " SIZE_FORMAT,
+ "Only LAB allocations are elastic: %s, requested = %zu, actual = %zu",
ShenandoahAllocRequest::alloc_type_to_string(req.type()), requested, actual);
if (req.is_mutator_alloc()) {
@@ -1176,7 +1178,7 @@ class ShenandoahEvacuationTask : public WorkerTask {
ShenandoahConcurrentEvacuateRegionObjectClosure cl(_sh);
ShenandoahHeapRegion* r;
while ((r =_cs->claim_next()) != nullptr) {
- assert(r->has_live(), "Region " SIZE_FORMAT " should have been reclaimed early", r->index());
+ assert(r->has_live(), "Region %zu should have been reclaimed early", r->index());
_sh->marked_object_iterate(r, &cl);
if (ShenandoahPacing) {
@@ -1190,11 +1192,86 @@ class ShenandoahEvacuationTask : public WorkerTask {
}
};
+class ShenandoahRetireGCLABClosure : public ThreadClosure {
+private:
+ bool const _resize;
+public:
+ explicit ShenandoahRetireGCLABClosure(bool resize) : _resize(resize) {}
+ void do_thread(Thread* thread) override {
+ PLAB* gclab = ShenandoahThreadLocalData::gclab(thread);
+ assert(gclab != nullptr, "GCLAB should be initialized for %s", thread->name());
+ gclab->retire();
+ if (_resize && ShenandoahThreadLocalData::gclab_size(thread) > 0) {
+ ShenandoahThreadLocalData::set_gclab_size(thread, 0);
+ }
+
+ if (ShenandoahHeap::heap()->mode()->is_generational()) {
+ PLAB* plab = ShenandoahThreadLocalData::plab(thread);
+ assert(plab != nullptr, "PLAB should be initialized for %s", thread->name());
+
+ // There are two reasons to retire all plabs between old-gen evacuation passes.
+ // 1. We need to make the plab memory parsable by remembered-set scanning.
+ // 2. We need to establish a trustworthy UpdateWaterMark value within each old-gen heap region
+ ShenandoahGenerationalHeap::heap()->retire_plab(plab, thread);
+ if (_resize && ShenandoahThreadLocalData::plab_size(thread) > 0) {
+ ShenandoahThreadLocalData::set_plab_size(thread, 0);
+ }
+ }
+ }
+};
+
+class ShenandoahGCStatePropagator : public ThreadClosure {
+public:
+ explicit ShenandoahGCStatePropagator(char gc_state) : _gc_state(gc_state) {}
+
+ void do_thread(Thread* thread) override {
+ ShenandoahThreadLocalData::set_gc_state(thread, _gc_state);
+ }
+private:
+ char _gc_state;
+};
+
+class ShenandoahPrepareForUpdateRefs : public HandshakeClosure {
+public:
+ explicit ShenandoahPrepareForUpdateRefs(char gc_state) :
+ HandshakeClosure("Shenandoah Prepare for Update Refs"),
+ _retire(ResizeTLAB), _propagator(gc_state) {}
+
+ void do_thread(Thread* thread) override {
+ _propagator.do_thread(thread);
+ if (ShenandoahThreadLocalData::gclab(thread) != nullptr) {
+ _retire.do_thread(thread);
+ }
+ }
+private:
+ ShenandoahRetireGCLABClosure _retire;
+ ShenandoahGCStatePropagator _propagator;
+};
+
void ShenandoahHeap::evacuate_collection_set(bool concurrent) {
ShenandoahEvacuationTask task(this, _collection_set, concurrent);
workers()->run_task(&task);
}
+void ShenandoahHeap::concurrent_prepare_for_update_refs() {
+ // It's possible that evacuation succeeded, but we could still be cancelled when we get here.
+ // A cancellation at this point means the degenerated cycle must resume from update-refs.
+ set_gc_state_concurrent(EVACUATION, false);
+ set_gc_state_concurrent(WEAK_ROOTS, false);
+ set_gc_state_concurrent(UPDATE_REFS, true);
+
+ // This will propagate the gc state and retire gclabs and plabs for threads that require it.
+ ShenandoahPrepareForUpdateRefs prepare_for_update_refs(_gc_state.raw_value());
+
+ // The handshake won't touch worker threads (or control thread, or VM thread), so do those separately.
+ Threads::non_java_threads_do(&prepare_for_update_refs);
+
+ // Now retire gclabs and plabs and propagate gc_state for mutator threads
+ Handshake::execute(&prepare_for_update_refs);
+
+ _update_refs_iterator.reset();
+}
+
oop ShenandoahHeap::evacuate_object(oop p, Thread* thread) {
assert(thread == Thread::current(), "Expected thread parameter to be current thread.");
if (ShenandoahThreadLocalData::is_oom_during_evac(thread)) {
@@ -1349,34 +1426,6 @@ class ShenandoahCheckCleanGCLABClosure : public ThreadClosure {
}
};
-class ShenandoahRetireGCLABClosure : public ThreadClosure {
-private:
- bool const _resize;
-public:
- ShenandoahRetireGCLABClosure(bool resize) : _resize(resize) {}
- void do_thread(Thread* thread) {
- PLAB* gclab = ShenandoahThreadLocalData::gclab(thread);
- assert(gclab != nullptr, "GCLAB should be initialized for %s", thread->name());
- gclab->retire();
- if (_resize && ShenandoahThreadLocalData::gclab_size(thread) > 0) {
- ShenandoahThreadLocalData::set_gclab_size(thread, 0);
- }
-
- if (ShenandoahHeap::heap()->mode()->is_generational()) {
- PLAB* plab = ShenandoahThreadLocalData::plab(thread);
- assert(plab != nullptr, "PLAB should be initialized for %s", thread->name());
-
- // There are two reasons to retire all plabs between old-gen evacuation passes.
- // 1. We need to make the plab memory parsable by remembered-set scanning.
- // 2. We need to establish a trustworthy UpdateWaterMark value within each old-gen heap region
- ShenandoahGenerationalHeap::heap()->retire_plab(plab, thread);
- if (_resize && ShenandoahThreadLocalData::plab_size(thread) > 0) {
- ShenandoahThreadLocalData::set_plab_size(thread, 0);
- }
- }
- }
-};
-
void ShenandoahHeap::labs_make_parsable() {
assert(UseTLAB, "Only call with UseTLAB");
@@ -1389,6 +1438,10 @@ void ShenandoahHeap::labs_make_parsable() {
}
workers()->threads_do(&cl);
+
+ if (safepoint_workers() != nullptr) {
+ safepoint_workers()->threads_do(&cl);
+ }
}
void ShenandoahHeap::tlabs_retire(bool resize) {
@@ -1424,6 +1477,7 @@ void ShenandoahHeap::gclabs_retire(bool resize) {
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
cl.do_thread(t);
}
+
workers()->threads_do(&cl);
if (safepoint_workers() != nullptr) {
@@ -1443,6 +1497,18 @@ size_t ShenandoahHeap::max_tlab_size() const {
return ShenandoahHeapRegion::max_tlab_size_words();
}
+void ShenandoahHeap::collect_as_vm_thread(GCCause::Cause cause) {
+ // These requests are ignored because we can't easily have Shenandoah jump into
+ // a synchronous (degenerated or full) cycle while it is in the middle of a concurrent
+ // cycle. We _could_ cancel the concurrent cycle and then try to run a cycle directly
+ // on the VM thread, but this would confuse the control thread mightily and doesn't
+ // seem worth the trouble. Instead, we will have the caller thread run (and wait for) a
+ // concurrent cycle in the prologue of the heap inspect/dump operation. This is how
+ // other concurrent collectors in the JVM handle this scenario as well.
+ assert(Thread::current()->is_VM_thread(), "Should be the VM thread");
+ guarantee(cause == GCCause::_heap_dump || cause == GCCause::_heap_inspection, "Invalid cause");
+}
+
void ShenandoahHeap::collect(GCCause::Cause cause) {
control_thread()->request_gc(cause);
}
@@ -1527,7 +1593,9 @@ void ShenandoahHeap::set_active_generation() {
void ShenandoahHeap::on_cycle_start(GCCause::Cause cause, ShenandoahGeneration* generation) {
shenandoah_policy()->record_collection_cause(cause);
- assert(gc_cause() == GCCause::_no_gc, "Over-writing cause");
+ const GCCause::Cause current = gc_cause();
+ assert(current == GCCause::_no_gc, "Over-writing cause: %s, with: %s",
+ GCCause::to_string(current), GCCause::to_string(cause));
assert(_gc_generation == nullptr, "Over-writing _gc_generation");
set_gc_cause(cause);
@@ -1933,23 +2001,25 @@ void ShenandoahHeap::prepare_update_heap_references(bool concurrent) {
_update_refs_iterator.reset();
}
-void ShenandoahHeap::propagate_gc_state_to_java_threads() {
+void ShenandoahHeap::propagate_gc_state_to_all_threads() {
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at Shenandoah safepoint");
if (_gc_state_changed) {
+ ShenandoahGCStatePropagator propagator(_gc_state.raw_value());
+ Threads::threads_do(&propagator);
_gc_state_changed = false;
- char state = gc_state();
- for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) {
- ShenandoahThreadLocalData::set_gc_state(t, state);
- }
}
}
-void ShenandoahHeap::set_gc_state(uint mask, bool value) {
+void ShenandoahHeap::set_gc_state_at_safepoint(uint mask, bool value) {
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at Shenandoah safepoint");
_gc_state.set_cond(mask, value);
_gc_state_changed = true;
}
+void ShenandoahHeap::set_gc_state_concurrent(uint mask, bool value) {
+ _gc_state.set_cond(mask, value);
+}
+
void ShenandoahHeap::set_concurrent_young_mark_in_progress(bool in_progress) {
uint mask;
assert(!has_forwarded_objects(), "Young marking is not concurrent with evacuation");
@@ -1961,15 +2031,15 @@ void ShenandoahHeap::set_concurrent_young_mark_in_progress(bool in_progress) {
} else {
mask = MARKING | YOUNG_MARKING;
}
- set_gc_state(mask, in_progress);
+ set_gc_state_at_safepoint(mask, in_progress);
manage_satb_barrier(in_progress);
}
void ShenandoahHeap::set_concurrent_old_mark_in_progress(bool in_progress) {
#ifdef ASSERT
- // has_forwarded_objects() iff UPDATEREFS or EVACUATION
+ // has_forwarded_objects() iff UPDATE_REFS or EVACUATION
bool has_forwarded = has_forwarded_objects();
- bool updating_or_evacuating = _gc_state.is_set(UPDATEREFS | EVACUATION);
+ bool updating_or_evacuating = _gc_state.is_set(UPDATE_REFS | EVACUATION);
bool evacuating = _gc_state.is_set(EVACUATION);
assert ((has_forwarded == updating_or_evacuating) || (evacuating && !has_forwarded && collection_set()->is_empty()),
"Updating or evacuating iff has forwarded objects, or if evacuation phase is promoting in place without forwarding");
@@ -1977,9 +2047,9 @@ void ShenandoahHeap::set_concurrent_old_mark_in_progress(bool in_progress) {
if (!in_progress && is_concurrent_young_mark_in_progress()) {
// If young-marking is in progress when we turn off OLD_MARKING, leave MARKING (and YOUNG_MARKING) on
assert(_gc_state.is_set(MARKING), "concurrent_young_marking_in_progress implies MARKING");
- set_gc_state(OLD_MARKING, in_progress);
+ set_gc_state_at_safepoint(OLD_MARKING, in_progress);
} else {
- set_gc_state(MARKING | OLD_MARKING, in_progress);
+ set_gc_state_at_safepoint(MARKING | OLD_MARKING, in_progress);
}
manage_satb_barrier(in_progress);
}
@@ -2006,7 +2076,7 @@ void ShenandoahHeap::manage_satb_barrier(bool active) {
void ShenandoahHeap::set_evacuation_in_progress(bool in_progress) {
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Only call this at safepoint");
- set_gc_state(EVACUATION, in_progress);
+ set_gc_state_at_safepoint(EVACUATION, in_progress);
}
void ShenandoahHeap::set_concurrent_strong_root_in_progress(bool in_progress) {
@@ -2018,7 +2088,7 @@ void ShenandoahHeap::set_concurrent_strong_root_in_progress(bool in_progress) {
}
void ShenandoahHeap::set_concurrent_weak_root_in_progress(bool cond) {
- set_gc_state(WEAK_ROOTS, cond);
+ set_gc_state_at_safepoint(WEAK_ROOTS, cond);
}
GCTracer* ShenandoahHeap::tracer() {
@@ -2121,7 +2191,7 @@ void ShenandoahHeap::stw_unload_classes(bool full_gc) {
DEBUG_ONLY(MetaspaceUtils::verify();)
}
-// Weak roots are either pre-evacuated (final mark) or updated (final updaterefs),
+// Weak roots are either pre-evacuated (final mark) or updated (final update refs),
// so they should not have forwarded oops.
// However, we do need to "null" dead oops in the roots, if can not be done
// in concurrent cycles.
@@ -2165,7 +2235,7 @@ void ShenandoahHeap::parallel_cleaning(bool full_gc) {
}
void ShenandoahHeap::set_has_forwarded_objects(bool cond) {
- set_gc_state(HAS_FORWARDED, cond);
+ set_gc_state_at_safepoint(HAS_FORWARDED, cond);
}
void ShenandoahHeap::set_unload_classes(bool uc) {
@@ -2205,7 +2275,7 @@ void ShenandoahHeap::set_full_gc_move_in_progress(bool in_progress) {
}
void ShenandoahHeap::set_update_refs_in_progress(bool in_progress) {
- set_gc_state(UPDATEREFS, in_progress);
+ set_gc_state_at_safepoint(UPDATE_REFS, in_progress);
}
void ShenandoahHeap::register_nmethod(nmethod* nm) {
@@ -2223,7 +2293,7 @@ void ShenandoahHeap::pin_object(JavaThread* thr, oop o) {
void ShenandoahHeap::unpin_object(JavaThread* thr, oop o) {
ShenandoahHeapRegion* r = heap_region_containing(o);
assert(r != nullptr, "Sanity");
- assert(r->pin_count() > 0, "Region " SIZE_FORMAT " should have non-zero pins", r->index());
+ assert(r->pin_count() > 0, "Region %zu should have non-zero pins", r->index());
r->record_unpin();
}
@@ -2255,7 +2325,7 @@ void ShenandoahHeap::assert_pinned_region_status() {
shenandoah_assert_generations_reconciled();
if (gc_generation()->contains(r)) {
assert((r->is_pinned() && r->pin_count() > 0) || (!r->is_pinned() && r->pin_count() == 0),
- "Region " SIZE_FORMAT " pinning status is inconsistent", i);
+ "Region %zu pinning status is inconsistent", i);
}
}
}
@@ -2351,7 +2421,7 @@ class ShenandoahUpdateHeapRefsTask : public WorkerTask {
if (r->is_active() && !r->is_cset()) {
_heap->marked_object_oop_iterate(r, &cl, update_watermark);
if (ShenandoahPacing) {
- _heap->pacer()->report_updaterefs(pointer_delta(update_watermark, r->bottom()));
+ _heap->pacer()->report_update_refs(pointer_delta(update_watermark, r->bottom()));
}
}
if (_heap->check_cancelled_gc_and_yield(CONCURRENT)) {
@@ -2413,7 +2483,7 @@ void ShenandoahHeap::rebuild_free_set(bool concurrent) {
assert((first_old_region > last_old_region) ||
((last_old_region + 1 - first_old_region >= old_region_count) &&
get_region(first_old_region)->is_old() && get_region(last_old_region)->is_old()),
- "sanity: old_region_count: " SIZE_FORMAT ", first_old_region: " SIZE_FORMAT ", last_old_region: " SIZE_FORMAT,
+ "sanity: old_region_count: %zu, first_old_region: %zu, last_old_region: %zu",
old_region_count, first_old_region, last_old_region);
if (mode()->is_generational()) {
@@ -2610,6 +2680,14 @@ char ShenandoahHeap::gc_state() const {
return _gc_state.raw_value();
}
+bool ShenandoahHeap::is_gc_state(GCState state) const {
+ // If the global gc state has been changed, but hasn't yet been propagated to all threads, then
+ // the global gc state is the correct value. Once the gc state has been synchronized with all threads,
+ // _gc_state_changed will be toggled to false and we need to use the thread local state.
+ return _gc_state_changed ? _gc_state.is_set(state) : ShenandoahThreadLocalData::is_gc_state(state);
+}
+
+
ShenandoahLiveData* ShenandoahHeap::get_liveness_cache(uint worker_id) {
#ifdef ASSERT
assert(_liveness_cache != nullptr, "sanity");
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
index 5beced0544cf6..785e1742b0cdc 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
@@ -329,7 +329,7 @@ class ShenandoahHeap : public CollectedHeap {
EVACUATION_BITPOS = 2,
// Heap is under updating: needs no additional barriers.
- UPDATEREFS_BITPOS = 3,
+ UPDATE_REFS_BITPOS = 3,
// Heap is under weak-reference/roots processing: needs weak-LRB barriers.
WEAK_ROOTS_BITPOS = 4,
@@ -346,7 +346,7 @@ class ShenandoahHeap : public CollectedHeap {
HAS_FORWARDED = 1 << HAS_FORWARDED_BITPOS,
MARKING = 1 << MARKING_BITPOS,
EVACUATION = 1 << EVACUATION_BITPOS,
- UPDATEREFS = 1 << UPDATEREFS_BITPOS,
+ UPDATE_REFS = 1 << UPDATE_REFS_BITPOS,
WEAK_ROOTS = 1 << WEAK_ROOTS_BITPOS,
YOUNG_MARKING = 1 << YOUNG_MARKING_BITPOS,
OLD_MARKING = 1 << OLD_MARKING_BITPOS
@@ -363,18 +363,35 @@ class ShenandoahHeap : public CollectedHeap {
size_t _gc_no_progress_count;
- // This updates the singlular, global gc state. This must happen on a safepoint.
- void set_gc_state(uint mask, bool value);
+ // This updates the singular, global gc state. This call must happen on a safepoint.
+ void set_gc_state_at_safepoint(uint mask, bool value);
+
+ // This also updates the global gc state, but does not need to be called on a safepoint.
+ // Critically, this method will _not_ flag that the global gc state has changed and threads
+ // will continue to use their thread local copy. This is expected to be used in conjunction
+ // with a handshake operation to propagate the new gc state.
+ void set_gc_state_concurrent(uint mask, bool value);
public:
+ // This returns the raw value of the singular, global gc state.
char gc_state() const;
- // This copies the global gc state into a thread local variable for java threads.
- // It is primarily intended to support quick access at barriers.
- void propagate_gc_state_to_java_threads();
+ // Compares the given state against either the global gc state, or the thread local state.
+ // The global gc state may change on a safepoint and is the correct value to use until
+ // the global gc state has been propagated to all threads (after which, this method will
+ // compare against the thread local state). The thread local gc state may also be changed
+ // by a handshake operation, in which case, this function continues using the updated thread
+ // local value.
+ bool is_gc_state(GCState state) const;
+
+ // This copies the global gc state into a thread local variable for all threads.
+ // The thread local gc state is primarily intended to support quick access at barriers.
+ // All threads are updated because in some cases the control thread or the vm thread may
+ // need to execute the load reference barrier.
+ void propagate_gc_state_to_all_threads();
// This is public to support assertions that the state hasn't been changed off of
- // a safepoint and that any changes were propagated to java threads after the safepoint.
+ // a safepoint and that any changes were propagated to threads after the safepoint.
bool has_gc_state_changed() const { return _gc_state_changed; }
// Returns true if allocations have occurred in new regions or if regions have been
@@ -394,9 +411,7 @@ class ShenandoahHeap : public CollectedHeap {
void set_concurrent_strong_root_in_progress(bool cond);
void set_concurrent_weak_root_in_progress(bool cond);
- inline bool is_stable() const;
inline bool is_idle() const;
-
inline bool is_concurrent_mark_in_progress() const;
inline bool is_concurrent_young_mark_in_progress() const;
inline bool is_concurrent_old_mark_in_progress() const;
@@ -464,6 +479,10 @@ class ShenandoahHeap : public CollectedHeap {
void do_class_unloading();
// Reference updating
void prepare_update_heap_references(bool concurrent);
+
+ // Retires LABs used for evacuation
+ void concurrent_prepare_for_update_refs();
+
virtual void update_heap_references(bool concurrent);
// Final update region states
void update_heap_region_states(bool concurrent);
@@ -615,6 +634,7 @@ class ShenandoahHeap : public CollectedHeap {
MemRegion reserved_region() const { return _reserved; }
bool is_in_reserved(const void* addr) const { return _reserved.contains(addr); }
+ void collect_as_vm_thread(GCCause::Cause cause) override;
void collect(GCCause::Cause cause) override;
void do_full_collection(bool clear_all_soft_refs) override;
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
index 6a38266489e03..461447cf9ba77 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2015, 2020, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -64,10 +65,6 @@ inline ShenandoahHeapRegion* ShenandoahRegionIterator::next() {
return _heap->get_region(new_index - 1);
}
-inline bool ShenandoahHeap::has_forwarded_objects() const {
- return _gc_state.is_set(HAS_FORWARDED);
-}
-
inline WorkerThreads* ShenandoahHeap::workers() const {
return _workers;
}
@@ -382,7 +379,7 @@ inline bool ShenandoahHeap::is_in_active_generation(oop obj) const {
// Old regions are in old and global collections, not in young collections
return !gen->is_young();
default:
- assert(false, "Bad affiliation (%d) for region " SIZE_FORMAT, region_affiliation(index), index);
+ assert(false, "Bad affiliation (%d) for region %zu", region_affiliation(index), index);
return false;
}
}
@@ -450,28 +447,36 @@ inline bool ShenandoahHeap::in_collection_set_loc(void* p) const {
return collection_set()->is_in_loc(p);
}
-inline bool ShenandoahHeap::is_stable() const {
- return _gc_state.is_clear();
+inline bool ShenandoahHeap::is_idle() const {
+ return _gc_state_changed ? _gc_state.is_clear() : ShenandoahThreadLocalData::gc_state(Thread::current()) == 0;
}
-inline bool ShenandoahHeap::is_idle() const {
- return _gc_state.is_unset(MARKING | EVACUATION | UPDATEREFS);
+inline bool ShenandoahHeap::has_forwarded_objects() const {
+ return is_gc_state(HAS_FORWARDED);
}
inline bool ShenandoahHeap::is_concurrent_mark_in_progress() const {
- return _gc_state.is_set(MARKING);
+ return is_gc_state(MARKING);
}
inline bool ShenandoahHeap::is_concurrent_young_mark_in_progress() const {
- return _gc_state.is_set(YOUNG_MARKING);
+ return is_gc_state(YOUNG_MARKING);
}
inline bool ShenandoahHeap::is_concurrent_old_mark_in_progress() const {
- return _gc_state.is_set(OLD_MARKING);
+ return is_gc_state(OLD_MARKING);
}
inline bool ShenandoahHeap::is_evacuation_in_progress() const {
- return _gc_state.is_set(EVACUATION);
+ return is_gc_state(EVACUATION);
+}
+
+inline bool ShenandoahHeap::is_update_refs_in_progress() const {
+ return is_gc_state(UPDATE_REFS);
+}
+
+inline bool ShenandoahHeap::is_concurrent_weak_root_in_progress() const {
+ return is_gc_state(WEAK_ROOTS);
}
inline bool ShenandoahHeap::is_degenerated_gc_in_progress() const {
@@ -486,10 +491,6 @@ inline bool ShenandoahHeap::is_full_gc_move_in_progress() const {
return _full_gc_move_in_progress.is_set();
}
-inline bool ShenandoahHeap::is_update_refs_in_progress() const {
- return _gc_state.is_set(UPDATEREFS);
-}
-
inline bool ShenandoahHeap::is_stw_gc_in_progress() const {
return is_full_gc_in_progress() || is_degenerated_gc_in_progress();
}
@@ -498,10 +499,6 @@ inline bool ShenandoahHeap::is_concurrent_strong_root_in_progress() const {
return _concurrent_strong_root_in_progress.is_set();
}
-inline bool ShenandoahHeap::is_concurrent_weak_root_in_progress() const {
- return _gc_state.is_set(WEAK_ROOTS);
-}
-
template
inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, T* cl) {
marked_object_iterate(region, cl, region->top());
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
index d46b76c937652..42237a0ab0600 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/space.hpp"
#include "gc/shared/tlab_globals.hpp"
@@ -242,7 +241,7 @@ void ShenandoahHeapRegion::make_humongous_cont_bypass(ShenandoahAffiliation affi
void ShenandoahHeapRegion::make_pinned() {
shenandoah_assert_heaplocked();
- assert(pin_count() > 0, "Should have pins: " SIZE_FORMAT, pin_count());
+ assert(pin_count() > 0, "Should have pins: %zu", pin_count());
switch (state()) {
case _regular:
@@ -264,7 +263,7 @@ void ShenandoahHeapRegion::make_pinned() {
void ShenandoahHeapRegion::make_unpinned() {
shenandoah_assert_heaplocked();
- assert(pin_count() == 0, "Should not have pins: " SIZE_FORMAT, pin_count());
+ assert(pin_count() == 0, "Should not have pins: %zu", pin_count());
switch (state()) {
case _pinned:
@@ -398,7 +397,7 @@ void ShenandoahHeapRegion::set_live_data(size_t s) {
void ShenandoahHeapRegion::print_on(outputStream* st) const {
st->print("|");
- st->print(SIZE_FORMAT_W(5), this->_index);
+ st->print("%5zu", this->_index);
switch (state()) {
case _empty_uncommitted:
@@ -445,15 +444,15 @@ void ShenandoahHeapRegion::print_on(outputStream* st) const {
p2i(ShenandoahHeap::heap()->marking_context()->top_at_mark_start(const_cast(this))));
st->print("|UWM " SHR_PTR_FORMAT,
p2i(_update_watermark));
- st->print("|U " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(used()), proper_unit_for_byte_size(used()));
- st->print("|T " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_tlab_allocs()), proper_unit_for_byte_size(get_tlab_allocs()));
- st->print("|G " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_gclab_allocs()), proper_unit_for_byte_size(get_gclab_allocs()));
+ st->print("|U %5zu%1s", byte_size_in_proper_unit(used()), proper_unit_for_byte_size(used()));
+ st->print("|T %5zu%1s", byte_size_in_proper_unit(get_tlab_allocs()), proper_unit_for_byte_size(get_tlab_allocs()));
+ st->print("|G %5zu%1s", byte_size_in_proper_unit(get_gclab_allocs()), proper_unit_for_byte_size(get_gclab_allocs()));
if (ShenandoahHeap::heap()->mode()->is_generational()) {
- st->print("|P " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_plab_allocs()), proper_unit_for_byte_size(get_plab_allocs()));
+ st->print("|P %5zu%1s", byte_size_in_proper_unit(get_plab_allocs()), proper_unit_for_byte_size(get_plab_allocs()));
}
- st->print("|S " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_shared_allocs()), proper_unit_for_byte_size(get_shared_allocs()));
- st->print("|L " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_live_data_bytes()), proper_unit_for_byte_size(get_live_data_bytes()));
- st->print("|CP " SIZE_FORMAT_W(3), pin_count());
+ st->print("|S %5zu%1s", byte_size_in_proper_unit(get_shared_allocs()), proper_unit_for_byte_size(get_shared_allocs()));
+ st->print("|L %5zu%1s", byte_size_in_proper_unit(get_live_data_bytes()), proper_unit_for_byte_size(get_live_data_bytes()));
+ st->print("|CP %3zu", pin_count());
st->cr();
#undef SHR_PTR_FORMAT
@@ -675,33 +674,33 @@ size_t ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
size_t region_size;
if (FLAG_IS_DEFAULT(ShenandoahRegionSize)) {
if (ShenandoahMinRegionSize > max_heap_size / MIN_NUM_REGIONS) {
- err_msg message("Max heap size (" SIZE_FORMAT "%s) is too low to afford the minimum number "
- "of regions (" SIZE_FORMAT ") of minimum region size (" SIZE_FORMAT "%s).",
+ err_msg message("Max heap size (%zu%s) is too low to afford the minimum number "
+ "of regions (%zu) of minimum region size (%zu%s).",
byte_size_in_proper_unit(max_heap_size), proper_unit_for_byte_size(max_heap_size),
MIN_NUM_REGIONS,
byte_size_in_proper_unit(ShenandoahMinRegionSize), proper_unit_for_byte_size(ShenandoahMinRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahMinRegionSize option", message);
}
if (ShenandoahMinRegionSize < MIN_REGION_SIZE) {
- err_msg message("" SIZE_FORMAT "%s should not be lower than minimum region size (" SIZE_FORMAT "%s).",
+ err_msg message("%zu%s should not be lower than minimum region size (%zu%s).",
byte_size_in_proper_unit(ShenandoahMinRegionSize), proper_unit_for_byte_size(ShenandoahMinRegionSize),
byte_size_in_proper_unit(MIN_REGION_SIZE), proper_unit_for_byte_size(MIN_REGION_SIZE));
vm_exit_during_initialization("Invalid -XX:ShenandoahMinRegionSize option", message);
}
if (ShenandoahMinRegionSize < MinTLABSize) {
- err_msg message("" SIZE_FORMAT "%s should not be lower than TLAB size size (" SIZE_FORMAT "%s).",
+ err_msg message("%zu%s should not be lower than TLAB size size (%zu%s).",
byte_size_in_proper_unit(ShenandoahMinRegionSize), proper_unit_for_byte_size(ShenandoahMinRegionSize),
byte_size_in_proper_unit(MinTLABSize), proper_unit_for_byte_size(MinTLABSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahMinRegionSize option", message);
}
if (ShenandoahMaxRegionSize < MIN_REGION_SIZE) {
- err_msg message("" SIZE_FORMAT "%s should not be lower than min region size (" SIZE_FORMAT "%s).",
+ err_msg message("%zu%s should not be lower than min region size (%zu%s).",
byte_size_in_proper_unit(ShenandoahMaxRegionSize), proper_unit_for_byte_size(ShenandoahMaxRegionSize),
byte_size_in_proper_unit(MIN_REGION_SIZE), proper_unit_for_byte_size(MIN_REGION_SIZE));
vm_exit_during_initialization("Invalid -XX:ShenandoahMaxRegionSize option", message);
}
if (ShenandoahMinRegionSize > ShenandoahMaxRegionSize) {
- err_msg message("Minimum (" SIZE_FORMAT "%s) should be larger than maximum (" SIZE_FORMAT "%s).",
+ err_msg message("Minimum (%zu%s) should be larger than maximum (%zu%s).",
byte_size_in_proper_unit(ShenandoahMinRegionSize), proper_unit_for_byte_size(ShenandoahMinRegionSize),
byte_size_in_proper_unit(ShenandoahMaxRegionSize), proper_unit_for_byte_size(ShenandoahMaxRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahMinRegionSize or -XX:ShenandoahMaxRegionSize", message);
@@ -717,21 +716,21 @@ size_t ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
} else {
if (ShenandoahRegionSize > max_heap_size / MIN_NUM_REGIONS) {
- err_msg message("Max heap size (" SIZE_FORMAT "%s) is too low to afford the minimum number "
- "of regions (" SIZE_FORMAT ") of requested size (" SIZE_FORMAT "%s).",
+ err_msg message("Max heap size (%zu%s) is too low to afford the minimum number "
+ "of regions (%zu) of requested size (%zu%s).",
byte_size_in_proper_unit(max_heap_size), proper_unit_for_byte_size(max_heap_size),
MIN_NUM_REGIONS,
byte_size_in_proper_unit(ShenandoahRegionSize), proper_unit_for_byte_size(ShenandoahRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahRegionSize option", message);
}
if (ShenandoahRegionSize < ShenandoahMinRegionSize) {
- err_msg message("Heap region size (" SIZE_FORMAT "%s) should be larger than min region size (" SIZE_FORMAT "%s).",
+ err_msg message("Heap region size (%zu%s) should be larger than min region size (%zu%s).",
byte_size_in_proper_unit(ShenandoahRegionSize), proper_unit_for_byte_size(ShenandoahRegionSize),
byte_size_in_proper_unit(ShenandoahMinRegionSize), proper_unit_for_byte_size(ShenandoahMinRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahRegionSize option", message);
}
if (ShenandoahRegionSize > ShenandoahMaxRegionSize) {
- err_msg message("Heap region size (" SIZE_FORMAT "%s) should be lower than max region size (" SIZE_FORMAT "%s).",
+ err_msg message("Heap region size (%zu%s) should be lower than max region size (%zu%s).",
byte_size_in_proper_unit(ShenandoahRegionSize), proper_unit_for_byte_size(ShenandoahRegionSize),
byte_size_in_proper_unit(ShenandoahMaxRegionSize), proper_unit_for_byte_size(ShenandoahMaxRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahRegionSize option", message);
@@ -843,7 +842,7 @@ void ShenandoahHeapRegion::record_pin() {
}
void ShenandoahHeapRegion::record_unpin() {
- assert(pin_count() > 0, "Region " SIZE_FORMAT " should have non-zero pins", index());
+ assert(pin_count() > 0, "Region %zu should have non-zero pins", index());
Atomic::sub(&_critical_pins, (size_t)1);
}
@@ -857,7 +856,7 @@ void ShenandoahHeapRegion::set_affiliation(ShenandoahAffiliation new_affiliation
ShenandoahAffiliation region_affiliation = heap->region_affiliation(this);
{
ShenandoahMarkingContext* const ctx = heap->complete_marking_context();
- log_debug(gc)("Setting affiliation of Region " SIZE_FORMAT " from %s to %s, top: " PTR_FORMAT ", TAMS: " PTR_FORMAT
+ log_debug(gc)("Setting affiliation of Region %zu from %s to %s, top: " PTR_FORMAT ", TAMS: " PTR_FORMAT
", watermark: " PTR_FORMAT ", top_bitmap: " PTR_FORMAT,
index(), shenandoah_affiliation_name(region_affiliation), shenandoah_affiliation_name(new_affiliation),
p2i(top()), p2i(ctx->top_at_mark_start(this)), p2i(_update_watermark), p2i(ctx->top_bitmap(this)));
@@ -871,7 +870,7 @@ void ShenandoahHeapRegion::set_affiliation(ShenandoahAffiliation new_affiliation
HeapWord* top_bitmap = ctx->top_bitmap(this);
assert(ctx->is_bitmap_range_within_region_clear(top_bitmap, _end),
- "Region " SIZE_FORMAT ", bitmap should be clear between top_bitmap: " PTR_FORMAT " and end: " PTR_FORMAT, idx,
+ "Region %zu, bitmap should be clear between top_bitmap: " PTR_FORMAT " and end: " PTR_FORMAT, idx,
p2i(top_bitmap), p2i(_end));
}
#endif
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp
index 382d9ba942ccd..7f29a8628aab5 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.inline.hpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -36,7 +37,7 @@
HeapWord* ShenandoahHeapRegion::allocate_aligned(size_t size, ShenandoahAllocRequest &req, size_t alignment_in_bytes) {
shenandoah_assert_heaplocked_or_safepoint();
assert(req.is_lab_alloc(), "allocate_aligned() only applies to LAB allocations");
- assert(is_object_aligned(size), "alloc size breaks alignment: " SIZE_FORMAT, size);
+ assert(is_object_aligned(size), "alloc size breaks alignment: %zu", size);
assert(is_old(), "aligned allocations are only taken from OLD regions to support PLABs");
assert(is_aligned(alignment_in_bytes, HeapWordSize), "Expect heap word alignment");
@@ -88,7 +89,7 @@ HeapWord* ShenandoahHeapRegion::allocate_aligned(size_t size, ShenandoahAllocReq
HeapWord* ShenandoahHeapRegion::allocate(size_t size, const ShenandoahAllocRequest& req) {
shenandoah_assert_heaplocked_or_safepoint();
- assert(is_object_aligned(size), "alloc size breaks alignment: " SIZE_FORMAT, size);
+ assert(is_object_aligned(size), "alloc size breaks alignment: %zu", size);
HeapWord* obj = top();
if (pointer_delta(end(), obj) >= size) {
@@ -160,7 +161,7 @@ inline bool ShenandoahHeapRegion::has_live() const {
inline size_t ShenandoahHeapRegion::garbage() const {
assert(used() >= get_live_data_bytes(),
- "Live Data must be a subset of used() live: " SIZE_FORMAT " used: " SIZE_FORMAT,
+ "Live Data must be a subset of used() live: %zu used: %zu",
get_live_data_bytes(), used());
size_t result = used() - get_live_data_bytes();
@@ -171,7 +172,7 @@ inline size_t ShenandoahHeapRegion::garbage_before_padded_for_promote() const {
assert(get_top_before_promote() != nullptr, "top before promote should not equal null");
size_t used_before_promote = byte_size(bottom(), get_top_before_promote());
assert(used_before_promote >= get_live_data_bytes(),
- "Live Data must be a subset of used before promotion live: " SIZE_FORMAT " used: " SIZE_FORMAT,
+ "Live Data must be a subset of used before promotion live: %zu used: %zu",
get_live_data_bytes(), used_before_promote);
size_t result = used_before_promote - get_live_data_bytes();
return result;
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionClosures.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionClosures.cpp
index 3d3483a5b694f..3c6fe1a3df12d 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionClosures.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionClosures.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/shenandoahHeapRegionClosures.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.hpp"
#include "gc/shenandoah/shenandoahSharedVariables.hpp"
@@ -82,8 +81,8 @@ void ShenandoahFinalMarkUpdateRegionStateClosure::heap_region_do(ShenandoahHeapR
// from-space-refs written from here on.
r->set_update_watermark_at_safepoint(r->top());
} else {
- assert(!r->has_live(), "Region " SIZE_FORMAT " should have no live data", r->index());
+ assert(!r->has_live(), "Region %zu should have no live data", r->index());
assert(_ctx == nullptr || _ctx->top_at_mark_start(r) == r->top(),
- "Region " SIZE_FORMAT " should have correct TAMS", r->index());
+ "Region %zu should have correct TAMS", r->index());
}
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp
index 73250cecd6fe5..360c7d2d649a5 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahGeneration.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -91,7 +91,7 @@ void ShenandoahHeapRegionCounters::write_snapshot(PerfLongVariable** regions,
ResourceMark rm;
LogStream ls(lt);
- ls.print_cr(JLONG_FORMAT " " JLONG_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT " " SIZE_FORMAT,
+ ls.print_cr(JLONG_FORMAT " " JLONG_FORMAT " %zu %zu %zu",
ts->get_value(), status->get_value(), num_regions, region_size, protocol_version);
if (num_regions > 0) {
ls.print(JLONG_FORMAT, regions[0]->get_value());
@@ -147,10 +147,10 @@ static int encode_phase(ShenandoahHeap* heap) {
if (heap->is_update_refs_in_progress() || heap->is_full_gc_move_in_progress()) {
return 3;
}
- if (heap->is_concurrent_mark_in_progress() || heap->is_full_gc_in_progress()) {
+ if (heap->is_concurrent_mark_in_progress() || heap->is_concurrent_weak_root_in_progress() || heap->is_full_gc_in_progress()) {
return 1;
}
- assert(heap->is_idle(), "What is it doing?");
+ assert(heap->is_idle(), "Unexpected gc_state: %d", heap->gc_state());
return 0;
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp
index d18bfb0d62598..46d54c70fe159 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
@@ -81,7 +81,7 @@ ShenandoahHeapRegion* ShenandoahHeapRegionSetIterator::next() {
}
void ShenandoahHeapRegionSet::print_on(outputStream* out) const {
- out->print_cr("Region Set : " SIZE_FORMAT "", count());
+ out->print_cr("Region Set : %zu", count());
for (size_t index = 0; index < _heap->num_regions(); index++) {
if (is_in(index)) {
_heap->get_region(index)->print_on(out);
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp b/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp
index baf95a5bdf7e4..b4ea327965b34 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
#include "gc/shenandoah/shenandoahInitLogger.hpp"
@@ -40,7 +40,7 @@ void ShenandoahInitLogger::print() {
void ShenandoahInitLogger::print_heap() {
GCInitLogger::print_heap();
- log_info(gc, init)("Heap Region Count: " SIZE_FORMAT, ShenandoahHeapRegion::region_count());
+ log_info(gc, init)("Heap Region Count: %zu", ShenandoahHeapRegion::region_count());
log_info(gc, init)("Heap Region Size: " EXACTFMT, EXACTFMTARGS(ShenandoahHeapRegion::region_size_bytes()));
log_info(gc, init)("TLAB Size Max: " EXACTFMT, EXACTFMTARGS(ShenandoahHeapRegion::max_tlab_size_bytes()));
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.cpp b/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.cpp
index cd555e12c6f4d..97307e85a9b04 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahJfrSupport.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
#include "gc/shenandoah/shenandoahJfrSupport.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp b/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp
index 63c6c9ea88624..be72127c6ec75 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp
index 686295c3e1b71..2a4149ee44dc4 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMark.cpp
@@ -24,7 +24,6 @@
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp
index 0239f961c65f1..2dc0813e51354 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2015, 2022, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -128,7 +129,7 @@ inline void ShenandoahMark::count_liveness(ShenandoahLiveData* live_data, oop ob
if (!region->is_humongous_start()) {
assert(!region->is_humongous(), "Cannot have continuations here");
- assert(region->is_affiliated(), "Do not count live data within Free Regular Region " SIZE_FORMAT, region_idx);
+ assert(region->is_affiliated(), "Do not count live data within Free Regular Region %zu", region_idx);
ShenandoahLiveData cur = live_data[region_idx];
size_t new_val = size + cur;
if (new_val >= SHENANDOAH_LIVEDATA_MAX) {
@@ -143,11 +144,11 @@ inline void ShenandoahMark::count_liveness(ShenandoahLiveData* live_data, oop ob
shenandoah_assert_in_correct_region(nullptr, obj);
size_t num_regions = ShenandoahHeapRegion::required_regions(size * HeapWordSize);
- assert(region->is_affiliated(), "Do not count live data within FREE Humongous Start Region " SIZE_FORMAT, region_idx);
+ assert(region->is_affiliated(), "Do not count live data within FREE Humongous Start Region %zu", region_idx);
for (size_t i = region_idx; i < region_idx + num_regions; i++) {
ShenandoahHeapRegion* chain_reg = heap->get_region(i);
assert(chain_reg->is_humongous(), "Expecting a humongous region");
- assert(chain_reg->is_affiliated(), "Do not count live data within FREE Humongous Continuation Region " SIZE_FORMAT, i);
+ assert(chain_reg->is_affiliated(), "Do not count live data within FREE Humongous Continuation Region %zu", i);
chain_reg->increase_live_data_gc_words(chain_reg->used() >> LogHeapWordSize);
}
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp
index cd0f31ae14ffe..9986afc6f2019 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp
@@ -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.
* Copyright (c) 2020, Red Hat, Inc. and/or its affiliates.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahMarkBitMap.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "runtime/os.hpp"
@@ -154,19 +153,19 @@ void ShenandoahMarkBitMap::check_mark(HeapWord* addr) const {
void ShenandoahMarkBitMap::verify_index(idx_t bit) const {
assert(bit < _size,
- "BitMap index out of bounds: " SIZE_FORMAT " >= " SIZE_FORMAT,
+ "BitMap index out of bounds: %zu >= %zu",
bit, _size);
}
void ShenandoahMarkBitMap::verify_limit(idx_t bit) const {
assert(bit <= _size,
- "BitMap limit out of bounds: " SIZE_FORMAT " > " SIZE_FORMAT,
+ "BitMap limit out of bounds: %zu > %zu",
bit, _size);
}
void ShenandoahMarkBitMap::verify_range(idx_t beg, idx_t end) const {
assert(beg <= end,
- "BitMap range error: " SIZE_FORMAT " > " SIZE_FORMAT, beg, end);
+ "BitMap range error: %zu > %zu", beg, end);
verify_limit(end);
}
#endif
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp
index ded9fbd97f5b1..4fa006e60fb61 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/markBitMap.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.hpp"
@@ -56,7 +56,7 @@ bool ShenandoahMarkingContext::is_bitmap_range_within_region_clear(const HeapWor
size_t start_idx = heap->heap_region_index_containing(start);
#ifdef ASSERT
size_t end_idx = heap->heap_region_index_containing(end - 1);
- assert(start_idx == end_idx, "Expected range to be within same region (" SIZE_FORMAT ", " SIZE_FORMAT ")", start_idx, end_idx);
+ assert(start_idx == end_idx, "Expected range to be within same region (%zu, %zu)", start_idx, end_idx);
#endif
ShenandoahHeapRegion* r = heap->get_region(start_idx);
if (!heap->is_bitmap_slice_committed(r)) {
@@ -73,7 +73,7 @@ void ShenandoahMarkingContext::initialize_top_at_mark_start(ShenandoahHeapRegion
_top_at_mark_starts_base[idx] = bottom;
_top_bitmaps[idx] = bottom;
- log_debug(gc)("SMC:initialize_top_at_mark_start for Region " SIZE_FORMAT ", TAMS: " PTR_FORMAT ", TopOfBitMap: " PTR_FORMAT,
+ log_debug(gc)("SMC:initialize_top_at_mark_start for Region %zu, TAMS: " PTR_FORMAT ", TopOfBitMap: " PTR_FORMAT,
r->index(), p2i(bottom), p2i(r->end()));
}
@@ -85,7 +85,7 @@ void ShenandoahMarkingContext::clear_bitmap(ShenandoahHeapRegion* r) {
HeapWord* bottom = r->bottom();
HeapWord* top_bitmap = _top_bitmaps[r->index()];
- log_debug(gc)("SMC:clear_bitmap for %s Region " SIZE_FORMAT ", top_bitmap: " PTR_FORMAT,
+ log_debug(gc)("SMC:clear_bitmap for %s Region %zu, top_bitmap: " PTR_FORMAT,
r->affiliation_name(), r->index(), p2i(top_bitmap));
if (top_bitmap > bottom) {
@@ -94,7 +94,7 @@ void ShenandoahMarkingContext::clear_bitmap(ShenandoahHeapRegion* r) {
}
assert(is_bitmap_range_within_region_clear(bottom, r->end()),
- "Region " SIZE_FORMAT " should have no marks in bitmap", r->index());
+ "Region %zu should have no marks in bitmap", r->index());
}
bool ShenandoahMarkingContext::is_complete() {
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp
index 75a16e1554992..d9bddd5fbb6b9 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -93,16 +94,16 @@ inline void ShenandoahMarkingContext::capture_top_at_mark_start(ShenandoahHeapRe
HeapWord* new_tams = r->top();
assert(new_tams >= old_tams,
- "Region " SIZE_FORMAT", TAMS updates should be monotonic: " PTR_FORMAT " -> " PTR_FORMAT,
+ "Region %zu, TAMS updates should be monotonic: " PTR_FORMAT " -> " PTR_FORMAT,
idx, p2i(old_tams), p2i(new_tams));
assert((new_tams == r->bottom()) || (old_tams == r->bottom()) || (new_tams >= _top_bitmaps[idx]),
- "Region " SIZE_FORMAT", top_bitmaps updates should be monotonic: " PTR_FORMAT " -> " PTR_FORMAT,
+ "Region %zu, top_bitmaps updates should be monotonic: " PTR_FORMAT " -> " PTR_FORMAT,
idx, p2i(_top_bitmaps[idx]), p2i(new_tams));
assert(old_tams == r->bottom() || is_bitmap_range_within_region_clear(old_tams, new_tams),
- "Region " SIZE_FORMAT ", bitmap should be clear while adjusting TAMS: " PTR_FORMAT " -> " PTR_FORMAT,
+ "Region %zu, bitmap should be clear while adjusting TAMS: " PTR_FORMAT " -> " PTR_FORMAT,
idx, p2i(old_tams), p2i(new_tams));
- log_debug(gc)("Capturing TAMS for %s Region " SIZE_FORMAT ", was: " PTR_FORMAT ", now: " PTR_FORMAT,
+ log_debug(gc)("Capturing TAMS for %s Region %zu, was: " PTR_FORMAT ", now: " PTR_FORMAT,
r->affiliation_name(), idx, p2i(old_tams), p2i(new_tams));
_top_at_mark_starts_base[idx] = new_tams;
@@ -119,7 +120,7 @@ inline HeapWord* ShenandoahMarkingContext::top_at_mark_start(const ShenandoahHea
inline void ShenandoahMarkingContext::reset_top_bitmap(ShenandoahHeapRegion* r) {
assert(is_bitmap_range_within_region_clear(r->bottom(), r->end()),
- "Region " SIZE_FORMAT " should have no marks in bitmap", r->index());
+ "Region %zu should have no marks in bitmap", r->index());
_top_bitmaps[r->index()] = r->bottom();
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
index 9350f44585fcf..e9aa69b5555c5 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahMemoryPool.hpp"
#include "gc/shenandoah/shenandoahYoungGeneration.hpp"
#include "gc/shenandoah/shenandoahOldGeneration.hpp"
@@ -54,15 +54,15 @@ MemoryUsage ShenandoahMemoryPool::get_memory_usage() {
size_t committed = _heap->committed();
// These asserts can never fail: max is stable, and all updates to other values never overflow max.
- assert(initial <= max, "initial: " SIZE_FORMAT ", max: " SIZE_FORMAT, initial, max);
- assert(used <= max, "used: " SIZE_FORMAT ", max: " SIZE_FORMAT, used, max);
- assert(committed <= max, "committed: " SIZE_FORMAT ", max: " SIZE_FORMAT, committed, max);
+ assert(initial <= max, "initial: %zu, max: %zu", initial, max);
+ assert(used <= max, "used: %zu, max: %zu", used, max);
+ assert(committed <= max, "committed: %zu, max: %zu", committed, max);
// Committed and used are updated concurrently and independently. They can momentarily break
// the assert below, which would also fail in downstream code. To avoid that, adjust values
// to make sense under the race. See JDK-8207200.
committed = MAX2(used, committed);
- assert(used <= committed, "used: " SIZE_FORMAT ", committed: " SIZE_FORMAT, used, committed);
+ assert(used <= committed, "used: %zu, committed: %zu", used, committed);
return MemoryUsage(initial, used, committed, max);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp
index 8b2412ff9ab05..201bcdc9e390b 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahMetrics.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
@@ -48,7 +48,7 @@ bool ShenandoahMetricsSnapshot::is_good_progress() {
size_t free_actual = _heap->free_set()->available();
size_t free_expected = _heap->max_capacity() / 100 * ShenandoahCriticalFreeThreshold;
bool prog_free = free_actual >= free_expected;
- log_info(gc, ergo)("%s progress for free space: " SIZE_FORMAT "%s, need " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("%s progress for free space: %zu%s, need %zu%s",
prog_free ? "Good" : "Bad",
byte_size_in_proper_unit(free_actual), proper_unit_for_byte_size(free_actual),
byte_size_in_proper_unit(free_expected), proper_unit_for_byte_size(free_expected));
@@ -60,7 +60,7 @@ bool ShenandoahMetricsSnapshot::is_good_progress() {
size_t progress_actual = (_used_before > _used_after) ? _used_before - _used_after : 0;
size_t progress_expected = ShenandoahHeapRegion::region_size_bytes();
bool prog_used = progress_actual >= progress_expected;
- log_info(gc, ergo)("%s progress for used space: " SIZE_FORMAT "%s, need " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("%s progress for used space: %zu%s, need %zu%s",
prog_used ? "Good" : "Bad",
byte_size_in_proper_unit(progress_actual), proper_unit_for_byte_size(progress_actual),
byte_size_in_proper_unit(progress_expected), proper_unit_for_byte_size(progress_expected));
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMmuTracker.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMmuTracker.cpp
index d9cec36e6c9c7..663864b1294ce 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMmuTracker.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMmuTracker.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -21,7 +22,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahMmuTracker.hpp"
@@ -48,7 +48,7 @@ class ThreadTimeAccumulator : public ThreadClosure {
size_t total_time;
ThreadTimeAccumulator() : total_time(0) {}
void do_thread(Thread* thread) override {
- assert(!thread->has_terminated(), "Cannot get cpu time for terminated thread: " UINTX_FORMAT, thread->osthread()->thread_id_for_printing());
+ assert(!thread->has_terminated(), "Cannot get cpu time for terminated thread: %zu", thread->osthread()->thread_id_for_printing());
total_time += os::thread_cpu_time(thread);
}
};
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMonitoringSupport.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMonitoringSupport.cpp
index ffeab9b635102..77d586dd90bcd 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahMonitoringSupport.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMonitoringSupport.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "gc/shared/generationCounters.hpp"
#include "gc/shared/hSpaceCounters.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp
index 5ba241590882c..53dd3ae1b1ef8 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.cpp b/src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.cpp
index 3c7ba8e424300..be032a60db70a 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahNumberSeq.hpp"
#include "runtime/atomic.hpp"
@@ -208,12 +208,12 @@ void BinaryMagnitudeSeq::add(size_t val) {
// Defensively saturate for product bits:
if (mag < 0) {
- assert (false, "bucket index (%d) underflow for value (" SIZE_FORMAT ")", mag, val);
+ assert (false, "bucket index (%d) underflow for value (%zu)", mag, val);
mag = 0;
}
if (mag >= BitsPerSize_t) {
- assert (false, "bucket index (%d) overflow for value (" SIZE_FORMAT ")", mag, val);
+ assert (false, "bucket index (%d) overflow for value (%zu)", mag, val);
mag = BitsPerSize_t - 1;
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOldGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahOldGC.cpp
index a5d3302091c00..708d27db16525 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahOldGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahOldGC.cpp
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/heuristics/shenandoahYoungHeuristics.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp
index 36007023d4600..388872172553b 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,9 +23,6 @@
*
*/
-
-#include "precompiled.hpp"
-
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
@@ -108,7 +106,7 @@ class ShenandoahPurgeSATBTask : public WorkerTask {
~ShenandoahPurgeSATBTask() {
if (_trashed_oops > 0) {
- log_debug(gc)("Purged " SIZE_FORMAT " oops from old generation SATB buffers", _trashed_oops);
+ log_debug(gc)("Purged %zu oops from old generation SATB buffers", _trashed_oops);
}
}
@@ -653,9 +651,9 @@ void ShenandoahOldGeneration::handle_failed_promotion(Thread* thread, size_t siz
const size_t words_remaining = (plab == nullptr)? 0: plab->words_remaining();
const char* promote_enabled = ShenandoahThreadLocalData::allow_plab_promotions(thread)? "enabled": "disabled";
- log_info(gc, ergo)("Promotion failed, size " SIZE_FORMAT ", has plab? %s, PLAB remaining: " SIZE_FORMAT
- ", plab promotions %s, promotion reserve: " SIZE_FORMAT ", promotion expended: " SIZE_FORMAT
- ", old capacity: " SIZE_FORMAT ", old_used: " SIZE_FORMAT ", old unaffiliated regions: " SIZE_FORMAT,
+ log_info(gc, ergo)("Promotion failed, size %zu, has plab? %s, PLAB remaining: %zu"
+ ", plab promotions %s, promotion reserve: %zu, promotion expended: %zu"
+ ", old capacity: %zu, old_used: %zu, old unaffiliated regions: %zu",
size * HeapWordSize, plab == nullptr? "no": "yes",
words_remaining * HeapWordSize, promote_enabled, promotion_reserve, promotion_expended,
max_capacity(), used(), free_unaffiliated_regions());
@@ -700,7 +698,7 @@ void ShenandoahOldGeneration::abandon_collection_candidates() {
void ShenandoahOldGeneration::prepare_for_mixed_collections_after_global_gc() {
assert(is_mark_complete(), "Expected old generation mark to be complete after global cycle.");
_old_heuristics->prepare_for_old_collections();
- log_info(gc, ergo)("After choosing global collection set, mixed candidates: " UINT32_FORMAT ", coalescing candidates: " SIZE_FORMAT,
+ log_info(gc, ergo)("After choosing global collection set, mixed candidates: " UINT32_FORMAT ", coalescing candidates: %zu",
_old_heuristics->unprocessed_old_collection_candidates(),
_old_heuristics->coalesce_and_fill_candidates_count());
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp
index e7d5a2e00c5b2..06b9d072aeb91 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
@@ -73,8 +73,8 @@ void ShenandoahPacer::setup_for_mark() {
restart_with(non_taxable, tax);
- log_info(gc, ergo)("Pacer for Mark. Expected Live: " SIZE_FORMAT "%s, Free: " SIZE_FORMAT "%s, "
- "Non-Taxable: " SIZE_FORMAT "%s, Alloc Tax Rate: %.1fx",
+ log_info(gc, ergo)("Pacer for Mark. Expected Live: %zu%s, Free: %zu%s, "
+ "Non-Taxable: %zu%s, Alloc Tax Rate: %.1fx",
byte_size_in_proper_unit(live), proper_unit_for_byte_size(live),
byte_size_in_proper_unit(free), proper_unit_for_byte_size(free),
byte_size_in_proper_unit(non_taxable), proper_unit_for_byte_size(non_taxable),
@@ -98,15 +98,15 @@ void ShenandoahPacer::setup_for_evac() {
restart_with(non_taxable, tax);
- log_info(gc, ergo)("Pacer for Evacuation. Used CSet: " SIZE_FORMAT "%s, Free: " SIZE_FORMAT "%s, "
- "Non-Taxable: " SIZE_FORMAT "%s, Alloc Tax Rate: %.1fx",
+ log_info(gc, ergo)("Pacer for Evacuation. Used CSet: %zu%s, Free: %zu%s, "
+ "Non-Taxable: %zu%s, Alloc Tax Rate: %.1fx",
byte_size_in_proper_unit(used), proper_unit_for_byte_size(used),
byte_size_in_proper_unit(free), proper_unit_for_byte_size(free),
byte_size_in_proper_unit(non_taxable), proper_unit_for_byte_size(non_taxable),
tax);
}
-void ShenandoahPacer::setup_for_updaterefs() {
+void ShenandoahPacer::setup_for_update_refs() {
assert(ShenandoahPacing, "Only be here when pacing is enabled");
size_t used = _heap->used();
@@ -123,8 +123,8 @@ void ShenandoahPacer::setup_for_updaterefs() {
restart_with(non_taxable, tax);
- log_info(gc, ergo)("Pacer for Update Refs. Used: " SIZE_FORMAT "%s, Free: " SIZE_FORMAT "%s, "
- "Non-Taxable: " SIZE_FORMAT "%s, Alloc Tax Rate: %.1fx",
+ log_info(gc, ergo)("Pacer for Update Refs. Used: %zu%s, Free: %zu%s, "
+ "Non-Taxable: %zu%s, Alloc Tax Rate: %.1fx",
byte_size_in_proper_unit(used), proper_unit_for_byte_size(used),
byte_size_in_proper_unit(free), proper_unit_for_byte_size(free),
byte_size_in_proper_unit(non_taxable), proper_unit_for_byte_size(non_taxable),
@@ -148,7 +148,7 @@ void ShenandoahPacer::setup_for_idle() {
restart_with(initial, tax);
- log_info(gc, ergo)("Pacer for Idle. Initial: " SIZE_FORMAT "%s, Alloc Tax Rate: %.1fx",
+ log_info(gc, ergo)("Pacer for Idle. Initial: %zu%s, Alloc Tax Rate: %.1fx",
byte_size_in_proper_unit(initial), proper_unit_for_byte_size(initial),
tax);
}
@@ -164,7 +164,7 @@ void ShenandoahPacer::setup_for_reset() {
size_t initial = _heap->max_capacity();
restart_with(initial, 1.0);
- log_info(gc, ergo)("Pacer for Reset. Non-Taxable: " SIZE_FORMAT "%s",
+ log_info(gc, ergo)("Pacer for Reset. Non-Taxable: %zu%s",
byte_size_in_proper_unit(initial), proper_unit_for_byte_size(initial));
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp
index 44ad2700f8704..fd922d5572960 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp
@@ -97,13 +97,13 @@ class ShenandoahPacer : public CHeapObj {
void setup_for_idle();
void setup_for_mark();
void setup_for_evac();
- void setup_for_updaterefs();
+ void setup_for_update_refs();
void setup_for_reset();
inline void report_mark(size_t words);
inline void report_evac(size_t words);
- inline void report_updaterefs(size_t words);
+ inline void report_update_refs(size_t words);
inline void report_alloc(size_t words);
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp
index 38ce12437a38d..881b8a9590ac7 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.inline.hpp
@@ -38,7 +38,7 @@ inline void ShenandoahPacer::report_evac(size_t words) {
report_internal(words);
}
-inline void ShenandoahPacer::report_updaterefs(size_t words) {
+inline void ShenandoahPacer::report_update_refs(size_t words) {
report_internal(words);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.cpp b/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.cpp
index bc2c0b54b5ae5..99c739026cc7d 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.cpp
@@ -23,7 +23,6 @@
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahCodeRoots.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp
index f247308ec560d..b25edfd3cb700 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/workerDataArray.inline.hpp"
#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp
index 4c8cb8c20570d..7a8fed9f54837 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp
@@ -146,7 +146,7 @@ class outputStream;
f(degen_gc_final_rebuild_freeset, " Rebuild Free Set") \
f(degen_gc_stw_evac, " Evacuation") \
f(degen_gc_init_update_refs_manage_gclabs, " Manage GCLABs") \
- f(degen_gc_updaterefs, " Update References") \
+ f(degen_gc_update_refs, " Update References") \
f(degen_gc_final_update_refs_finish_work, " Finish Work") \
f(degen_gc_final_update_refs_update_region_states," Update Region States") \
f(degen_gc_final_update_refs_trash_cset, " Trash Collection Set") \
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp
index 07d2fd3c4e342..04d38d97f61af 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Red Hat, Inc. and/or its affiliates.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/shared/workerThread.hpp"
#include "gc/shenandoah/shenandoahGeneration.hpp"
@@ -673,10 +672,10 @@ void ShenandoahReferenceProcessor::collect_statistics() {
discovered[REF_FINAL],
discovered[REF_PHANTOM]);
- log_info(gc,ref)("Encountered references: Soft: " SIZE_FORMAT ", Weak: " SIZE_FORMAT ", Final: " SIZE_FORMAT ", Phantom: " SIZE_FORMAT,
+ log_info(gc,ref)("Encountered references: Soft: %zu, Weak: %zu, Final: %zu, Phantom: %zu",
encountered[REF_SOFT], encountered[REF_WEAK], encountered[REF_FINAL], encountered[REF_PHANTOM]);
- log_info(gc,ref)("Discovered references: Soft: " SIZE_FORMAT ", Weak: " SIZE_FORMAT ", Final: " SIZE_FORMAT ", Phantom: " SIZE_FORMAT,
+ log_info(gc,ref)("Discovered references: Soft: %zu, Weak: %zu, Final: %zu, Phantom: %zu",
discovered[REF_SOFT], discovered[REF_WEAK], discovered[REF_FINAL], discovered[REF_PHANTOM]);
- log_info(gc,ref)("Enqueued references: Soft: " SIZE_FORMAT ", Weak: " SIZE_FORMAT ", Final: " SIZE_FORMAT ", Phantom: " SIZE_FORMAT,
+ log_info(gc,ref)("Enqueued references: Soft: %zu, Weak: %zu, Final: %zu, Phantom: %zu",
enqueued[REF_SOFT], enqueued[REF_WEAK], enqueued[REF_FINAL], enqueued[REF_PHANTOM]);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp
index f8e0e7125acdb..7ed2803f87714 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
#include "gc/shenandoah/mode/shenandoahMode.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
index 804d643e753be..b3b5109f6b376 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp
index b9d7b34cc7c10..3fbf3e8d6d5f7 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp
@@ -24,7 +24,6 @@
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp
index b217c641824c2..2984debd9f861 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
#include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
#include "gc/shenandoah/shenandoahRuntime.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
index ec00167f0e3b8..547ebb1a2296f 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahSATBMarkQueueSet.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp
index 1b565006f7417..c2bfea664fdcf 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp
@@ -24,7 +24,6 @@
*/
-#include "precompiled.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/taskTerminator.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.cpp b/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.cpp
index 5f09801b92951..b9f52909cbe9f 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,9 +23,6 @@
*
*/
-
-#include "precompiled.hpp"
-
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahOldGeneration.hpp"
@@ -686,7 +684,7 @@ void ShenandoahScanRememberedTask::do_work(uint worker_id) {
while (_work_list->next(&assignment)) {
ShenandoahHeapRegion* region = assignment._r;
log_debug(gc)("ShenandoahScanRememberedTask::do_work(%u), processing slice of region "
- SIZE_FORMAT " at offset " SIZE_FORMAT ", size: " SIZE_FORMAT,
+ "%zu at offset %zu, size: %zu",
worker_id, region->index(), assignment._chunk_offset, assignment._chunk_size);
if (region->is_old()) {
size_t cluster_size =
@@ -856,7 +854,7 @@ ShenandoahRegionChunkIterator::ShenandoahRegionChunkIterator(ShenandoahHeap* hea
{
#ifdef ASSERT
size_t expected_chunk_size_words = _clusters_in_smallest_chunk * CardTable::card_size_in_words() * ShenandoahCardCluster::CardsPerCluster;
- assert(smallest_chunk_size_words() == expected_chunk_size_words, "_smallest_chunk_size (" SIZE_FORMAT") is not valid because it does not equal (" SIZE_FORMAT ")",
+ assert(smallest_chunk_size_words() == expected_chunk_size_words, "_smallest_chunk_size (%zu) is not valid because it does not equal (%zu)",
smallest_chunk_size_words(), expected_chunk_size_words);
#endif
assert(_num_groups <= _maximum_groups,
@@ -897,13 +895,13 @@ ShenandoahRegionChunkIterator::ShenandoahRegionChunkIterator(ShenandoahHeap* hea
}
if (_group_entries[_num_groups-1] < _total_chunks) {
assert((_total_chunks - _group_entries[_num_groups-1]) * _group_chunk_size[_num_groups-1] + previous_group_span ==
- heap->num_regions() * words_in_region, "Total region chunks (" SIZE_FORMAT
- ") do not span total heap regions (" SIZE_FORMAT ")", _total_chunks, _heap->num_regions());
+ heap->num_regions() * words_in_region, "Total region chunks (%zu"
+ ") do not span total heap regions (%zu)", _total_chunks, _heap->num_regions());
previous_group_span += (_total_chunks - _group_entries[_num_groups-1]) * _group_chunk_size[_num_groups-1];
_group_entries[_num_groups-1] = _total_chunks;
}
- assert(previous_group_span == heap->num_regions() * words_in_region, "Total region chunks (" SIZE_FORMAT
- ") do not span total heap regions (" SIZE_FORMAT "): " SIZE_FORMAT " does not equal " SIZE_FORMAT,
+ assert(previous_group_span == heap->num_regions() * words_in_region, "Total region chunks (%zu"
+ ") do not span total heap regions (%zu): %zu does not equal %zu",
_total_chunks, _heap->num_regions(), previous_group_span, heap->num_regions() * words_in_region);
// Not necessary, but keeps things tidy
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.inline.hpp
index ec00adc4040b1..b0fc55631e067 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.inline.hpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -69,8 +70,8 @@ void ShenandoahScanRemembered::process_clusters(size_t first_cluster, size_t cou
const size_t whole_cards = (end_addr - start_addr + CardTable::card_size_in_words() - 1)/CardTable::card_size_in_words();
const size_t end_card_index = start_card_index + whole_cards - 1;
- log_debug(gc, remset)("Worker %u: cluster = " SIZE_FORMAT " count = " SIZE_FORMAT " eor = " INTPTR_FORMAT
- " start_addr = " INTPTR_FORMAT " end_addr = " INTPTR_FORMAT " cards = " SIZE_FORMAT,
+ log_debug(gc, remset)("Worker %u: cluster = %zu count = %zu eor = " INTPTR_FORMAT
+ " start_addr = " INTPTR_FORMAT " end_addr = " INTPTR_FORMAT " cards = %zu",
worker_id, first_cluster, count, p2i(end_of_range), p2i(start_addr), p2i(end_addr), whole_cards);
// use_write_table states whether we are using the card table that is being
@@ -341,7 +342,7 @@ ShenandoahScanRemembered::process_region_slice(ShenandoahHeapRegion *region, siz
}
}
- log_debug(gc)("Remembered set scan processing Region " SIZE_FORMAT ", from " PTR_FORMAT " to " PTR_FORMAT ", using %s table",
+ log_debug(gc)("Remembered set scan processing Region %zu, from " PTR_FORMAT " to " PTR_FORMAT ", using %s table",
region->index(), p2i(start_of_range), p2i(end_of_range),
use_write_table? "read/write (updating)": "read (marking)");
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp
index 127e6324fb01e..3f4bbafb755e3 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp
@@ -1,5 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahSimpleBitMap.inline.hpp"
ShenandoahSimpleBitMap::ShenandoahSimpleBitMap(size_t num_bits) :
@@ -95,7 +95,7 @@ size_t ShenandoahSimpleBitMap::count_trailing_ones(idx_t last_idx) const {
bool ShenandoahSimpleBitMap::is_forward_consecutive_ones(idx_t start_idx, idx_t count) const {
while (count > 0) {
- assert((start_idx >= 0) && (start_idx < _num_bits), "precondition: start_idx: " SSIZE_FORMAT ", count: " SSIZE_FORMAT,
+ assert((start_idx >= 0) && (start_idx < _num_bits), "precondition: start_idx: %zd, count: %zd",
start_idx, count);
assert(start_idx + count <= (idx_t) _num_bits, "precondition");
size_t array_idx = start_idx >> LogBitsPerWord;
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahStackWatermark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahStackWatermark.cpp
index df05604762268..73449bdae54d1 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahStackWatermark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahStackWatermark.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, Red Hat, Inc. All rights reserved.
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp
index eb185c197bd5d..637bbfcb898a6 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.cpp b/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.cpp
index 3901e0c7b7f1a..afeba3dbbf7db 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.cpp
@@ -23,8 +23,6 @@
*
*/
-#include "precompiled.hpp"
-
#include "gc/shenandoah/mode/shenandoahMode.hpp"
#include "gc/shenandoah/shenandoahEvacTracker.hpp"
#include "gc/shenandoah/shenandoahGenerationalHeap.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.hpp b/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.hpp
index c226b1ad2545e..9e1777dd82c4f 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.hpp
@@ -111,12 +111,18 @@ class ShenandoahThreadLocalData {
}
static char gc_state(Thread* thread) {
- assert(thread->is_Java_thread(), "GC state is only synchronized to java threads");
return data(thread)->_gc_state;
}
+ static bool is_gc_state(Thread* thread, ShenandoahHeap::GCState state) {
+ return (gc_state(thread) & state) != 0;
+ }
+
+ static bool is_gc_state(ShenandoahHeap::GCState state) {
+ return is_gc_state(Thread::current(), state);
+ }
+
static void initialize_gclab(Thread* thread) {
- assert (thread->is_Java_thread() || thread->is_Worker_thread(), "Only Java and GC worker threads are allowed to get GCLABs");
assert(data(thread)->_gclab == nullptr, "Only initialize once");
data(thread)->_gclab = new PLAB(PLAB::min_size());
data(thread)->_gclab_size = 0;
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTrace.cpp b/src/hotspot/share/gc/shenandoah/shenandoahTrace.cpp
index 0e6453c9b358c..f1afcca34934a 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahTrace.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTrace.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahEvacInfo.hpp"
#include "gc/shenandoah/shenandoahTrace.hpp"
#include "jfr/jfrEvents.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUncommitThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahUncommitThread.cpp
index 85bb3349d5c97..5f9bc7c9b91c5 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahUncommitThread.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahUncommitThread.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
#include "gc/shenandoah/shenandoahUncommitThread.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp b/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp
index f33b76bcd4e1c..24fb56b80377c 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/systemDictionary.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp
index 518cb325efbc1..ecca550d5532c 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "gc/shared/gcCause.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
index da32601eed7f0..30a677fc12684 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahConcurrentGC.hpp"
#include "gc/shenandoah/shenandoahDegeneratedGC.hpp"
@@ -82,47 +81,47 @@ void VM_ShenandoahInitMark::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Init Mark", SvcGCMarker::CONCURRENT);
set_active_generation();
_gc->entry_init_mark();
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
void VM_ShenandoahFinalMarkStartEvac::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Final Mark", SvcGCMarker::CONCURRENT);
set_active_generation();
_gc->entry_final_mark();
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
void VM_ShenandoahFullGC::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Full GC", SvcGCMarker::FULL);
set_active_generation();
_full_gc->entry_full(_gc_cause);
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
void VM_ShenandoahDegeneratedGC::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Degenerated GC", SvcGCMarker::CONCURRENT);
set_active_generation();
_gc->entry_degenerated();
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
void VM_ShenandoahInitUpdateRefs::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Init Update Refs", SvcGCMarker::CONCURRENT);
set_active_generation();
- _gc->entry_init_updaterefs();
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ _gc->entry_init_update_refs();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
void VM_ShenandoahFinalUpdateRefs::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Final Update Refs", SvcGCMarker::CONCURRENT);
set_active_generation();
- _gc->entry_final_updaterefs();
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ _gc->entry_final_update_refs();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
void VM_ShenandoahFinalRoots::doit() {
ShenandoahGCPauseMark mark(_gc_id, "Final Roots", SvcGCMarker::CONCURRENT);
set_active_generation();
_gc->entry_final_roots();
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp
index bde8638140b52..db752395c1bfd 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2017, 2021, Red Hat, Inc. All rights reserved.
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
@@ -23,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/tlab_globals.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahForwarding.inline.hpp"
@@ -383,7 +383,7 @@ class ShenandoahCalculateRegionStatsClosure : public ShenandoahHeapRegionClosure
_trashed_regions++;
}
_regions++;
- log_debug(gc)("ShenandoahCalculateRegionStatsClosure: adding " SIZE_FORMAT " for %s Region " SIZE_FORMAT ", yielding: " SIZE_FORMAT,
+ log_debug(gc)("ShenandoahCalculateRegionStatsClosure: adding %zu for %s Region %zu, yielding: %zu",
r->used(), (r->is_humongous() ? "humongous" : "regular"), r->index(), _used);
}
@@ -422,7 +422,7 @@ class ShenandoahGenerationStatsClosure : public ShenandoahHeapRegionClosure {
}
static void log_usage(ShenandoahGeneration* generation, ShenandoahCalculateRegionStatsClosure& stats) {
- log_debug(gc)("Safepoint verification: %s verified usage: " SIZE_FORMAT "%s, recorded usage: " SIZE_FORMAT "%s",
+ log_debug(gc)("Safepoint verification: %s verified usage: %zu%s, recorded usage: %zu%s",
generation->name(),
byte_size_in_proper_unit(generation->used()), proper_unit_for_byte_size(generation->used()),
byte_size_in_proper_unit(stats.used()), proper_unit_for_byte_size(stats.used()));
@@ -443,12 +443,12 @@ class ShenandoahGenerationStatsClosure : public ShenandoahHeapRegionClosure {
label, generation->name(), PROPERFMTARGS(generation_used), PROPERFMTARGS(stats.used()));
guarantee(stats.regions() == generation_used_regions,
- "%s: generation (%s) used regions (" SIZE_FORMAT ") must equal regions that are in use (" SIZE_FORMAT ")",
+ "%s: generation (%s) used regions (%zu) must equal regions that are in use (%zu)",
label, generation->name(), generation->used_regions(), stats.regions());
size_t generation_capacity = generation->max_capacity();
guarantee(stats.non_trashed_span() <= generation_capacity,
- "%s: generation (%s) size spanned by regions (" SIZE_FORMAT ") * region size (" PROPERFMT
+ "%s: generation (%s) size spanned by regions (%zu) * region size (" PROPERFMT
") must not exceed current capacity (" PROPERFMT ")",
label, generation->name(), stats.regions(), PROPERFMTARGS(ShenandoahHeapRegion::region_size_bytes()),
PROPERFMTARGS(generation_capacity));
@@ -796,12 +796,12 @@ void ShenandoahVerifier::verify_at_safepoint(const char* label,
guarantee(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "only when nothing else happens");
guarantee(ShenandoahVerify, "only when enabled, and bitmap is initialized in ShenandoahHeap::initialize");
- ShenandoahHeap::heap()->propagate_gc_state_to_java_threads();
+ ShenandoahHeap::heap()->propagate_gc_state_to_all_threads();
// Avoid side-effect of changing workers' active thread count, but bypass concurrent/parallel protocol check
ShenandoahPushWorkerScope verify_worker_scope(_heap->workers(), _heap->max_workers(), false /*bypass check*/);
- log_info(gc,start)("Verify %s, Level " INTX_FORMAT, label, ShenandoahVerifyLevel);
+ log_info(gc,start)("Verify %s, Level %zd", label, ShenandoahVerifyLevel);
// GC state checks
{
@@ -817,7 +817,7 @@ void ShenandoahVerifier::verify_at_safepoint(const char* label,
break;
case _verify_gcstate_updating:
enabled = true;
- expected = ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::UPDATEREFS;
+ expected = ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::UPDATE_REFS;
break;
case _verify_gcstate_stable:
enabled = true;
@@ -871,14 +871,14 @@ void ShenandoahVerifier::verify_at_safepoint(const char* label,
}
if (sizeness != _verify_size_disable) {
guarantee(cl.used() == heap_used,
- "%s: heap used size must be consistent: heap-used = " SIZE_FORMAT "%s, regions-used = " SIZE_FORMAT "%s",
+ "%s: heap used size must be consistent: heap-used = %zu%s, regions-used = %zu%s",
label,
byte_size_in_proper_unit(heap_used), proper_unit_for_byte_size(heap_used),
byte_size_in_proper_unit(cl.used()), proper_unit_for_byte_size(cl.used()));
}
size_t heap_committed = _heap->committed();
guarantee(cl.committed() == heap_committed,
- "%s: heap committed size must be consistent: heap-committed = " SIZE_FORMAT "%s, regions-committed = " SIZE_FORMAT "%s",
+ "%s: heap committed size must be consistent: heap-committed = %zu%s, regions-committed = %zu%s",
label,
byte_size_in_proper_unit(heap_committed), proper_unit_for_byte_size(heap_committed),
byte_size_in_proper_unit(cl.committed()), proper_unit_for_byte_size(cl.committed()));
@@ -1025,7 +1025,7 @@ void ShenandoahVerifier::verify_at_safepoint(const char* label,
if (reg_live != verf_live) {
stringStream ss;
r->print_on(&ss);
- fatal("%s: Live data should match: region-live = " SIZE_FORMAT ", verifier-live = " UINT32_FORMAT "\n%s",
+ fatal("%s: Live data should match: region-live = %zu, verifier-live = " UINT32_FORMAT "\n%s",
label, reg_live, verf_live, ss.freeze());
}
}
@@ -1034,7 +1034,7 @@ void ShenandoahVerifier::verify_at_safepoint(const char* label,
log_debug(gc)("Safepoint verification finished accumulation of liveness data");
- log_info(gc)("Verify %s, Level " INTX_FORMAT " (" SIZE_FORMAT " reachable, " SIZE_FORMAT " marked)",
+ log_info(gc)("Verify %s, Level %zd (%zu reachable, %zu marked)",
label, ShenandoahVerifyLevel, count_reachable, count_marked);
FREE_C_HEAP_ARRAY(ShenandoahLivenessData, ld);
@@ -1113,7 +1113,7 @@ void ShenandoahVerifier::verify_before_evacuation() {
);
}
-void ShenandoahVerifier::verify_before_updaterefs() {
+void ShenandoahVerifier::verify_before_update_refs() {
verify_at_safepoint(
"Before Updating References",
_verify_remembered_before_updating_references, // verify read-write remembered set
@@ -1128,7 +1128,7 @@ void ShenandoahVerifier::verify_before_updaterefs() {
}
// We have not yet cleanup (reclaimed) the collection set
-void ShenandoahVerifier::verify_after_updaterefs() {
+void ShenandoahVerifier::verify_after_update_refs() {
verify_at_safepoint(
"After Updating References",
_verify_remembered_disable, // do not verify remembered set
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp
index e49b7b43376bc..a6076ed176bc8 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp
@@ -214,8 +214,8 @@ class ShenandoahVerifier : public CHeapObj {
void verify_after_concmark();
void verify_after_concmark_with_promotions();
void verify_before_evacuation();
- void verify_before_updaterefs();
- void verify_after_updaterefs();
+ void verify_before_update_refs();
+ void verify_after_update_refs();
void verify_before_fullgc();
void verify_after_fullgc();
void verify_after_degenerated();
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkGroup.cpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkGroup.cpp
index 4a49d28ea861b..d6c47339f28a9 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahWorkGroup.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkGroup.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2017, 2021, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
@@ -73,7 +73,6 @@ ShenandoahPushWorkerScope::~ShenandoahPushWorkerScope() {
}
void ShenandoahWorkerThreads::on_create_worker(WorkerThread* worker) {
- ShenandoahThreadLocalData::create(worker);
if (_initialize_gclab) {
ShenandoahThreadLocalData::initialize_gclab(worker);
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp
index 30651f0ccf1a4..87095e87406f3 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp
index 59c33a015c24f..8663515d019d0 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAgeCensus.hpp"
#include "gc/shenandoah/shenandoahFreeSet.hpp"
diff --git a/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp b/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp
index 9c16714b26e3f..87bfc1f9c66c9 100644
--- a/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp
+++ b/src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIR.hpp"
#include "c1/c1_LIRAssembler.hpp"
diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
index 3f9c09f1c8c07..538e87a8f1930 100644
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/z/c2/zBarrierSetC2.hpp"
diff --git a/src/hotspot/share/gc/z/vmStructs_z.cpp b/src/hotspot/share/gc/z/vmStructs_z.cpp
index 2ae826663d222..f77253202ba0b 100644
--- a/src/hotspot/share/gc/z/vmStructs_z.cpp
+++ b/src/hotspot/share/gc/z/vmStructs_z.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/vmStructs_z.hpp"
#include "gc/z/zAddress.hpp"
diff --git a/src/hotspot/share/gc/z/zAbort.cpp b/src/hotspot/share/gc/z/zAbort.cpp
index 938e77b7d8007..7e4f23c1c7a8a 100644
--- a/src/hotspot/share/gc/z/zAbort.cpp
+++ b/src/hotspot/share/gc/z/zAbort.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAbort.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/gc/z/zAddress.cpp b/src/hotspot/share/gc/z/zAddress.cpp
index 1cd33e44a05d1..59489f62372c4 100644
--- a/src/hotspot/share/gc/z/zAddress.cpp
+++ b/src/hotspot/share/gc/z/zAddress.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddress.inline.hpp"
@@ -106,7 +105,7 @@ void ZGlobalsPointers::initialize() {
// Check max supported heap size
if (MaxHeapSize > ZAddressOffsetMax) {
vm_exit_during_initialization(
- err_msg("Java heap too large (max supported heap size is " SIZE_FORMAT "G)",
+ err_msg("Java heap too large (max supported heap size is %zuG)",
ZAddressOffsetMax / G));
}
diff --git a/src/hotspot/share/gc/z/zAddressSpaceLimit.cpp b/src/hotspot/share/gc/z/zAddressSpaceLimit.cpp
index 41ae19566b980..c737644472c6e 100644
--- a/src/hotspot/share/gc/z/zAddressSpaceLimit.cpp
+++ b/src/hotspot/share/gc/z/zAddressSpaceLimit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddressSpaceLimit.hpp"
#include "gc/z/zGlobals.hpp"
diff --git a/src/hotspot/share/gc/z/zAllocator.cpp b/src/hotspot/share/gc/z/zAllocator.cpp
index f75a67fd2117c..87e1f6f76f941 100644
--- a/src/hotspot/share/gc/z/zAllocator.cpp
+++ b/src/hotspot/share/gc/z/zAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAllocator.hpp"
#include "gc/z/zObjectAllocator.hpp"
diff --git a/src/hotspot/share/gc/z/zArguments.cpp b/src/hotspot/share/gc/z/zArguments.cpp
index 331ca9f7c9423..7c082252133cd 100644
--- a/src/hotspot/share/gc/z/zArguments.cpp
+++ b/src/hotspot/share/gc/z/zArguments.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddressSpaceLimit.hpp"
#include "gc/z/zArguments.hpp"
#include "gc/z/zCollectedHeap.hpp"
@@ -142,10 +141,6 @@ void ZArguments::initialize() {
FLAG_SET_ERGO_IF_DEFAULT(ZCollectionIntervalMajor, ZCollectionInterval);
}
- if (FLAG_IS_DEFAULT(ZFragmentationLimit)) {
- FLAG_SET_DEFAULT(ZFragmentationLimit, 5.0);
- }
-
// Set medium page size here because MaxTenuringThreshold may use it.
ZHeuristics::set_medium_page_size();
@@ -180,7 +175,7 @@ void ZArguments::initialize() {
// Large page size must match granule size
if (!FLAG_IS_DEFAULT(LargePageSizeInBytes) && LargePageSizeInBytes != ZGranuleSize) {
vm_exit_during_initialization(err_msg("Incompatible -XX:LargePageSizeInBytes, only "
- SIZE_FORMAT "M large pages are supported by ZGC",
+ "%zuM large pages are supported by ZGC",
ZGranuleSize / M));
}
diff --git a/src/hotspot/share/gc/z/zBarrier.cpp b/src/hotspot/share/gc/z/zBarrier.cpp
index 7d7f1284bdfdc..2b3f3f25fa64e 100644
--- a/src/hotspot/share/gc/z/zBarrier.cpp
+++ b/src/hotspot/share/gc/z/zBarrier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zBarrier.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zBarrierSet.cpp b/src/hotspot/share/gc/z/zBarrierSet.cpp
index 4ce591a507a67..f88a593b1c307 100644
--- a/src/hotspot/share/gc/z/zBarrierSet.cpp
+++ b/src/hotspot/share/gc/z/zBarrierSet.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zBarrierSet.hpp"
#include "gc/z/zBarrierSetAssembler.hpp"
#include "gc/z/zBarrierSetNMethod.hpp"
diff --git a/src/hotspot/share/gc/z/zBarrierSetAssembler.cpp b/src/hotspot/share/gc/z/zBarrierSetAssembler.cpp
index e68142f0778ba..b46810c7c00a2 100644
--- a/src/hotspot/share/gc/z/zBarrierSetAssembler.cpp
+++ b/src/hotspot/share/gc/z/zBarrierSetAssembler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zBarrierSetAssembler.hpp"
#include "gc/z/zThreadLocalData.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp b/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp
index 33894f166a3e9..cdb1701875679 100644
--- a/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp
+++ b/src/hotspot/share/gc/z/zBarrierSetNMethod.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/z/zAddress.hpp"
diff --git a/src/hotspot/share/gc/z/zBarrierSetRuntime.cpp b/src/hotspot/share/gc/z/zBarrierSetRuntime.cpp
index 935238c4e4f54..78376149d9082 100644
--- a/src/hotspot/share/gc/z/zBarrierSetRuntime.cpp
+++ b/src/hotspot/share/gc/z/zBarrierSetRuntime.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zBarrier.inline.hpp"
#include "gc/z/zBarrierSetRuntime.hpp"
#include "oops/access.hpp"
diff --git a/src/hotspot/share/gc/z/zBarrierSetStackChunk.cpp b/src/hotspot/share/gc/z/zBarrierSetStackChunk.cpp
index e33b86ef22b85..22b766ecd1a2d 100644
--- a/src/hotspot/share/gc/z/zBarrierSetStackChunk.cpp
+++ b/src/hotspot/share/gc/z/zBarrierSetStackChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/z/zBarrierSetStackChunk.hpp"
#include "gc/z/zContinuation.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/gc/z/zBreakpoint.cpp b/src/hotspot/share/gc/z/zBreakpoint.cpp
index f9db1d54c8cc9..00e91c2c28aab 100644
--- a/src/hotspot/share/gc/z/zBreakpoint.cpp
+++ b/src/hotspot/share/gc/z/zBreakpoint.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/concurrentGCBreakpoints.hpp"
#include "gc/z/zBreakpoint.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/hotspot/share/gc/z/zCPU.cpp b/src/hotspot/share/gc/z/zCPU.cpp
index f6aaa96476f75..8ba8ea9986365 100644
--- a/src/hotspot/share/gc/z/zCPU.cpp
+++ b/src/hotspot/share/gc/z/zCPU.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zCPU.inline.hpp"
#include "memory/padded.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zCollectedHeap.cpp b/src/hotspot/share/gc/z/zCollectedHeap.cpp
index 8afefd5a7cc1c..c43090f9699fc 100644
--- a/src/hotspot/share/gc/z/zCollectedHeap.cpp
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/gcHeapSummary.hpp"
#include "gc/shared/gcLogPrecious.hpp"
@@ -363,12 +362,12 @@ void ZCollectedHeap::print_on_error(outputStream* st) const {
st->print_cr("ZGC Globals:");
st->print_cr(" Young Collection: %s/%u", ZGeneration::young()->phase_to_string(), ZGeneration::young()->seqnum());
st->print_cr(" Old Collection: %s/%u", ZGeneration::old()->phase_to_string(), ZGeneration::old()->seqnum());
- st->print_cr(" Offset Max: " SIZE_FORMAT "%s (" PTR_FORMAT ")",
+ st->print_cr(" Offset Max: %zu%s (" PTR_FORMAT ")",
byte_size_in_exact_unit(ZAddressOffsetMax),
exact_unit_for_byte_size(ZAddressOffsetMax),
ZAddressOffsetMax);
- st->print_cr(" Page Size Small: " SIZE_FORMAT "M", ZPageSizeSmall / M);
- st->print_cr(" Page Size Medium: " SIZE_FORMAT "M", ZPageSizeMedium / M);
+ st->print_cr(" Page Size Small: %zuM", ZPageSizeSmall / M);
+ st->print_cr(" Page Size Medium: %zuM", ZPageSizeMedium / M);
st->cr();
st->print_cr("ZGC Metadata Bits:");
st->print_cr(" LoadGood: " PTR_FORMAT, ZPointerLoadGoodMask);
diff --git a/src/hotspot/share/gc/z/zContinuation.cpp b/src/hotspot/share/gc/z/zContinuation.cpp
index 3a4390b472bbd..6c02f64528c28 100644
--- a/src/hotspot/share/gc/z/zContinuation.cpp
+++ b/src/hotspot/share/gc/z/zContinuation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zBarrier.inline.hpp"
#include "gc/z/zContinuation.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zDirector.cpp b/src/hotspot/share/gc/z/zDirector.cpp
index 48e426f068aa6..f1256eecd19bf 100644
--- a/src/hotspot/share/gc/z/zDirector.cpp
+++ b/src/hotspot/share/gc/z/zDirector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zCollectedHeap.hpp"
#include "gc/z/zDirector.hpp"
@@ -194,7 +193,7 @@ static ZDriverRequest rule_minor_allocation_rate_dynamic(const ZDirectorStats& s
const double time_until_gc = time_until_oom - actual_gc_duration;
log_debug(gc, director)("Rule Minor: Allocation Rate (Dynamic GC Workers), "
- "MaxAllocRate: %.1fMB/s (+/-%.1f%%), Free: " SIZE_FORMAT "MB, GCCPUTime: %.3f, "
+ "MaxAllocRate: %.1fMB/s (+/-%.1f%%), Free: %zuMB, GCCPUTime: %.3f, "
"GCDuration: %.3fs, TimeUntilOOM: %.3fs, TimeUntilGC: %.3fs, GCWorkers: %u",
alloc_rate / M,
alloc_rate_sd_percent * 100,
@@ -288,7 +287,7 @@ static bool rule_minor_allocation_rate_static(const ZDirectorStats& stats) {
// time and end up starting the GC too late in the next interval.
const double time_until_gc = time_until_oom - gc_duration;
- log_debug(gc, director)("Rule Minor: Allocation Rate (Static GC Workers), MaxAllocRate: %.1fMB/s, Free: " SIZE_FORMAT "MB, GCDuration: %.3fs, TimeUntilGC: %.3fs",
+ log_debug(gc, director)("Rule Minor: Allocation Rate (Static GC Workers), MaxAllocRate: %.1fMB/s, Free: %zuMB, GCDuration: %.3fs, TimeUntilGC: %.3fs",
max_alloc_rate / M, free / M, gc_duration, time_until_gc);
return time_until_gc <= 0;
@@ -386,7 +385,7 @@ static bool rule_minor_high_usage(const ZDirectorStats& stats) {
const double free_percent = percent_of(free, soft_max_capacity);
auto print_function = [&](size_t free, double free_percent) {
- log_debug(gc, director)("Rule Minor: High Usage, Free: " SIZE_FORMAT "MB(%.1f%%)",
+ log_debug(gc, director)("Rule Minor: High Usage, Free: %zuMB(%.1f%%)",
free / M, free_percent);
};
@@ -430,7 +429,7 @@ static bool rule_major_warmup(const ZDirectorStats& stats) {
const double used_threshold_percent = (stats._old_stats._cycle._nwarmup_cycles + 1) * 0.1;
const size_t used_threshold = (size_t)(soft_max_capacity * used_threshold_percent);
- log_debug(gc, director)("Rule Major: Warmup %.0f%%, Used: " SIZE_FORMAT "MB, UsedThreshold: " SIZE_FORMAT "MB",
+ log_debug(gc, director)("Rule Major: Warmup %.0f%%, Used: %zuMB, UsedThreshold: %zuMB",
used_threshold_percent * 100, used / M, used_threshold / M);
return used >= used_threshold;
@@ -593,7 +592,7 @@ static bool rule_major_proactive(const ZDirectorStats& stats) {
const double time_since_last_gc_threshold = 5 * 60; // 5 minutes
if (used < used_threshold && time_since_last_gc < time_since_last_gc_threshold) {
// Don't even consider doing a proactive GC
- log_debug(gc, director)("Rule Major: Proactive, UsedUntilEnabled: " SIZE_FORMAT "MB, TimeUntilEnabled: %.3fs",
+ log_debug(gc, director)("Rule Major: Proactive, UsedUntilEnabled: %zuMB, TimeUntilEnabled: %.3fs",
(used_threshold - used) / M,
time_since_last_gc_threshold - time_since_last_gc);
return false;
diff --git a/src/hotspot/share/gc/z/zDriver.cpp b/src/hotspot/share/gc/z/zDriver.cpp
index c91de172fee46..e8f7af179cb4c 100644
--- a/src/hotspot/share/gc/z/zDriver.cpp
+++ b/src/hotspot/share/gc/z/zDriver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcCause.hpp"
#include "gc/shared/gcId.hpp"
diff --git a/src/hotspot/share/gc/z/zDriverPort.cpp b/src/hotspot/share/gc/z/zDriverPort.cpp
index 28c8fbc732cd6..02732dd149024 100644
--- a/src/hotspot/share/gc/z/zDriverPort.cpp
+++ b/src/hotspot/share/gc/z/zDriverPort.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zDriverPort.hpp"
#include "gc/z/zFuture.inline.hpp"
#include "gc/z/zList.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zErrno.cpp b/src/hotspot/share/gc/z/zErrno.cpp
index a3847181c2c84..fc9b1706ce9ee 100644
--- a/src/hotspot/share/gc/z/zErrno.cpp
+++ b/src/hotspot/share/gc/z/zErrno.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zErrno.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/gc/z/zForwarding.cpp b/src/hotspot/share/gc/z/zForwarding.cpp
index 622f271a6d309..df0e986d2c596 100644
--- a/src/hotspot/share/gc/z/zForwarding.cpp
+++ b/src/hotspot/share/gc/z/zForwarding.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zCollectedHeap.hpp"
diff --git a/src/hotspot/share/gc/z/zForwardingAllocator.cpp b/src/hotspot/share/gc/z/zForwardingAllocator.cpp
index 617745dc08d02..0b4e6c7b08c54 100644
--- a/src/hotspot/share/gc/z/zForwardingAllocator.cpp
+++ b/src/hotspot/share/gc/z/zForwardingAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zForwardingAllocator.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zGCIdPrinter.cpp b/src/hotspot/share/gc/z/zGCIdPrinter.cpp
index 80ca72e4f48de..25141264f2cd3 100644
--- a/src/hotspot/share/gc/z/zGCIdPrinter.cpp
+++ b/src/hotspot/share/gc/z/zGCIdPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zGCIdPrinter.hpp"
#include "include/jvm.h"
diff --git a/src/hotspot/share/gc/z/zGeneration.cpp b/src/hotspot/share/gc/z/zGeneration.cpp
index 655f47ba49cd8..9a2535d527f6f 100644
--- a/src/hotspot/share/gc/z/zGeneration.cpp
+++ b/src/hotspot/share/gc/z/zGeneration.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/classUnloadingContext.hpp"
@@ -361,7 +360,7 @@ void ZGeneration::log_phase_switch(Phase from, Phase to) {
index += 1;
}
- assert(index < ARRAY_SIZE(str), "OOB: " SIZE_FORMAT " < " SIZE_FORMAT, index, ARRAY_SIZE(str));
+ assert(index < ARRAY_SIZE(str), "OOB: %zu < %zu", index, ARRAY_SIZE(str));
Events::log_zgc_phase_switch("%-21s %4u", str[index], seqnum());
}
@@ -796,8 +795,8 @@ uint ZGenerationYoung::compute_tenuring_threshold(ZRelocationSetSelectorStats st
// if the GC is finding it hard to keep up with the allocation rate.
const double tenuring_threshold_raw = young_life_decay_factor * young_log_residency;
- log_trace(gc, reloc)("Young Allocated: " SIZE_FORMAT "M", young_allocated / M);
- log_trace(gc, reloc)("Young Garbage: " SIZE_FORMAT "M", young_garbage / M);
+ log_trace(gc, reloc)("Young Allocated: %zuM", young_allocated / M);
+ log_trace(gc, reloc)("Young Garbage: %zuM", young_garbage / M);
log_debug(gc, reloc)("Allocated To Garbage: %.1f", allocated_garbage_ratio);
log_trace(gc, reloc)("Young Log: %.1f", young_log);
log_trace(gc, reloc)("Young Residency Reciprocal: %.1f", young_residency_reciprocal);
diff --git a/src/hotspot/share/gc/z/zGlobals.cpp b/src/hotspot/share/gc/z/zGlobals.cpp
index 460ed4f09fe5d..2cb9a70eb7e10 100644
--- a/src/hotspot/share/gc/z/zGlobals.cpp
+++ b/src/hotspot/share/gc/z/zGlobals.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zGlobals.hpp"
size_t ZPageSizeMediumShift;
diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp
index d29a5d15795f4..7169b915cb5ee 100644
--- a/src/hotspot/share/gc/z/zHeap.cpp
+++ b/src/hotspot/share/gc/z/zHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
@@ -75,7 +74,7 @@ ZHeap::ZHeap()
// Prime cache
if (!_page_allocator.prime_cache(_old.workers(), InitialHeapSize)) {
- ZInitialize::error("Failed to allocate initial Java heap (" SIZE_FORMAT "M)", InitialHeapSize / M);
+ ZInitialize::error("Failed to allocate initial Java heap (%zuM)", InitialHeapSize / M);
return;
}
@@ -238,7 +237,7 @@ void ZHeap::undo_alloc_page(ZPage* page) {
assert(page->is_allocating(), "Invalid page state");
ZStatInc(ZCounterUndoPageAllocation);
- log_trace(gc)("Undo page allocation, thread: " PTR_FORMAT " (%s), page: " PTR_FORMAT ", size: " SIZE_FORMAT,
+ log_trace(gc)("Undo page allocation, thread: " PTR_FORMAT " (%s), page: " PTR_FORMAT ", size: %zu",
p2i(Thread::current()), ZUtils::thread_name(), p2i(page), page->size());
free_page(page, false /* allow_defragment */);
@@ -320,7 +319,7 @@ ZServiceabilityCounters* ZHeap::serviceability_counters() {
}
void ZHeap::print_on(outputStream* st) const {
- st->print_cr(" ZHeap used " SIZE_FORMAT "M, capacity " SIZE_FORMAT "M, max capacity " SIZE_FORMAT "M",
+ st->print_cr(" ZHeap used %zuM, capacity %zuM, max capacity %zuM",
used() / M,
capacity() / M,
max_capacity() / M);
diff --git a/src/hotspot/share/gc/z/zHeapIterator.cpp b/src/hotspot/share/gc/z/zHeapIterator.cpp
index e149a976add92..63bede6143ba1 100644
--- a/src/hotspot/share/gc/z/zHeapIterator.cpp
+++ b/src/hotspot/share/gc/z/zHeapIterator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/shared/barrierSet.hpp"
diff --git a/src/hotspot/share/gc/z/zHeuristics.cpp b/src/hotspot/share/gc/z/zHeuristics.cpp
index ebf979af79518..d13cdef3bb57c 100644
--- a/src/hotspot/share/gc/z/zHeuristics.cpp
+++ b/src/hotspot/share/gc/z/zHeuristics.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zCPU.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zIndexDistributor.inline.hpp b/src/hotspot/share/gc/z/zIndexDistributor.inline.hpp
index 26afdef9d052d..c582be8fcee8f 100644
--- a/src/hotspot/share/gc/z/zIndexDistributor.inline.hpp
+++ b/src/hotspot/share/gc/z/zIndexDistributor.inline.hpp
@@ -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
@@ -274,7 +274,7 @@ class ZIndexDistributorClaimTree : public CHeapObj {
assert((levels_size(ClaimLevels - 1) << _last_level_segment_size_shift) == count, "Incorrectly setup");
#if 0
- tty->print_cr("ZIndexDistributorClaimTree count: %d byte size: " SIZE_FORMAT, count, claim_variables_size() + os::vm_page_size());
+ tty->print_cr("ZIndexDistributorClaimTree count: %d byte size: %zu", count, claim_variables_size() + os::vm_page_size());
#endif
memset(_malloced, 0, claim_variables_size() + os::vm_page_size());
diff --git a/src/hotspot/share/gc/z/zInitialize.cpp b/src/hotspot/share/gc/z/zInitialize.cpp
index e37fc550bfe2a..a8d6a32a7d5ee 100644
--- a/src/hotspot/share/gc/z/zInitialize.cpp
+++ b/src/hotspot/share/gc/z/zInitialize.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zAddress.hpp"
#include "gc/z/zBarrierSet.hpp"
diff --git a/src/hotspot/share/gc/z/zJNICritical.cpp b/src/hotspot/share/gc/z/zJNICritical.cpp
index d096367e12f79..608b8f2249313 100644
--- a/src/hotspot/share/gc/z/zJNICritical.cpp
+++ b/src/hotspot/share/gc/z/zJNICritical.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zJNICritical.hpp"
#include "gc/z/zLock.inline.hpp"
#include "gc/z/zStat.hpp"
diff --git a/src/hotspot/share/gc/z/zLargePages.cpp b/src/hotspot/share/gc/z/zLargePages.cpp
index a65bf3b10ebad..56c94a75713cd 100644
--- a/src/hotspot/share/gc/z/zLargePages.cpp
+++ b/src/hotspot/share/gc/z/zLargePages.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zLargePages.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/gc/z/zLiveMap.cpp b/src/hotspot/share/gc/z/zLiveMap.cpp
index 715ebc6291724..cc7271f99a7dc 100644
--- a/src/hotspot/share/gc/z/zLiveMap.cpp
+++ b/src/hotspot/share/gc/z/zLiveMap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zGeneration.inline.hpp"
#include "gc/z/zHeap.inline.hpp"
#include "gc/z/zLiveMap.inline.hpp"
@@ -103,7 +102,7 @@ void ZLiveMap::reset_segment(BitMap::idx_t segment) {
ZStatInc(ZCounterMarkSegmentResetContention);
contention = true;
- log_trace(gc)("Mark segment reset contention, thread: " PTR_FORMAT " (%s), map: " PTR_FORMAT ", segment: " SIZE_FORMAT,
+ log_trace(gc)("Mark segment reset contention, thread: " PTR_FORMAT " (%s), map: " PTR_FORMAT ", segment: %zu",
p2i(Thread::current()), ZUtils::thread_name(), p2i(this), segment);
}
}
diff --git a/src/hotspot/share/gc/z/zMark.cpp b/src/hotspot/share/gc/z/zMark.cpp
index d33b86c83e57c..554cef8cec5fe 100644
--- a/src/hotspot/share/gc/z/zMark.cpp
+++ b/src/hotspot/share/gc/z/zMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/javaClasses.inline.hpp"
@@ -135,7 +134,7 @@ void ZMark::start() {
for (uint worker_id = 0; worker_id < _nworkers; worker_id++) {
const ZMarkStripe* const stripe = _stripes.stripe_for_worker(_nworkers, worker_id);
const size_t stripe_id = _stripes.stripe_id(stripe);
- log.print(" Worker %u(%u) -> Stripe " SIZE_FORMAT "(" SIZE_FORMAT ")",
+ log.print(" Worker %u(%u) -> Stripe %zu(%zu)",
worker_id, _nworkers, stripe_id, nstripes);
}
}
@@ -194,7 +193,7 @@ void ZMark::push_partial_array(zpointer* addr, size_t length, bool finalizable)
const uintptr_t offset = encode_partial_array_offset(addr);
const ZMarkStackEntry entry(offset, length, finalizable);
- log_develop_trace(gc, marking)("Array push partial: " PTR_FORMAT " (" SIZE_FORMAT "), stripe: " SIZE_FORMAT,
+ log_develop_trace(gc, marking)("Array push partial: " PTR_FORMAT " (%zu), stripe: %zu",
p2i(addr), length, _stripes.stripe_id(stripe));
stacks->push(&_allocator, &_stripes, stripe, &_terminate, entry, false /* publish */);
@@ -213,7 +212,7 @@ static void mark_barrier_on_oop_array(volatile zpointer* p, size_t length, bool
void ZMark::follow_array_elements_small(zpointer* addr, size_t length, bool finalizable) {
assert(length <= ZMarkPartialArrayMinLength, "Too large, should be split");
- log_develop_trace(gc, marking)("Array follow small: " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(addr), length);
+ log_develop_trace(gc, marking)("Array follow small: " PTR_FORMAT " (%zu)", p2i(addr), length);
mark_barrier_on_oop_array(addr, length, finalizable, _generation->is_young());
}
@@ -232,8 +231,8 @@ void ZMark::follow_array_elements_large(zpointer* addr, size_t length, bool fina
const size_t middle_length = align_down(end - middle_start, ZMarkPartialArrayMinLength);
zpointer* const middle_end = middle_start + middle_length;
- log_develop_trace(gc, marking)("Array follow large: " PTR_FORMAT "-" PTR_FORMAT" (" SIZE_FORMAT "), "
- "middle: " PTR_FORMAT "-" PTR_FORMAT " (" SIZE_FORMAT ")",
+ log_develop_trace(gc, marking)("Array follow large: " PTR_FORMAT "-" PTR_FORMAT" (%zu), "
+ "middle: " PTR_FORMAT "-" PTR_FORMAT " (%zu)",
p2i(start), p2i(end), length, p2i(middle_start), p2i(middle_end), middle_length);
// Push unaligned trailing part
diff --git a/src/hotspot/share/gc/z/zMarkCache.cpp b/src/hotspot/share/gc/z/zMarkCache.cpp
index 0eecfbfaa6773..c920bb897b0c1 100644
--- a/src/hotspot/share/gc/z/zMarkCache.cpp
+++ b/src/hotspot/share/gc/z/zMarkCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zMarkCache.inline.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/powerOfTwo.hpp"
diff --git a/src/hotspot/share/gc/z/zMarkStack.cpp b/src/hotspot/share/gc/z/zMarkStack.cpp
index c4938af0a5f6d..00a534d236ff2 100644
--- a/src/hotspot/share/gc/z/zMarkStack.cpp
+++ b/src/hotspot/share/gc/z/zMarkStack.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zMarkStack.inline.hpp"
#include "gc/z/zMarkStackAllocator.hpp"
#include "gc/z/zMarkTerminate.inline.hpp"
@@ -54,7 +53,7 @@ void ZMarkStripeSet::set_nstripes(size_t nstripes) {
// if they see the old or new values.
Atomic::store(&_nstripes_mask, nstripes - 1);
- log_debug(gc, marking)("Using " SIZE_FORMAT " mark stripes", nstripes);
+ log_debug(gc, marking)("Using %zu mark stripes", nstripes);
}
size_t ZMarkStripeSet::nstripes() const {
diff --git a/src/hotspot/share/gc/z/zMarkStackAllocator.cpp b/src/hotspot/share/gc/z/zMarkStackAllocator.cpp
index 2bc37a0483a36..02a903985e71c 100644
--- a/src/hotspot/share/gc/z/zMarkStackAllocator.cpp
+++ b/src/hotspot/share/gc/z/zMarkStackAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zInitialize.hpp"
#include "gc/z/zLock.inline.hpp"
@@ -79,11 +78,11 @@ size_t ZMarkStackSpace::expand_space() {
// Expansion limit reached. This is a fatal error since we
// currently can't recover from running out of mark stack space.
fatal("Mark stack space exhausted. Use -XX:ZMarkStackSpaceLimit= to increase the "
- "maximum number of bytes allocated for mark stacks. Current limit is " SIZE_FORMAT "M.",
+ "maximum number of bytes allocated for mark stacks. Current limit is %zuM.",
ZMarkStackSpaceLimit / M);
}
- log_debug(gc, marking)("Expanding mark stack space: " SIZE_FORMAT "M->" SIZE_FORMAT "M",
+ log_debug(gc, marking)("Expanding mark stack space: %zuM->%zuM",
old_size / M, new_size / M);
// Expand
@@ -100,7 +99,7 @@ size_t ZMarkStackSpace::shrink_space() {
if (shrink_size > 0) {
// Shrink
- log_debug(gc, marking)("Shrinking mark stack space: " SIZE_FORMAT "M->" SIZE_FORMAT "M",
+ log_debug(gc, marking)("Shrinking mark stack space: %zuM->%zuM",
old_size / M, new_size / M);
const uintptr_t shrink_start = _end - shrink_size;
diff --git a/src/hotspot/share/gc/z/zMemory.cpp b/src/hotspot/share/gc/z/zMemory.cpp
index 7bc6b7379c599..14578c2db8a26 100644
--- a/src/hotspot/share/gc/z/zMemory.cpp
+++ b/src/hotspot/share/gc/z/zMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zList.inline.hpp"
#include "gc/z/zLock.inline.hpp"
#include "gc/z/zMemory.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zMetronome.cpp b/src/hotspot/share/gc/z/zMetronome.cpp
index 876b1f6922799..d719017ddc45a 100644
--- a/src/hotspot/share/gc/z/zMetronome.cpp
+++ b/src/hotspot/share/gc/z/zMetronome.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zMetronome.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/timer.hpp"
diff --git a/src/hotspot/share/gc/z/zNMT.cpp b/src/hotspot/share/gc/z/zNMT.cpp
index b23452eb15647..07ea8df13252f 100644
--- a/src/hotspot/share/gc/z/zNMT.cpp
+++ b/src/hotspot/share/gc/z/zNMT.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zNMT.hpp"
diff --git a/src/hotspot/share/gc/z/zNMethod.cpp b/src/hotspot/share/gc/z/zNMethod.cpp
index 7c5b1e06edbb0..26f2ab96946db 100644
--- a/src/hotspot/share/gc/z/zNMethod.cpp
+++ b/src/hotspot/share/gc/z/zNMethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/relocInfo.hpp"
#include "code/nmethod.hpp"
diff --git a/src/hotspot/share/gc/z/zNMethodData.cpp b/src/hotspot/share/gc/z/zNMethodData.cpp
index 467553bd7a6b4..deb56340a8f07 100644
--- a/src/hotspot/share/gc/z/zNMethodData.cpp
+++ b/src/hotspot/share/gc/z/zNMethodData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zLock.inline.hpp"
#include "gc/z/zNMethodData.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/gc/z/zNMethodTable.cpp b/src/hotspot/share/gc/z/zNMethodTable.cpp
index 9714bee4bd88f..0aec0d5a9c7f4 100644
--- a/src/hotspot/share/gc/z/zNMethodTable.cpp
+++ b/src/hotspot/share/gc/z/zNMethodTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "code/relocInfo.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/barrierSet.hpp"
@@ -110,9 +109,9 @@ void ZNMethodTable::rebuild(size_t new_size) {
assert(is_power_of_2(new_size), "Invalid size");
log_debug(gc, nmethod)("Rebuilding NMethod Table: "
- SIZE_FORMAT "->" SIZE_FORMAT " entries, "
- SIZE_FORMAT "(%.0f%%->%.0f%%) registered, "
- SIZE_FORMAT "(%.0f%%->%.0f%%) unregistered",
+ "%zu->%zu entries, "
+ "%zu(%.0f%%->%.0f%%) registered, "
+ "%zu(%.0f%%->%.0f%%) unregistered",
_size, new_size,
_nregistered, percent_of(_nregistered, _size), percent_of(_nregistered, new_size),
_nunregistered, percent_of(_nunregistered, _size), 0.0);
diff --git a/src/hotspot/share/gc/z/zNMethodTableIteration.cpp b/src/hotspot/share/gc/z/zNMethodTableIteration.cpp
index d6eb728f9614d..f34f520875237 100644
--- a/src/hotspot/share/gc/z/zNMethodTableIteration.cpp
+++ b/src/hotspot/share/gc/z/zNMethodTableIteration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zNMethodTableEntry.hpp"
#include "gc/z/zNMethodTableIteration.hpp"
#include "memory/iterator.hpp"
diff --git a/src/hotspot/share/gc/z/zNUMA.cpp b/src/hotspot/share/gc/z/zNUMA.cpp
index 2ee790ede30c3..2c37b25f87bb9 100644
--- a/src/hotspot/share/gc/z/zNUMA.cpp
+++ b/src/hotspot/share/gc/z/zNUMA.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zNUMA.hpp"
diff --git a/src/hotspot/share/gc/z/zObjArrayAllocator.cpp b/src/hotspot/share/gc/z/zObjArrayAllocator.cpp
index c63b989dc4eb0..a4484ba10237b 100644
--- a/src/hotspot/share/gc/z/zObjArrayAllocator.cpp
+++ b/src/hotspot/share/gc/z/zObjArrayAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zThreadLocalData.hpp"
#include "gc/z/zObjArrayAllocator.hpp"
#include "gc/z/zUtils.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zObjectAllocator.cpp b/src/hotspot/share/gc/z/zObjectAllocator.cpp
index c088e20244ae0..81a92aa6cc646 100644
--- a/src/hotspot/share/gc/z/zObjectAllocator.cpp
+++ b/src/hotspot/share/gc/z/zObjectAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zHeap.inline.hpp"
#include "gc/z/zHeuristics.hpp"
diff --git a/src/hotspot/share/gc/z/zPage.cpp b/src/hotspot/share/gc/z/zPage.cpp
index ff56768e9ad99..5264076c8a9bf 100644
--- a/src/hotspot/share/gc/z/zPage.cpp
+++ b/src/hotspot/share/gc/z/zPage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zGeneration.inline.hpp"
#include "gc/z/zList.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zPageAllocator.cpp b/src/hotspot/share/gc/z/zPageAllocator.cpp
index ecd9f3e34b9b9..7913aa68fbe1b 100644
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/z/zArray.inline.hpp"
@@ -207,12 +206,12 @@ ZPageAllocator::ZPageAllocator(size_t min_capacity,
return;
}
- log_info_p(gc, init)("Min Capacity: " SIZE_FORMAT "M", min_capacity / M);
- log_info_p(gc, init)("Initial Capacity: " SIZE_FORMAT "M", initial_capacity / M);
- log_info_p(gc, init)("Max Capacity: " SIZE_FORMAT "M", max_capacity / M);
- log_info_p(gc, init)("Soft Max Capacity: " SIZE_FORMAT "M", soft_max_capacity / M);
+ log_info_p(gc, init)("Min Capacity: %zuM", min_capacity / M);
+ log_info_p(gc, init)("Initial Capacity: %zuM", initial_capacity / M);
+ log_info_p(gc, init)("Max Capacity: %zuM", max_capacity / M);
+ log_info_p(gc, init)("Soft Max Capacity: %zuM", soft_max_capacity / M);
if (ZPageSizeMedium > 0) {
- log_info_p(gc, init)("Medium Page Size: " SIZE_FORMAT "M", ZPageSizeMedium / M);
+ log_info_p(gc, init)("Medium Page Size: %zuM", ZPageSizeMedium / M);
} else {
log_info_p(gc, init)("Medium Page Size: N/A");
}
@@ -377,7 +376,7 @@ void ZPageAllocator::decrease_capacity(size_t size, bool set_max_capacity) {
if (set_max_capacity) {
// Adjust current max capacity to avoid further attempts to increase capacity
log_error_p(gc)("Forced to lower max Java heap size from "
- SIZE_FORMAT "M(%.0f%%) to " SIZE_FORMAT "M(%.0f%%)",
+ "%zuM(%.0f%%) to %zuM(%.0f%%)",
_current_max_capacity / M, percent_of(_current_max_capacity, _max_capacity),
_capacity / M, percent_of(_capacity, _max_capacity));
@@ -650,7 +649,7 @@ ZPage* ZPageAllocator::alloc_page_create(ZPageAllocation* allocation) {
// Update statistics
ZStatInc(ZCounterPageCacheFlush, flushed);
- log_debug(gc, heap)("Page Cache Flushed: " SIZE_FORMAT "M", flushed / M);
+ log_debug(gc, heap)("Page Cache Flushed: %zuM", flushed / M);
}
// Allocate any remaining physical memory. Capacity and used has
diff --git a/src/hotspot/share/gc/z/zPageCache.cpp b/src/hotspot/share/gc/z/zPageCache.cpp
index 163bb395560de..b689a274de06c 100644
--- a/src/hotspot/share/gc/z/zPageCache.cpp
+++ b/src/hotspot/share/gc/z/zPageCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zList.inline.hpp"
#include "gc/z/zNUMA.hpp"
diff --git a/src/hotspot/share/gc/z/zPageTable.cpp b/src/hotspot/share/gc/z/zPageTable.cpp
index 459d26e9df3f4..9a4bbc85d0450 100644
--- a/src/hotspot/share/gc/z/zPageTable.cpp
+++ b/src/hotspot/share/gc/z/zPageTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.hpp"
#include "gc/z/zGranuleMap.inline.hpp"
#include "gc/z/zPage.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zPhysicalMemory.cpp b/src/hotspot/share/gc/z/zPhysicalMemory.cpp
index a04fce2d9a9d8..541e60051c312 100644
--- a/src/hotspot/share/gc/z/zPhysicalMemory.cpp
+++ b/src/hotspot/share/gc/z/zPhysicalMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zArray.inline.hpp"
@@ -277,7 +276,7 @@ void ZPhysicalMemoryManager::try_enable_uncommit(size_t min_capacity, size_t max
}
log_info_p(gc, init)("Uncommit: Enabled");
- log_info_p(gc, init)("Uncommit Delay: " UINTX_FORMAT "s", ZUncommitDelay);
+ log_info_p(gc, init)("Uncommit Delay: %zus", ZUncommitDelay);
}
void ZPhysicalMemoryManager::alloc(ZPhysicalMemory& pmem, size_t size) {
diff --git a/src/hotspot/share/gc/z/zReferenceProcessor.cpp b/src/hotspot/share/gc/z/zReferenceProcessor.cpp
index 797bd96353687..1af4deaec0339 100644
--- a/src/hotspot/share/gc/z/zReferenceProcessor.cpp
+++ b/src/hotspot/share/gc/z/zReferenceProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "gc/shared/referencePolicy.hpp"
#include "gc/shared/referenceProcessorStats.hpp"
diff --git a/src/hotspot/share/gc/z/zRelocate.cpp b/src/hotspot/share/gc/z/zRelocate.cpp
index 7f69c0752bc5a..805044f9deb88 100644
--- a/src/hotspot/share/gc/z/zRelocate.cpp
+++ b/src/hotspot/share/gc/z/zRelocate.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/z/zAbort.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zRelocationSet.cpp b/src/hotspot/share/gc/z/zRelocationSet.cpp
index 5c82f55bbbfe7..8cc7bceb8e849 100644
--- a/src/hotspot/share/gc/z/zRelocationSet.cpp
+++ b/src/hotspot/share/gc/z/zRelocationSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zArray.inline.hpp"
#include "gc/z/zCollectedHeap.hpp"
#include "gc/z/zForwarding.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zRelocationSetSelector.cpp b/src/hotspot/share/gc/z/zRelocationSetSelector.cpp
index ec904b914fb0b..03835689ec594 100644
--- a/src/hotspot/share/gc/z/zRelocationSetSelector.cpp
+++ b/src/hotspot/share/gc/z/zRelocationSetSelector.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zArray.inline.hpp"
#include "gc/z/zForwarding.inline.hpp"
@@ -153,7 +152,7 @@ void ZRelocationSetSelectorGroup::select_inner() {
}
log_trace(gc, reloc)("Candidate Relocation Set (%s Pages): %d->%d, "
- "%.1f%% relative defragmentation, " SIZE_FORMAT " forwarding entries, %s, live %d",
+ "%.1f%% relative defragmentation, %zu forwarding entries, %s, live %d",
_name, from, to, diff_reclaimable, from_forwarding_entries,
(selected_from == from) ? "Selected" : "Rejected",
int(page_live_bytes * 100 / page->size()));
@@ -175,7 +174,7 @@ void ZRelocationSetSelectorGroup::select_inner() {
_stats[i]._npages_selected = npages_selected[i];
}
- log_debug(gc, reloc)("Relocation Set (%s Pages): %d->%d, %d skipped, " SIZE_FORMAT " forwarding entries",
+ log_debug(gc, reloc)("Relocation Set (%s Pages): %d->%d, %d skipped, %zu forwarding entries",
_name, selected_from, selected_to, npages - selected_from, selected_forwarding_entries);
}
diff --git a/src/hotspot/share/gc/z/zRemembered.cpp b/src/hotspot/share/gc/z/zRemembered.cpp
index 18657c44c5c4f..4cfc349acc47e 100644
--- a/src/hotspot/share/gc/z/zRemembered.cpp
+++ b/src/hotspot/share/gc/z/zRemembered.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zForwarding.inline.hpp"
#include "gc/z/zGeneration.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zRememberedSet.cpp b/src/hotspot/share/gc/z/zRememberedSet.cpp
index f605401648dfb..f833c5b233616 100644
--- a/src/hotspot/share/gc/z/zRememberedSet.cpp
+++ b/src/hotspot/share/gc/z/zRememberedSet.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zBitMap.inline.hpp"
#include "gc/z/zHeap.inline.hpp"
@@ -206,5 +205,5 @@ bool ZRememberedSetContainingInLiveIterator::next(ZRememberedSetContaining* cont
}
void ZRememberedSetContainingInLiveIterator::print_statistics() const {
- _page->log_msg(" (remembered iter count: " SIZE_FORMAT " skipped: " SIZE_FORMAT ")", _count, _count_skipped);
+ _page->log_msg(" (remembered iter count: %zu skipped: %zu)", _count, _count_skipped);
}
diff --git a/src/hotspot/share/gc/z/zResurrection.cpp b/src/hotspot/share/gc/z/zResurrection.cpp
index 2e7b4c7b4b98e..4e9aa0448da3f 100644
--- a/src/hotspot/share/gc/z/zResurrection.cpp
+++ b/src/hotspot/share/gc/z/zResurrection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zResurrection.hpp"
#include "runtime/atomic.hpp"
#include "runtime/safepoint.hpp"
diff --git a/src/hotspot/share/gc/z/zRootsIterator.cpp b/src/hotspot/share/gc/z/zRootsIterator.cpp
index 086d90781dd63..d5c413f593881 100644
--- a/src/hotspot/share/gc/z/zRootsIterator.cpp
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "gc/shared/oopStorageSetParState.inline.hpp"
#include "gc/z/zNMethod.hpp"
diff --git a/src/hotspot/share/gc/z/zRuntimeWorkers.cpp b/src/hotspot/share/gc/z/zRuntimeWorkers.cpp
index 488df66edc61c..f19e5cd54697a 100644
--- a/src/hotspot/share/gc/z/zRuntimeWorkers.cpp
+++ b/src/hotspot/share/gc/z/zRuntimeWorkers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zRuntimeWorkers.hpp"
diff --git a/src/hotspot/share/gc/z/zServiceability.cpp b/src/hotspot/share/gc/z/zServiceability.cpp
index 50fc172f55c02..f2a7ad2dc1aa9 100644
--- a/src/hotspot/share/gc/z/zServiceability.cpp
+++ b/src/hotspot/share/gc/z/zServiceability.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/generationCounters.hpp"
#include "gc/shared/hSpaceCounters.hpp"
#include "gc/z/zCollectedHeap.hpp"
diff --git a/src/hotspot/share/gc/z/zStackWatermark.cpp b/src/hotspot/share/gc/z/zStackWatermark.cpp
index a4962416f811f..4a50dea0cec01 100644
--- a/src/hotspot/share/gc/z/zStackWatermark.cpp
+++ b/src/hotspot/share/gc/z/zStackWatermark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zAddress.hpp"
#include "gc/z/zBarrier.inline.hpp"
#include "gc/z/zGeneration.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zStat.cpp b/src/hotspot/share/gc/z/zStat.cpp
index 96cfa7d3a3718..3fe60f48e8950 100644
--- a/src/hotspot/share/gc/z/zStat.cpp
+++ b/src/hotspot/share/gc/z/zStat.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAbort.inline.hpp"
#include "gc/z/zCollectedHeap.hpp"
@@ -48,12 +47,12 @@
#include
-#define ZSIZE_FMT SIZE_FORMAT "M(%.0f%%)"
+#define ZSIZE_FMT "%zuM(%.0f%%)"
#define ZSIZE_ARGS_WITH_MAX(size, max) ((size) / M), (percent_of(size, max))
#define ZSIZE_ARGS(size) ZSIZE_ARGS_WITH_MAX(size, ZStatHeap::max_capacity())
#define ZTABLE_ARGS_NA "%9s", "-"
-#define ZTABLE_ARGS(size) SIZE_FORMAT_W(8) "M (%.0f%%)", \
+#define ZTABLE_ARGS(size) "%8zuM (%.0f%%)", \
((size) / M), (percent_of(size, ZStatHeap::max_capacity()))
//
@@ -1448,18 +1447,18 @@ void ZStatMark::at_mark_free(size_t mark_stack_usage) {
void ZStatMark::print() {
log_info(gc, marking)("Mark: "
- SIZE_FORMAT " stripe(s), "
- SIZE_FORMAT " proactive flush(es), "
- SIZE_FORMAT " terminate flush(es), "
- SIZE_FORMAT " completion(s), "
- SIZE_FORMAT " continuation(s) ",
+ "%zu stripe(s), "
+ "%zu proactive flush(es), "
+ "%zu terminate flush(es), "
+ "%zu completion(s), "
+ "%zu continuation(s) ",
_nstripes,
_nproactiveflush,
_nterminateflush,
_ntrycomplete,
_ncontinue);
- log_info(gc, marking)("Mark Stack Usage: " SIZE_FORMAT "M", _mark_stack_usage / M);
+ log_info(gc, marking)("Mark Stack Usage: %zuM", _mark_stack_usage / M);
}
//
@@ -1544,7 +1543,7 @@ void ZStatRelocation::print_page_summary() {
}
print_summary("Large", large_summary, 0 /* in_place_count */);
- lt.print("Forwarding Usage: " SIZE_FORMAT "M", _forwarding_usage / M);
+ lt.print("Forwarding Usage: %zuM", _forwarding_usage / M);
}
void ZStatRelocation::print_age_table() {
@@ -1610,13 +1609,13 @@ void ZStatRelocation::print_age_table() {
lt.print("%s", create_age_table()
.left(ZTABLE_ARGS(total[i] - live[i]))
- .left(SIZE_FORMAT_W(7) " / " SIZE_FORMAT,
+ .left("%7zu / %zu",
_selector_stats.small(age).npages_candidates(),
_selector_stats.small(age).npages_selected())
- .left(SIZE_FORMAT_W(7) " / " SIZE_FORMAT,
+ .left("%7zu / %zu",
_selector_stats.medium(age).npages_candidates(),
_selector_stats.medium(age).npages_selected())
- .left(SIZE_FORMAT_W(7) " / " SIZE_FORMAT,
+ .left("%7zu / %zu",
_selector_stats.large(age).npages_candidates(),
_selector_stats.large(age).npages_selected())
.end());
@@ -1627,7 +1626,7 @@ void ZStatRelocation::print_age_table() {
// Stat nmethods
//
void ZStatNMethods::print() {
- log_info(gc, nmethod)("NMethods: " SIZE_FORMAT " registered, " SIZE_FORMAT " unregistered",
+ log_info(gc, nmethod)("NMethods: %zu registered, %zu unregistered",
ZNMethodTable::registered_nmethods(),
ZNMethodTable::unregistered_nmethods());
}
@@ -1638,8 +1637,8 @@ void ZStatNMethods::print() {
void ZStatMetaspace::print() {
const MetaspaceCombinedStats stats = MetaspaceUtils::get_combined_statistics();
log_info(gc, metaspace)("Metaspace: "
- SIZE_FORMAT "M used, "
- SIZE_FORMAT "M committed, " SIZE_FORMAT "M reserved",
+ "%zuM used, "
+ "%zuM committed, %zuM reserved",
stats.used() / M,
stats.committed() / M,
stats.reserved() / M);
diff --git a/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp b/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp
index 78106aad729b7..a4895ca11cc26 100644
--- a/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp
+++ b/src/hotspot/share/gc/z/zStoreBarrierBuffer.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zBarrier.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zTask.cpp b/src/hotspot/share/gc/z/zTask.cpp
index 3125b67c29a95..208a20c1914a6 100644
--- a/src/hotspot/share/gc/z/zTask.cpp
+++ b/src/hotspot/share/gc/z/zTask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zTask.hpp"
ZTask::Task::Task(ZTask* task, const char* name)
diff --git a/src/hotspot/share/gc/z/zThread.cpp b/src/hotspot/share/gc/z/zThread.cpp
index 3203da6430f35..0e5860a3951bd 100644
--- a/src/hotspot/share/gc/z/zThread.cpp
+++ b/src/hotspot/share/gc/z/zThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zThread.hpp"
#include "runtime/mutexLocker.hpp"
diff --git a/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp
index 530db62f258df..f0261f51d3c98 100644
--- a/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp
+++ b/src/hotspot/share/gc/z/zThreadLocalAllocBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/tlab_globals.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zStackWatermark.hpp"
diff --git a/src/hotspot/share/gc/z/zTracer.cpp b/src/hotspot/share/gc/z/zTracer.cpp
index 7c7fff5624ccc..6ab16f6c88693 100644
--- a/src/hotspot/share/gc/z/zTracer.cpp
+++ b/src/hotspot/share/gc/z/zTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gcId.hpp"
#include "gc/z/zGeneration.inline.hpp"
#include "gc/z/zGlobals.hpp"
diff --git a/src/hotspot/share/gc/z/zUncoloredRoot.cpp b/src/hotspot/share/gc/z/zUncoloredRoot.cpp
index 505e10628d7f8..03b9862f2a379 100644
--- a/src/hotspot/share/gc/z/zUncoloredRoot.cpp
+++ b/src/hotspot/share/gc/z/zUncoloredRoot.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zUncoloredRoot.inline.hpp"
void ZUncoloredRootClosure::do_oop(oop* p) {
diff --git a/src/hotspot/share/gc/z/zUncommitter.cpp b/src/hotspot/share/gc/z/zUncommitter.cpp
index a6a455d4a08b4..50731592108c6 100644
--- a/src/hotspot/share/gc/z/zUncommitter.cpp
+++ b/src/hotspot/share/gc/z/zUncommitter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/z/zHeap.inline.hpp"
#include "gc/z/zLock.inline.hpp"
@@ -80,7 +79,7 @@ void ZUncommitter::run_thread() {
if (uncommitted > 0) {
// Update statistics
ZStatInc(ZCounterUncommit, uncommitted);
- log_info(gc, heap)("Uncommitted: " SIZE_FORMAT "M(%.0f%%)",
+ log_info(gc, heap)("Uncommitted: %zuM(%.0f%%)",
uncommitted / M, percent_of(uncommitted, ZHeap::heap()->max_capacity()));
// Send event
diff --git a/src/hotspot/share/gc/z/zUnload.cpp b/src/hotspot/share/gc/z/zUnload.cpp
index 03827a6929dd3..3dc7ecd3edc41 100644
--- a/src/hotspot/share/gc/z/zUnload.cpp
+++ b/src/hotspot/share/gc/z/zUnload.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/systemDictionary.hpp"
#include "code/codeBehaviours.hpp"
diff --git a/src/hotspot/share/gc/z/zUnmapper.cpp b/src/hotspot/share/gc/z/zUnmapper.cpp
index b6ef40b6b059f..edd31805c49eb 100644
--- a/src/hotspot/share/gc/z/zUnmapper.cpp
+++ b/src/hotspot/share/gc/z/zUnmapper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zList.inline.hpp"
@@ -70,11 +69,11 @@ bool ZUnmapper::try_enqueue(ZPage* page) {
_warned_sync_unmapping = true;
log_warning_p(gc)("WARNING: Encountered synchronous unmapping because asynchronous unmapping could not keep up");
}
- log_debug(gc, unmap)("Synchronous unmapping " SIZE_FORMAT "M page", page->size() / M);
+ log_debug(gc, unmap)("Synchronous unmapping %zuM page", page->size() / M);
return false;
}
- log_trace(gc, unmap)("Asynchronous unmapping " SIZE_FORMAT "M page (" SIZE_FORMAT "M / " SIZE_FORMAT "M enqueued)",
+ log_trace(gc, unmap)("Asynchronous unmapping %zuM page (%zuM / %zuM enqueued)",
page->size() / M, _enqueued_bytes / M, queue_capacity() / M);
_queue.insert_last(page);
diff --git a/src/hotspot/share/gc/z/zUtils.cpp b/src/hotspot/share/gc/z/zUtils.cpp
index 7997242f39124..73d9c42d5fb16 100644
--- a/src/hotspot/share/gc/z/zUtils.cpp
+++ b/src/hotspot/share/gc/z/zUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/z/zUtils.hpp"
#include "runtime/nonJavaThread.hpp"
diff --git a/src/hotspot/share/gc/z/zVerify.cpp b/src/hotspot/share/gc/z/zVerify.cpp
index 03b50e110e4c4..8e2022d781a4c 100644
--- a/src/hotspot/share/gc/z/zVerify.cpp
+++ b/src/hotspot/share/gc/z/zVerify.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/isGCActiveMark.hpp"
@@ -515,7 +514,7 @@ static ZStoreBarrierBufferTable* z_verify_store_barrier_buffer_table = nullptr;
#define BAD_REMSET_ARG(p, ptr, addr) \
"Missing remembered set at " PTR_FORMAT " pointing at " PTR_FORMAT \
- " (" PTR_FORMAT " + " INTX_FORMAT ")" \
+ " (" PTR_FORMAT " + %zd)" \
, p2i(p), untype(ptr), untype(addr), p2i(p) - untype(addr)
class ZVerifyRemsetBeforeOopClosure : public BasicOopIterateClosure {
diff --git a/src/hotspot/share/gc/z/zVirtualMemory.cpp b/src/hotspot/share/gc/z/zVirtualMemory.cpp
index f645eef740840..ccc30626a3fd0 100644
--- a/src/hotspot/share/gc/z/zVirtualMemory.cpp
+++ b/src/hotspot/share/gc/z/zVirtualMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zAddress.inline.hpp"
@@ -138,7 +137,7 @@ size_t ZVirtualMemoryManager::reserve_discontiguous(size_t size) {
}
bool ZVirtualMemoryManager::reserve_contiguous(zoffset start, size_t size) {
- assert(is_aligned(size, ZGranuleSize), "Must be granule aligned " SIZE_FORMAT_X, size);
+ assert(is_aligned(size, ZGranuleSize), "Must be granule aligned 0x%zx", size);
// Reserve address views
const zaddress_unsafe addr = ZOffset::address_unsafe(start);
@@ -201,7 +200,7 @@ bool ZVirtualMemoryManager::reserve(size_t max_capacity) {
(contiguous ? "Contiguous" : "Discontiguous"),
(limit == ZAddressOffsetMax ? "Unrestricted" : "Restricted"),
(reserved == size ? "Complete" : "Degraded"));
- log_info_p(gc, init)("Address Space Size: " SIZE_FORMAT "M", reserved / M);
+ log_info_p(gc, init)("Address Space Size: %zuM", reserved / M);
// Record reserved
_reserved = reserved;
diff --git a/src/hotspot/share/gc/z/zWeakRootsProcessor.cpp b/src/hotspot/share/gc/z/zWeakRootsProcessor.cpp
index c40aae19a5fbc..7373f451cea3b 100644
--- a/src/hotspot/share/gc/z/zWeakRootsProcessor.cpp
+++ b/src/hotspot/share/gc/z/zWeakRootsProcessor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zBarrier.inline.hpp"
diff --git a/src/hotspot/share/gc/z/zWorkers.cpp b/src/hotspot/share/gc/z/zWorkers.cpp
index 7db603c73bae5..1e7144a0c261e 100644
--- a/src/hotspot/share/gc/z/zWorkers.cpp
+++ b/src/hotspot/share/gc/z/zWorkers.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shared/gcLogPrecious.hpp"
#include "gc/z/zHeap.inline.hpp"
diff --git a/src/hotspot/share/include/cds.h b/src/hotspot/share/include/cds.h
index eb8010d625fdc..16d9d74e3982f 100644
--- a/src/hotspot/share/include/cds.h
+++ b/src/hotspot/share/include/cds.h
@@ -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
@@ -70,6 +70,7 @@ typedef struct CDSFileMapRegion {
// (The base address is the bottom of the BM region).
size_t _ptrmap_size_in_bits;
char* _mapped_base; // Actually mapped address (null if this region is not mapped).
+ bool _in_reserved_space; // Is this region in a ReservedSpace
} CDSFileMapRegion;
// This portion of the archive file header must remain unchanged for
diff --git a/src/hotspot/share/include/jvm.h b/src/hotspot/share/include/jvm.h
index 474d5baa487bd..c2a1a3f53f6ca 100644
--- a/src/hotspot/share/include/jvm.h
+++ b/src/hotspot/share/include/jvm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,9 +29,9 @@
#include
#include "jni.h"
-#include "jvm_md.h"
#include "jvm_constants.h"
#include "jvm_io.h"
+#include "jvm_md.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/hotspot/share/interpreter/abstractInterpreter.cpp b/src/hotspot/share/interpreter/abstractInterpreter.cpp
index 616ba29c62b33..18cd9babf0592 100644
--- a/src/hotspot/share/interpreter/abstractInterpreter.cpp
+++ b/src/hotspot/share/interpreter/abstractInterpreter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "cds/metaspaceShared.hpp"
diff --git a/src/hotspot/share/interpreter/bootstrapInfo.cpp b/src/hotspot/share/interpreter/bootstrapInfo.cpp
index 44ef81666031f..c8553615d0c64 100644
--- a/src/hotspot/share/interpreter/bootstrapInfo.cpp
+++ b/src/hotspot/share/interpreter/bootstrapInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/resolutionErrors.hpp"
#include "classfile/systemDictionary.hpp"
diff --git a/src/hotspot/share/interpreter/bytecode.cpp b/src/hotspot/share/interpreter/bytecode.cpp
index a1d125ed162a5..37feb834a5d1f 100644
--- a/src/hotspot/share/interpreter/bytecode.cpp
+++ b/src/hotspot/share/interpreter/bytecode.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/bytecode.inline.hpp"
#include "interpreter/linkResolver.hpp"
#include "oops/constantPool.hpp"
diff --git a/src/hotspot/share/interpreter/bytecodeHistogram.cpp b/src/hotspot/share/interpreter/bytecodeHistogram.cpp
index 9b023f1a66272..e416aa40e7b7f 100644
--- a/src/hotspot/share/interpreter/bytecodeHistogram.cpp
+++ b/src/hotspot/share/interpreter/bytecodeHistogram.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/bytecodeHistogram.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/interpreter/bytecodeStream.cpp b/src/hotspot/share/interpreter/bytecodeStream.cpp
index 418795a856bf0..7454c74982822 100644
--- a/src/hotspot/share/interpreter/bytecodeStream.cpp
+++ b/src/hotspot/share/interpreter/bytecodeStream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/bytecodeStream.hpp"
#include "interpreter/bytecodes.hpp"
#include "runtime/handles.inline.hpp"
diff --git a/src/hotspot/share/interpreter/bytecodeTracer.cpp b/src/hotspot/share/interpreter/bytecodeTracer.cpp
index cdb53b62f8c40..f576ad2f07f15 100644
--- a/src/hotspot/share/interpreter/bytecodeTracer.cpp
+++ b/src/hotspot/share/interpreter/bytecodeTracer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classPrinter.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "interpreter/bytecodeHistogram.hpp"
@@ -105,7 +104,7 @@ class BytecodePrinter {
// the incoming method. We could lose a line of trace output.
// This is acceptable in a debug-only feature.
st->cr();
- st->print("[" UINTX_FORMAT "] ", Thread::current()->osthread()->thread_id_for_printing());
+ st->print("[%zu] ", Thread::current()->osthread()->thread_id_for_printing());
method->print_name(st);
st->cr();
_current_method = method();
@@ -128,7 +127,7 @@ class BytecodePrinter {
code == Bytecodes::_return_register_finalizer ||
(code >= Bytecodes::_ireturn && code <= Bytecodes::_return)) {
int bci = (int)(bcp - method->code_base());
- st->print("[" UINTX_FORMAT "] ", Thread::current()->osthread()->thread_id_for_printing());
+ st->print("[%zu] ", Thread::current()->osthread()->thread_id_for_printing());
if (Verbose) {
st->print("%8d %4d " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
diff --git a/src/hotspot/share/interpreter/bytecodeUtils.cpp b/src/hotspot/share/interpreter/bytecodeUtils.cpp
index 9c76a6c571b09..eb4557d6ba09d 100644
--- a/src/hotspot/share/interpreter/bytecodeUtils.cpp
+++ b/src/hotspot/share/interpreter/bytecodeUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/vmClasses.hpp"
#include "classfile/vmSymbols.hpp"
#include "gc/shared/gcLocker.hpp"
diff --git a/src/hotspot/share/interpreter/bytecodes.cpp b/src/hotspot/share/interpreter/bytecodes.cpp
index c1304df6d3413..1526b3c330e9a 100644
--- a/src/hotspot/share/interpreter/bytecodes.cpp
+++ b/src/hotspot/share/interpreter/bytecodes.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/bytecodes.hpp"
#include "memory/resourceArea.hpp"
#include "oops/method.hpp"
diff --git a/src/hotspot/share/interpreter/interpreter.cpp b/src/hotspot/share/interpreter/interpreter.cpp
index cba26f5aa6a6d..6272deea34939 100644
--- a/src/hotspot/share/interpreter/interpreter.cpp
+++ b/src/hotspot/share/interpreter/interpreter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "compiler/disassembler.hpp"
diff --git a/src/hotspot/share/interpreter/interpreter.hpp b/src/hotspot/share/interpreter/interpreter.hpp
index 85f9be5b3db04..800429913fd95 100644
--- a/src/hotspot/share/interpreter/interpreter.hpp
+++ b/src/hotspot/share/interpreter/interpreter.hpp
@@ -44,7 +44,6 @@ class InterpreterMacroAssembler;
class InterpreterCodelet: public Stub {
friend class VMStructs;
- friend class CodeCacheDumper; // possible extension [do not remove]
private:
NOT_PRODUCT(AsmRemarks _asm_remarks;) // Comments for annotating assembler output.
NOT_PRODUCT(DbgStrings _dbg_strings;) // Debug strings used in generated code.
diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp
index 9d953d9db54fd..2377c74868499 100644
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/vmClasses.hpp"
@@ -1431,38 +1430,6 @@ void SignatureHandlerLibrary::add(const methodHandle& method) {
#endif // ASSERT
}
-void SignatureHandlerLibrary::add(uint64_t fingerprint, address handler) {
- int handler_index = -1;
- // use customized signature handler
- MutexLocker mu(SignatureHandlerLibrary_lock);
- // make sure data structure is initialized
- initialize();
- fingerprint = InterpreterRuntime::normalize_fast_native_fingerprint(fingerprint);
- handler_index = _fingerprints->find(fingerprint);
- // create handler if necessary
- if (handler_index < 0) {
- if (PrintSignatureHandlers && (handler != Interpreter::slow_signature_handler())) {
- tty->cr();
- tty->print_cr("argument handler #%d at " PTR_FORMAT " for fingerprint " UINT64_FORMAT,
- _handlers->length(),
- p2i(handler),
- fingerprint);
- }
- _fingerprints->append(fingerprint);
- _handlers->append(handler);
- } else {
- if (PrintSignatureHandlers) {
- tty->cr();
- tty->print_cr("duplicate argument handler #%d for fingerprint " UINT64_FORMAT "(old: " PTR_FORMAT ", new : " PTR_FORMAT ")",
- _handlers->length(),
- fingerprint,
- p2i(_handlers->at(handler_index)),
- p2i(handler));
- }
- }
-}
-
-
BufferBlob* SignatureHandlerLibrary::_handler_blob = nullptr;
address SignatureHandlerLibrary::_handler = nullptr;
GrowableArray* SignatureHandlerLibrary::_fingerprints = nullptr;
diff --git a/src/hotspot/share/interpreter/interpreterRuntime.hpp b/src/hotspot/share/interpreter/interpreterRuntime.hpp
index 3635433f43432..3cc7a938a6aa0 100644
--- a/src/hotspot/share/interpreter/interpreterRuntime.hpp
+++ b/src/hotspot/share/interpreter/interpreterRuntime.hpp
@@ -192,7 +192,6 @@ class SignatureHandlerLibrary: public AllStatic {
public:
static void add(const methodHandle& method);
- static void add(uint64_t fingerprint, address handler);
};
#endif // SHARE_INTERPRETER_INTERPRETERRUNTIME_HPP
diff --git a/src/hotspot/share/interpreter/invocationCounter.cpp b/src/hotspot/share/interpreter/invocationCounter.cpp
index 6793ff039e060..7133d8beb62ed 100644
--- a/src/hotspot/share/interpreter/invocationCounter.cpp
+++ b/src/hotspot/share/interpreter/invocationCounter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compiler_globals.hpp"
#include "interpreter/invocationCounter.hpp"
@@ -61,7 +60,7 @@ void InvocationCounter::reset() {
void InvocationCounter::print() {
uint counter = raw_counter();
- tty->print_cr("invocation count: up = %d, limit = " INTX_FORMAT ", carry = %s",
+ tty->print_cr("invocation count: up = %d, limit = %zd, carry = %s",
extract_count(counter), limit(),
extract_carry(counter) ? "true" : "false");
}
diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp
index ca8a85c8bba5f..b26c643d15fce 100644
--- a/src/hotspot/share/interpreter/linkResolver.cpp
+++ b/src/hotspot/share/interpreter/linkResolver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/archiveUtils.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/defaultMethods.hpp"
@@ -583,7 +582,7 @@ void LinkResolver::check_method_accessability(Klass* ref_klass,
resolved_klass->is_array_klass()) {
// We need to change "protected" to "public".
assert(flags.is_protected(), "clone not protected?");
- jint new_flags = flags.as_int();
+ u2 new_flags = flags.as_method_flags();
new_flags = new_flags & (~JVM_ACC_PROTECTED);
new_flags = new_flags | JVM_ACC_PUBLIC;
flags.set_flags(new_flags);
diff --git a/src/hotspot/share/interpreter/oopMapCache.cpp b/src/hotspot/share/interpreter/oopMapCache.cpp
index 3406c85df7fe0..62ce860594b9b 100644
--- a/src/hotspot/share/interpreter/oopMapCache.cpp
+++ b/src/hotspot/share/interpreter/oopMapCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/bytecodeStream.hpp"
#include "interpreter/oopMapCache.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/interpreter/rewriter.cpp b/src/hotspot/share/interpreter/rewriter.cpp
index afc8df4b9a0a2..d64954b50bdd4 100644
--- a/src/hotspot/share/interpreter/rewriter.cpp
+++ b/src/hotspot/share/interpreter/rewriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/share/interpreter/templateInterpreter.cpp b/src/hotspot/share/interpreter/templateInterpreter.cpp
index dc3e4b67b33fd..0dd82addbfead 100644
--- a/src/hotspot/share/interpreter/templateInterpreter.cpp
+++ b/src/hotspot/share/interpreter/templateInterpreter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "interpreter/interp_masm.hpp"
diff --git a/src/hotspot/share/interpreter/templateInterpreter.hpp b/src/hotspot/share/interpreter/templateInterpreter.hpp
index 224d9b973edf7..8f118bb6ec828 100644
--- a/src/hotspot/share/interpreter/templateInterpreter.hpp
+++ b/src/hotspot/share/interpreter/templateInterpreter.hpp
@@ -88,7 +88,6 @@ class TemplateInterpreter: public AbstractInterpreter {
friend class InterpreterMacroAssembler;
friend class TemplateInterpreterGenerator;
friend class TemplateTable;
- friend class CodeCacheExtensions;
// friend class Interpreter;
public:
diff --git a/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp b/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp
index 91c302888431e..e9f1e568a19bf 100644
--- a/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp
+++ b/src/hotspot/share/interpreter/templateInterpreterGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/disassembler.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
@@ -244,7 +243,6 @@ void TemplateInterpreterGenerator::generate_all() {
set_entry_points_for_all_bytes();
// installation of code in other places in the runtime
- // (ExcutableCodeManager calls not needed to copy the entries)
set_safepoints_for_all_bytes();
{ CodeletMark cm(_masm, "deoptimization entry points");
diff --git a/src/hotspot/share/interpreter/templateTable.cpp b/src/hotspot/share/interpreter/templateTable.cpp
index 28e42ca1e02ae..55dd0bb8e0f15 100644
--- a/src/hotspot/share/interpreter/templateTable.cpp
+++ b/src/hotspot/share/interpreter/templateTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/barrierSet.hpp"
#include "interpreter/interp_masm.hpp"
#include "interpreter/templateTable.hpp"
diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
index 3f3632c0eea5d..43b618dcc1e13 100644
--- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
+++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-// no precompiled headers
#include "cds/cdsConfig.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp b/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp
index 27ea1b9706719..faa36fc1ab1f5 100644
--- a/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp
+++ b/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp
index 56e006ab25cf3..e7ba0e8f7ca7e 100644
--- a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp
+++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/vmSymbols.hpp"
#include "jfr/jfr.hpp"
diff --git a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
index c2a4016478735..8c3b895345f5a 100644
--- a/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
+++ b/src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classFileParser.hpp"
#include "classfile/classFileStream.hpp"
#include "classfile/classLoadInfo.hpp"
@@ -1322,7 +1321,7 @@ static u1* schema_extend_event_subklass_bytes(const InstanceKlass* ik,
const jint new_buffer_size = extra_stream_bytes + orig_stream_size;
u1* const new_buffer = NEW_RESOURCE_ARRAY_IN_THREAD_RETURN_NULL(THREAD, u1, new_buffer_size);
if (new_buffer == nullptr) {
- log_error(jfr, system) ("Thread local allocation (native) for " SIZE_FORMAT
+ log_error(jfr, system) ("Thread local allocation (native) for %zu"
" bytes failed in JfrEventClassTransformer::on_klass_creation", static_cast(new_buffer_size));
return nullptr;
}
@@ -1563,7 +1562,7 @@ static void cache_class_file_data(InstanceKlass* new_ik, const ClassFileStream*
JvmtiCachedClassFileData* p =
(JvmtiCachedClassFileData*)NEW_C_HEAP_ARRAY_RETURN_NULL(u1, offset_of(JvmtiCachedClassFileData, data) + stream_len, mtInternal);
if (p == nullptr) {
- log_error(jfr, system)("Allocation using C_HEAP_ARRAY for " SIZE_FORMAT " bytes failed in JfrEventClassTransformer::cache_class_file_data",
+ log_error(jfr, system)("Allocation using C_HEAP_ARRAY for %zu bytes failed in JfrEventClassTransformer::cache_class_file_data",
static_cast(offset_of(JvmtiCachedClassFileData, data) + stream_len));
return;
}
diff --git a/src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp b/src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp
index f8f975528cb47..31dd55f702d2d 100644
--- a/src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp
+++ b/src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/instrumentation/jfrJvmtiAgent.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/jni/jfrUpcalls.hpp"
@@ -103,7 +102,7 @@ static jclass* create_classes_array(jint classes_count, TRAPS) {
if (nullptr == classes) {
char error_buffer[ERROR_MSG_BUFFER_SIZE];
jio_snprintf(error_buffer, ERROR_MSG_BUFFER_SIZE,
- "Thread local allocation (native) of " SIZE_FORMAT " bytes failed "
+ "Thread local allocation (native) of %zu bytes failed "
"in retransform classes", sizeof(jclass) * classes_count);
log_error(jfr, system)("%s", error_buffer);
JfrJavaSupport::throw_out_of_memory_error(error_buffer, CHECK_NULL);
diff --git a/src/hotspot/share/jfr/jfr.cpp b/src/hotspot/share/jfr/jfr.cpp
index 1ba374ef24af9..08e2b9f66757a 100644
--- a/src/hotspot/share/jfr/jfr.cpp
+++ b/src/hotspot/share/jfr/jfr.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfr.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/leakprofiler/leakProfiler.hpp"
diff --git a/src/hotspot/share/jfr/jfr.hpp b/src/hotspot/share/jfr/jfr.hpp
index 4b34784558ef3..df19ebc5808d0 100644
--- a/src/hotspot/share/jfr/jfr.hpp
+++ b/src/hotspot/share/jfr/jfr.hpp
@@ -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
@@ -27,8 +27,8 @@
#include "jni.h"
#include "memory/allStatic.hpp"
-#include "utilities/exceptions.hpp"
#include "oops/oopsHierarchy.hpp"
+#include "utilities/exceptions.hpp"
#include "utilities/globalDefinitions.hpp"
class CallInfo;
diff --git a/src/hotspot/share/jfr/jni/jfrJavaCall.cpp b/src/hotspot/share/jfr/jni/jfrJavaCall.cpp
index 9eaf506db7309..9c0bcb415b4e0 100644
--- a/src/hotspot/share/jfr/jni/jfrJavaCall.cpp
+++ b/src/hotspot/share/jfr/jni/jfrJavaCall.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "jfr/jni/jfrJavaCall.hpp"
diff --git a/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp b/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
index 777c4ced8a33d..25badd191a5ea 100644
--- a/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
+++ b/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/modules.hpp"
#include "classfile/symbolTable.hpp"
diff --git a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp
index 143248ef714ec..e0e6979a4e6a3 100644
--- a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp
+++ b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfr.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/sampling/jfrThreadSampler.hpp"
diff --git a/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp b/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp
index 4702cbe467b6f..d131d070de5d5 100644
--- a/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp
+++ b/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJniMethod.hpp"
#include "jfr/jni/jfrJniMethodRegistration.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/jfr/jni/jfrUpcalls.cpp b/src/hotspot/share/jfr/jni/jfrUpcalls.cpp
index 1915c127b4faf..718e62a9ce816 100644
--- a/src/hotspot/share/jfr/jni/jfrUpcalls.cpp
+++ b/src/hotspot/share/jfr/jni/jfrUpcalls.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
@@ -107,7 +106,7 @@ static const size_t ERROR_MSG_BUFFER_SIZE = 256;
static void log_error_and_throw_oom(jint new_bytes_length, TRAPS) {
char error_buffer[ERROR_MSG_BUFFER_SIZE];
jio_snprintf(error_buffer, ERROR_MSG_BUFFER_SIZE,
- "Thread local allocation (native) for " SIZE_FORMAT " bytes failed in JfrUpcalls", (size_t)new_bytes_length);
+ "Thread local allocation (native) for %zu bytes failed in JfrUpcalls", (size_t)new_bytes_length);
log_error(jfr, system)("%s", error_buffer);
JfrJavaSupport::throw_out_of_memory_error(error_buffer, CHECK);
}
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp b/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp
index ea96a4ccd7aea..45fd4a7dc57dd 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/chains/bfsClosure.hpp"
#include "jfr/leakprofiler/chains/dfsClosure.hpp"
#include "jfr/leakprofiler/chains/edge.hpp"
@@ -55,7 +54,7 @@ static void log_frontier_level_summary(size_t level,
size_t edge_size) {
const size_t nof_edges_in_frontier = high_idx - low_idx;
log_trace(jfr, system)(
- "BFS front: " SIZE_FORMAT " edges: " SIZE_FORMAT " size: " SIZE_FORMAT " [KB]",
+ "BFS front: %zu edges: %zu size: %zu [KB]",
level,
nof_edges_in_frontier,
(nof_edges_in_frontier * edge_size) / K
@@ -85,14 +84,14 @@ void BFSClosure::log_dfs_fallback() const {
// additional information about DFS fallover
log_trace(jfr, system)(
- "BFS front: " SIZE_FORMAT " filled edge queue at edge: " SIZE_FORMAT,
+ "BFS front: %zu filled edge queue at edge: %zu",
_current_frontier_level,
_dfs_fallback_idx
);
const size_t nof_dfs_completed_edges = _edge_queue->bottom() - _dfs_fallback_idx;
log_trace(jfr, system)(
- "DFS to complete " SIZE_FORMAT " edges size: " SIZE_FORMAT " [KB]",
+ "DFS to complete %zu edges size: %zu [KB]",
nof_dfs_completed_edges,
(nof_dfs_completed_edges * edge_size) / K
);
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp b/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
index 4ba2e3329f818..83eee96091e00 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/chains/dfsClosure.hpp"
#include "jfr/leakprofiler/chains/edge.hpp"
#include "jfr/leakprofiler/chains/edgeStore.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edge.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edge.cpp
index d66c1c0f87024..9be7cf7596ddb 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/edge.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/edge.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "jfr/leakprofiler/chains/edge.hpp"
#include "jfr/leakprofiler/utilities/unifiedOopRef.inline.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.cpp
index 75ca304b84789..2f9a57b6dc3bb 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/chains/edgeQueue.hpp"
#include "jfr/leakprofiler/utilities/unifiedOopRef.inline.hpp"
#include "jfr/recorder/storage/jfrVirtualMemory.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp
index c08cc543f2f96..9aef92c41826a 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/chains/edgeStore.hpp"
#include "jfr/leakprofiler/chains/edgeUtils.hpp"
#include "jfr/leakprofiler/sampling/objectSample.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp
index edb87c7fc8e41..6a38553403d71 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "jfr/leakprofiler/chains/edge.hpp"
#include "jfr/leakprofiler/chains/edgeStore.hpp"
@@ -72,7 +71,7 @@ const Symbol* EdgeUtils::field_name(const Edge& edge, jshort* modifiers) {
JavaFieldStream jfs(ik);
while (!jfs.done()) {
if (offset == jfs.offset()) {
- *modifiers = jfs.access_flags().as_short();
+ *modifiers = jfs.access_flags().as_field_flags();
return jfs.name();
}
jfs.next();
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/pathToGcRootsOperation.cpp b/src/hotspot/share/jfr/leakprofiler/chains/pathToGcRootsOperation.cpp
index b6fd556a03e7b..ca7650d68763c 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/pathToGcRootsOperation.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/pathToGcRootsOperation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
#include "jfr/leakprofiler/leakProfiler.hpp"
@@ -70,9 +69,9 @@ static size_t edge_queue_memory_commit_size(size_t memory_reservation_bytes) {
}
static void log_edge_queue_summary(const EdgeQueue& edge_queue) {
- log_trace(jfr, system)("EdgeQueue reserved size total: " SIZE_FORMAT " [KB]", edge_queue.reserved_size() / K);
- log_trace(jfr, system)("EdgeQueue edges total: " SIZE_FORMAT, edge_queue.top());
- log_trace(jfr, system)("EdgeQueue liveset total: " SIZE_FORMAT " [KB]", edge_queue.live_set() / K);
+ log_trace(jfr, system)("EdgeQueue reserved size total: %zu [KB]", edge_queue.reserved_size() / K);
+ log_trace(jfr, system)("EdgeQueue edges total: %zu", edge_queue.top());
+ log_trace(jfr, system)("EdgeQueue liveset total: %zu [KB]", edge_queue.live_set() / K);
if (edge_queue.reserved_size() > 0) {
log_trace(jfr, system)("EdgeQueue commit reserve ratio: %f\n",
((double)edge_queue.live_set() / (double)edge_queue.reserved_size()));
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp
index b14bbb77d2a72..04ba9477fabdd 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/stringTable.hpp"
#include "gc/shared/oopStorage.inline.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp
index 8b28c4f797404..ffb583bc5f3e1 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Datadog, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/leakprofiler/chains/edgeStore.hpp"
#include "jfr/leakprofiler/chains/pathToGcRootsOperation.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp
index b7f9b733c0fd0..112469b9888a6 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/leakprofiler/chains/edgeStore.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.cpp
index eb898318c9709..519e81a69e230 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp
index 87851c71cdb75..ff1f9efd01787 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfrfiles/jfrTypes.hpp"
#include "jfr/leakprofiler/chains/edge.hpp"
#include "jfr/leakprofiler/chains/edgeStore.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
index 57b29a09d016f..d1ae48e4a75c9 100644
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/stringTable.hpp"
#include "gc/shared/oopStorage.inline.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp b/src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp
index 7ae0ef8b48463..a5b4babb2b197 100644
--- a/src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/leakProfiler.hpp"
#include "jfr/leakprofiler/startOperation.hpp"
#include "jfr/leakprofiler/stopOperation.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.cpp b/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.cpp
index 21d3338f51528..61cf8b7acf7ef 100644
--- a/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/sampling/objectSample.hpp"
#include "jfr/leakprofiler/sampling/objectSampler.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp b/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp
index a004bad34cde1..86b8712698bdc 100644
--- a/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/oopStorage.hpp"
#include "gc/shared/oopStorageSet.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/sampling/sampleList.cpp b/src/hotspot/share/jfr/leakprofiler/sampling/sampleList.cpp
index 28cddeee70e85..4ff95f1775675 100644
--- a/src/hotspot/share/jfr/leakprofiler/sampling/sampleList.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/sampling/sampleList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/sampling/objectSample.hpp"
#include "jfr/leakprofiler/sampling/sampleList.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.cpp b/src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.cpp
index caa77d2bbb9fd..644cd25ec8a26 100644
--- a/src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/sampling/objectSample.hpp"
#include "jfr/leakprofiler/sampling/samplePriorityQueue.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.cpp b/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.cpp
index 0ce0068d73ff5..5aa8dd9cc95a8 100644
--- a/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/utilities/granularTimer.hpp"
long GranularTimer::_granularity = 0;
diff --git a/src/hotspot/share/jfr/leakprofiler/utilities/rootType.cpp b/src/hotspot/share/jfr/leakprofiler/utilities/rootType.cpp
index f066cd5df31f2..9b06caae555b4 100644
--- a/src/hotspot/share/jfr/leakprofiler/utilities/rootType.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/rootType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/oopStorage.hpp"
#include "gc/shared/oopStorageSet.hpp"
#include "jfr/leakprofiler/utilities/rootType.hpp"
diff --git a/src/hotspot/share/jfr/metadata/metadata.xml b/src/hotspot/share/jfr/metadata/metadata.xml
index 3b5e24ca9a256..1b85cb1350cbd 100644
--- a/src/hotspot/share/jfr/metadata/metadata.xml
+++ b/src/hotspot/share/jfr/metadata/metadata.xml
@@ -46,10 +46,10 @@
$ jfr print dump.jfr
Programmatic access:
- try (var rf = new RecordingFile(Path.of("dump.jfr)) {
+ try (var rf = new RecordingFile(Path.of("dump.jfr"))) {
while (rf.hasMoreEvents()) {
RecordedEvent e = rf.readEvent();
- System.out.println(e.getName() + " " + e.getDuration()));
+ System.out.println(e.getName() + " " + e.getDuration());
}
};
!-->
diff --git a/src/hotspot/share/jfr/periodic/jfrCompilerQueueUtilization.cpp b/src/hotspot/share/jfr/periodic/jfrCompilerQueueUtilization.cpp
index 1ba31876cb91a..a9bafa99b34b5 100644
--- a/src/hotspot/share/jfr/periodic/jfrCompilerQueueUtilization.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrCompilerQueueUtilization.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compileBroker.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/jfrCompilerQueueUtilization.hpp"
@@ -88,4 +87,4 @@ void JfrCompilerQueueUtilization::send_events() {
last_sample_instant = cur_time;
}
-}
\ No newline at end of file
+}
diff --git a/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp b/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp
index 908dae2227739..ec734a505e01a 100644
--- a/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_MANAGEMENT
#include "classfile/classLoaderDataGraph.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp b/src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp
index d9b628593a423..ed0fb23f2d7b1 100644
--- a/src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/moduleEntry.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp b/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp
index 6c0584f50ff31..875db3773005f 100644
--- a/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrNativeMemoryEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/jfrNativeMemoryEvent.hpp"
#include "nmt/memTracker.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp b/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp
index 9d57cddb44808..c18248e105662 100644
--- a/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/metadata/jfrSerializer.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp b/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp
index 9d9ec751fa642..2d4b99d59abdf 100644
--- a/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/jfrNetworkUtilization.hpp"
#include "jfr/periodic/jfrOSInterface.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp
index d9aae89b99341..f22098bb52e18 100644
--- a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classLoaderStats.hpp"
#include "classfile/javaClasses.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp b/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp
index ff1d7ad280ac3..1863b1af800be 100644
--- a/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/jfrThreadCPULoadEvent.hpp"
diff --git a/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.cpp b/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.cpp
index 1b296fc4555b3..69bf10d5fd54d 100644
--- a/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.cpp
+++ b/src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/dcmd/jfrDcmds.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/jfrThreadDumpEvent.hpp"
diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp
index 5d12af6d9370e..72cad299f8b5e 100644
--- a/src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/debugInfoRec.hpp"
#include "code/nmethod.hpp"
#include "code/pcDesc.hpp"
diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
index 5cef25c54cb51..29f4c88881b23 100644
--- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaThreadStatus.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/recorder/jfrRecorder.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
index a2e887e71a32a..26b5116a59944 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp
index 02829c40a712c..04a517ff46340 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
#include "jfr/utilities/jfrBlob.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp b/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp
index 08f7d2ae87d8f..bf27fa5903172 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/jni/jfrUpcalls.hpp"
#include "jfr/recorder/checkpoint/jfrMetadataEvent.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp
index f16542d13ac39..a4817cbc87d0d 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
#include "jfr/recorder/checkpoint/types/jfrThreadGroup.hpp"
#include "jfr/utilities/jfrTypes.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp
index f6bf3e685b6e7..cdd7adebe4fd2 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "jfr/recorder/checkpoint/types/jfrThreadState.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
index 4b054a86ba143..01cad49e1835e 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp
index 20c1100994722..334bdc40cb33b 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
#include "jfr/metadata/jfrSerializer.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
index a53eaa474f3f0..8128674dc1e58 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/moduleEntry.hpp"
@@ -227,9 +226,9 @@ static traceid method_id(KlassPtr klass, MethodPtr method) {
}
template
-static s4 get_flags(const T* ptr) {
+static u2 get_flags(const T* ptr) {
assert(ptr != nullptr, "invariant");
- return ptr->access_flags().get_flags();
+ return ptr->access_flags().as_unsigned_short();
}
// Same as JVM_GetClassModifiers
@@ -968,7 +967,7 @@ static int write_method(JfrCheckpointWriter* writer, MethodPtr method, bool leak
writer->write(artifact_id(klass));
writer->write(mark_symbol(method->name(), leakp));
writer->write(mark_symbol(method->signature(), leakp));
- writer->write(static_cast(get_flags(method)));
+ writer->write(get_flags(method));
writer->write(get_visibility(method));
return 1;
}
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp
index 3db940156a800..5e70fdcb941d6 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp"
#include "jfr/utilities/jfrPredicate.hpp"
#include "jfr/utilities/jfrRelation.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp
index d2973f748729a..7006d6c865a55 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp
index 328c3a7c9e1a4..743923d674cdf 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp"
#include "jfr/support/jfrThreadId.inline.hpp"
#include "runtime/safepoint.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp
index 30f2afd880c43..e821b52870771 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp
index db0faafdc99a7..8f600431333d9 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.inline.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.hpp"
#include "jfr/recorder/service/jfrOptionSet.hpp"
diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp
index f53eecad2cf9e..b487b5e667001 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp
@@ -97,7 +97,7 @@
#define METHOD_USED_THIS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (THIS_EPOCH_METHOD_BIT)))
#define METHOD_NOT_USED_THIS_EPOCH(kls) (!(METHOD_USED_THIS_EPOCH(kls)))
#define METHOD_USED_PREVIOUS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (PREVIOUS_EPOCH_METHOD_BIT)))
-#define METHOD_USED_ANY_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (EPOCH_1_METHOD_BIT) | EPOCH_0_METHOD_BIT)))
+#define METHOD_USED_ANY_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (EPOCH_1_METHOD_BIT | EPOCH_0_METHOD_BIT)))
#define METHOD_AND_CLASS_USED_THIS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (THIS_EPOCH_METHOD_AND_CLASS_BITS)))
#define METHOD_AND_CLASS_USED_PREVIOUS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (PREVIOUS_EPOCH_METHOD_AND_CLASS_BITS)))
#define METHOD_AND_CLASS_USED_ANY_EPOCH(kls) (METHOD_USED_ANY_EPOCH(kls) && USED_ANY_EPOCH(kls))
diff --git a/src/hotspot/share/jfr/recorder/jfrEventSetting.cpp b/src/hotspot/share/jfr/recorder/jfrEventSetting.cpp
index 175ee30496576..13bb328d2f465 100644
--- a/src/hotspot/share/jfr/recorder/jfrEventSetting.cpp
+++ b/src/hotspot/share/jfr/recorder/jfrEventSetting.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/jfrEventSetting.inline.hpp"
JfrNativeSettings JfrEventSetting::_jvm_event_settings;
diff --git a/src/hotspot/share/jfr/recorder/jfrRecorder.cpp b/src/hotspot/share/jfr/recorder/jfrRecorder.cpp
index af6543e2a75ba..d6fea53fcc910 100644
--- a/src/hotspot/share/jfr/recorder/jfrRecorder.cpp
+++ b/src/hotspot/share/jfr/recorder/jfrRecorder.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/javaClasses.hpp"
#include "jfr/dcmd/jfrDcmds.hpp"
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrChunk.cpp b/src/hotspot/share/jfr/recorder/repository/jfrChunk.cpp
index a35b046e56c92..f697f19b4885d 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunk.cpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/repository/jfrChunk.hpp"
#include "jfr/recorder/service/jfrOptionSet.hpp"
#include "jfr/utilities/jfrTime.hpp"
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp
index 2940126374117..930f5be0b039b 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkRotation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/repository/jfrChunkRotation.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp b/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp
index 4b08ea6b1354e..99fbc0e69bfad 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/repository/jfrChunk.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
#include "jfr/utilities/jfrTime.hpp"
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
index eaee79497bb4d..b49ce4556c7c2 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/leakprofiler/leakProfiler.hpp"
diff --git a/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp b/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp
index 3bd1157ac359f..9f6071874d8d9 100644
--- a/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp
+++ b/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfr.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/jfrRecorder.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrEvent.cpp b/src/hotspot/share/jfr/recorder/service/jfrEvent.cpp
index aceeabcedf473..7462aa2fce1be 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrEvent.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/service/jfrEvent.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/macros.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrEventThrottler.cpp b/src/hotspot/share/jfr/recorder/service/jfrEventThrottler.cpp
index af0697b5e28ca..6b8b5f0cc8c7b 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrEventThrottler.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrEventThrottler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Datadog, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/service/jfrEventThrottler.hpp"
#include "jfr/utilities/jfrSpinlockHelper.hpp"
#include "logging/log.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp b/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp
index af17659e2ec36..a2e2a9d3cf0e3 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/service/jfrMemorySizer.hpp"
#include "logging/log.hpp"
#include "runtime/os.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp
index 4982e24e8987d..b212ee4ccba48 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/javaClasses.hpp"
#include "jfr/dcmd/jfrDcmds.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp b/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp
index cf487d48f5450..b1bddfff466a2 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/service/jfrPostBox.hpp"
#include "jfr/utilities/jfrTryLock.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp b/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
index 9f24bddcd3cd7..31b2311af6ce8 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfrfiles/jfrEventClasses.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/leakprofiler/leakProfiler.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.cpp b/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.cpp
index e1cb8e889d33e..de0a77a0c8209 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmClasses.hpp"
#include "classfile/vmSymbols.hpp"
diff --git a/src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp b/src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp
index 9742ae986de4f..d549ea55dee5a 100644
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/jfrRecorder.hpp"
#include "jfr/recorder/service/jfrPostBox.hpp"
diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilter.cpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilter.cpp
index bf10c531c637a..1eb057b564ec1 100644
--- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilter.cpp
+++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/stacktrace/jfrStackFilter.hpp"
#include "oops/method.hpp"
#include "oops/symbol.hpp"
diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.cpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.cpp
index 481dcbdc840c6..de20cd3637570 100644
--- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.cpp
+++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -23,7 +23,6 @@
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/stacktrace/jfrStackFilter.hpp"
#include "jfr/recorder/stacktrace/jfrStackFilterRegistry.hpp"
diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp
index 29cd6a17b1314..cbe686fa910ca 100644
--- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp
+++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp
index 0cb8561ad9f92..a30c0d8f2624d 100644
--- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp
+++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/metadata/jfrSerializer.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp b/src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp
index edbf5ef6981d8..5c734e5c3690b 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/storage/jfrBuffer.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrEpochStorage.inline.hpp b/src/hotspot/share/jfr/recorder/storage/jfrEpochStorage.inline.hpp
index ae52f20436d9b..230d5dd1a985b 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrEpochStorage.inline.hpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrEpochStorage.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -52,7 +52,7 @@ template class RetrievalPolicy, bool Eag
inline NodeType* JfrEpochStorageHost::acquire(size_t size, Thread* thread) {
BufferPtr buffer = mspace_acquire_to_live_list(size, _mspace, thread);
if (buffer == nullptr) {
- log_warning(jfr)("Unable to allocate " SIZE_FORMAT " bytes of %s.", _mspace->min_element_size(), "epoch storage");
+ log_warning(jfr)("Unable to allocate %zu bytes of %s.", _mspace->min_element_size(), "epoch storage");
return nullptr;
}
assert(buffer->acquired_by_self(), "invariant");
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.inline.hpp b/src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.inline.hpp
index 8812d0a8ffd80..18ed2272cfad7 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.inline.hpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -203,7 +203,7 @@ inline bool JfrMemorySpace< Client, RetrievalPolicy, FreeListType, FullListType,
// allocations are even multiples of the mspace min size
static inline size_t align_allocation_size(size_t requested_size, size_t min_element_size) {
if (requested_size > static_cast(min_intx)) {
- assert(false, "requested size: " SIZE_FORMAT " is too large", requested_size);
+ assert(false, "requested size: %zu is too large", requested_size);
return 0;
}
u8 alloc_size_bytes = min_element_size;
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrReferenceCountedStorage.cpp b/src/hotspot/share/jfr/recorder/storage/jfrReferenceCountedStorage.cpp
index ac652905c5b83..d28b7212571d9 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrReferenceCountedStorage.cpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrReferenceCountedStorage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2024, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/sampling/objectSampler.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
#include "jfr/recorder/storage/jfrReferenceCountedStorage.hpp"
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp b/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp
index 8b920d163b0da..a7a21f65944bc 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/jfrRecorder.hpp"
@@ -137,7 +136,7 @@ JfrStorageControl& JfrStorage::control() {
}
static void log_allocation_failure(const char* msg, size_t size) {
- log_warning(jfr)("Unable to allocate " SIZE_FORMAT " bytes of %s.", size, msg);
+ log_warning(jfr)("Unable to allocate %zu bytes of %s.", size, msg);
}
BufferPtr JfrStorage::acquire_thread_local(Thread* thread, size_t size /* 0 */) {
@@ -327,8 +326,8 @@ static void log_discard(size_t pre_full_count, size_t post_full_count, size_t am
if (log_is_enabled(Debug, jfr, system)) {
const size_t number_of_discards = pre_full_count - post_full_count;
if (number_of_discards > 0) {
- log_debug(jfr, system)("Cleared " SIZE_FORMAT " full buffer(s) of " SIZE_FORMAT" bytes.", number_of_discards, amount);
- log_debug(jfr, system)("Current number of full buffers " SIZE_FORMAT "", number_of_discards);
+ log_debug(jfr, system)("Cleared %zu full buffer(s) of %zu bytes.", number_of_discards, amount);
+ log_debug(jfr, system)("Current number of full buffers %zu", number_of_discards);
}
}
}
@@ -566,7 +565,7 @@ static size_t process_full(Processor& processor, JfrFullList* list, JfrStorageCo
static void log(size_t count, size_t amount, bool clear = false) {
if (log_is_enabled(Debug, jfr, system)) {
if (count > 0) {
- log_debug(jfr, system)("%s " SIZE_FORMAT " full buffer(s) of " SIZE_FORMAT" B of data%s",
+ log_debug(jfr, system)("%s %zu full buffer(s) of %zu B of data%s",
clear ? "Discarded" : "Wrote", count, amount, clear ? "." : " to chunk.");
}
}
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp b/src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp
index 7691d8bb99324..52a747fdad1bb 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/storage/jfrStorageControl.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
index 6130de655bdff..c91da0075210d 100644
--- a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
+++ b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/storage/jfrVirtualMemory.hpp"
#include "memory/memoryReserver.hpp"
#include "memory/virtualspace.hpp"
diff --git a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp
index 217b6dbddc3c4..a9e39094f7906 100644
--- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp
+++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
diff --git a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp
index f130431bcf066..f5f15be2899b2 100644
--- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp
+++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/stringpool/jfrStringPoolBuffer.hpp"
JfrStringPoolBuffer::JfrStringPoolBuffer() : JfrBuffer(), _string_count_pos(0), _string_count_top(0) {}
diff --git a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.cpp b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.cpp
index 8cbe37f1403a8..5ef64e67f0922 100644
--- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.cpp
+++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/stringpool/jfrStringPool.hpp"
#include "jfr/recorder/stringpool/jfrStringPoolWriter.hpp"
#include "jfr/writers/jfrEventWriterHost.inline.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrAdaptiveSampler.cpp b/src/hotspot/share/jfr/support/jfrAdaptiveSampler.cpp
index 9ef85ecbbe9fb..aa351a81ff3c3 100644
--- a/src/hotspot/share/jfr/support/jfrAdaptiveSampler.cpp
+++ b/src/hotspot/share/jfr/support/jfrAdaptiveSampler.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Datadog, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/support/jfrAdaptiveSampler.hpp"
#include "jfr/utilities/jfrRandom.inline.hpp"
#include "jfr/utilities/jfrSpinlockHelper.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrAllocationTracer.cpp b/src/hotspot/share/jfr/support/jfrAllocationTracer.cpp
index 8d56be89c13c2..a1245d7bafe3a 100644
--- a/src/hotspot/share/jfr/support/jfrAllocationTracer.cpp
+++ b/src/hotspot/share/jfr/support/jfrAllocationTracer.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/leakprofiler/leakProfiler.hpp"
#include "jfr/support/jfrAllocationTracer.hpp"
#include "jfr/support/jfrObjectAllocationSample.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.cpp b/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.cpp
index 4aa61bdddff7f..49b5e20e49a8b 100644
--- a/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.cpp
+++ b/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfrfiles/jfrEventIds.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp"
#include "jfr/recorder/jfrEventSetting.inline.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp b/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp
index 79bcb37e5c0e1..ef1f25c84b308 100644
--- a/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp
+++ b/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/moduleEntry.hpp"
#include "interpreter/bytecodes.hpp"
#include "jfrfiles/jfrEventIds.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrFlush.cpp b/src/hotspot/share/jfr/support/jfrFlush.cpp
index 42e4f5f45818a..0179cde3d4acb 100644
--- a/src/hotspot/share/jfr/support/jfrFlush.cpp
+++ b/src/hotspot/share/jfr/support/jfrFlush.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/jfrEventSetting.inline.hpp"
#include "jfr/recorder/storage/jfrStorage.hpp"
#include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrIntrinsics.cpp b/src/hotspot/share/jfr/support/jfrIntrinsics.cpp
index 63d0e686021f2..306e223ee2ebd 100644
--- a/src/hotspot/share/jfr/support/jfrIntrinsics.cpp
+++ b/src/hotspot/share/jfr/support/jfrIntrinsics.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.inline.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp
index 77affc69926f0..31a81e7d7b544 100644
--- a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp
+++ b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2012, 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
@@ -49,7 +49,7 @@ class JfrIntrinsicSupport : AllStatic {
#define JFR_TEMPLATES(template) \
template(jdk_jfr_internal_management_HiddenWait, "jdk/jfr/internal/management/HiddenWait") \
template(jdk_jfr_internal_JVM, "jdk/jfr/internal/JVM") \
- template(jdk_jfr_internal_event_EventWriterFactory, "jdk/jfr/internal/event/EventWriterFactory") \
+ template(jdk_jfr_internal_event_EventWriter, "jdk/jfr/internal/event/EventWriter") \
template(jdk_jfr_internal_event_EventConfiguration_signature, "Ljdk/jfr/internal/event/EventConfiguration;") \
template(getEventWriter_signature, "()Ljdk/jfr/internal/event/EventWriter;") \
template(eventConfiguration_name, "eventConfiguration") \
diff --git a/src/hotspot/share/jfr/support/jfrJdkJfrEvent.cpp b/src/hotspot/share/jfr/support/jfrJdkJfrEvent.cpp
index b8dc7a6b3b5d9..ff1f4cdd39845 100644
--- a/src/hotspot/share/jfr/support/jfrJdkJfrEvent.cpp
+++ b/src/hotspot/share/jfr/support/jfrJdkJfrEvent.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrKlassUnloading.cpp b/src/hotspot/share/jfr/support/jfrKlassUnloading.cpp
index e0f26a800ba52..31eb83e16674a 100644
--- a/src/hotspot/share/jfr/support/jfrKlassUnloading.cpp
+++ b/src/hotspot/share/jfr/support/jfrKlassUnloading.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/periodic/jfrFinalizerStatisticsEvent.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrMethodData.cpp b/src/hotspot/share/jfr/support/jfrMethodData.cpp
index af5d19c262ccb..633019106547b 100644
--- a/src/hotspot/share/jfr/support/jfrMethodData.cpp
+++ b/src/hotspot/share/jfr/support/jfrMethodData.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/support/jfrMethodData.hpp"
#include "memory/resourceArea.hpp"
#include "oops/method.inline.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrMethodLookup.cpp b/src/hotspot/share/jfr/support/jfrMethodLookup.cpp
index f83fc95d2700b..69cf6ebe0f645 100644
--- a/src/hotspot/share/jfr/support/jfrMethodLookup.cpp
+++ b/src/hotspot/share/jfr/support/jfrMethodLookup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp b/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp
index 5e80e31a9987a..2958c1130747d 100644
--- a/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp
+++ b/src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/support/jfrNativeLibraryLoadEvent.hpp"
#include "jfr/utilities/jfrTime.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp
index 55ea5225e2450..6a99271a80e14 100644
--- a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp
+++ b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2020, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "gc/shared/threadLocalAllocBuffer.inline.hpp"
#include "gc/shared/tlab_globals.hpp"
#include "jfr/jfrEvents.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrResolution.cpp b/src/hotspot/share/jfr/support/jfrResolution.cpp
index 486067c485a72..4027de2fb3d7e 100644
--- a/src/hotspot/share/jfr/support/jfrResolution.cpp
+++ b/src/hotspot/share/jfr/support/jfrResolution.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "ci/ciKlass.hpp"
#include "ci/ciMethod.hpp"
#include "classfile/vmSymbols.hpp"
@@ -182,7 +181,7 @@ static inline const Method* ljf_sender_method(JavaThread* jt) {
return ljf.method();
}
-static const char* const link_error_msg = "illegal access linking method 'jdk.jfr.internal.event.EventWriterFactory.getEventWriter(long)'";
+static const char* const link_error_msg = "illegal access linking method 'jdk.jfr.internal.event.EventWriter.getEventWriter()'";
void JfrResolution::on_runtime_resolution(const CallInfo & info, TRAPS) {
assert(info.selected_method() != nullptr, "invariant");
@@ -199,12 +198,12 @@ void JfrResolution::on_runtime_resolution(const CallInfo & info, TRAPS) {
if (method->name() != event_writer_method_name) {
return;
}
- static const Symbol* const event_writer_factory_klass_name = vmSymbols::jdk_jfr_internal_event_EventWriterFactory();
- assert(event_writer_factory_klass_name != nullptr, "invariant");
- if (info.resolved_klass()->name() != event_writer_factory_klass_name) {
+ static const Symbol* const event_writer_klass_name = vmSymbols::jdk_jfr_internal_event_EventWriter();
+ assert(event_writer_klass_name != nullptr, "invariant");
+ if (info.resolved_klass()->name() != event_writer_klass_name) {
return;
}
- // Attempting to link against jdk.jfr.internal.event.EventWriterFactory.getEventWriter().
+ // Attempting to link against jdk.jfr.internal.event.EventWriter.getEventWriter().
// The sender, i.e. the method attempting to link, is in the ljf (if one exists).
const Method* const sender = ljf_sender_method(THREAD);
if (sender == nullptr) {
@@ -228,9 +227,9 @@ void JfrResolution::on_runtime_resolution(const CallInfo & info, TRAPS) {
}
static inline bool is_compiler_linking_event_writer(const Symbol* holder, const Symbol* name) {
- static const Symbol* const event_writer_factory_klass_name = vmSymbols::jdk_jfr_internal_event_EventWriterFactory();
- assert(event_writer_factory_klass_name != nullptr, "invariant");
- if (holder != event_writer_factory_klass_name) {
+ static const Symbol* const event_writer_klass_name = vmSymbols::jdk_jfr_internal_event_EventWriter();
+ assert(event_writer_klass_name != nullptr, "invariant");
+ if (holder != event_writer_klass_name) {
return false;
}
static const Symbol* const event_writer_method_name = vmSymbols::getEventWriter_name();
diff --git a/src/hotspot/share/jfr/support/jfrStackTraceMark.cpp b/src/hotspot/share/jfr/support/jfrStackTraceMark.cpp
index d1fa55e6dde6f..ef7cb88514789 100644
--- a/src/hotspot/share/jfr/support/jfrStackTraceMark.cpp
+++ b/src/hotspot/share/jfr/support/jfrStackTraceMark.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/jfrEventSetting.inline.hpp"
#include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
#include "jfr/support/jfrStackTraceMark.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrSymbolTable.cpp b/src/hotspot/share/jfr/support/jfrSymbolTable.cpp
index e3c34e46a1a4a..3fc639ffb5cf3 100644
--- a/src/hotspot/share/jfr/support/jfrSymbolTable.cpp
+++ b/src/hotspot/share/jfr/support/jfrSymbolTable.cpp
@@ -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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.hpp"
#include "jfr/support/jfrSymbolTable.hpp"
diff --git a/src/hotspot/share/jfr/support/jfrThreadLocal.cpp b/src/hotspot/share/jfr/support/jfrThreadLocal.cpp
index 9fc6be3d4c844..e1f72606c50a2 100644
--- a/src/hotspot/share/jfr/support/jfrThreadLocal.cpp
+++ b/src/hotspot/share/jfr/support/jfrThreadLocal.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp"
diff --git a/src/hotspot/share/jfr/utilities/jfrAllocation.cpp b/src/hotspot/share/jfr/utilities/jfrAllocation.cpp
index c94765bbc8fe7..f97838c786957 100644
--- a/src/hotspot/share/jfr/utilities/jfrAllocation.cpp
+++ b/src/hotspot/share/jfr/utilities/jfrAllocation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/recorder/jfrRecorder.hpp"
#include "jfr/utilities/jfrAllocation.hpp"
#include "logging/log.hpp"
@@ -53,7 +52,7 @@ static void add(size_t alloc_size) {
if (!JfrRecorder::is_created()) {
const jlong total_allocated = atomic_add_jlong((jlong)alloc_size, &_allocated_bytes);
const jlong current_live_set = atomic_add_jlong((jlong)alloc_size, &_live_set_bytes);
- log_trace(jfr, system)("Allocation: [" SIZE_FORMAT "] bytes", alloc_size);
+ log_trace(jfr, system)("Allocation: [%zu] bytes", alloc_size);
log_trace(jfr, system)("Total alloc [" JLONG_FORMAT "] bytes", total_allocated);
log_trace(jfr, system)("Liveset: [" JLONG_FORMAT "] bytes", current_live_set);
}
@@ -63,7 +62,7 @@ static void subtract(size_t dealloc_size) {
if (!JfrRecorder::is_created()) {
const jlong total_deallocated = atomic_add_jlong((jlong)dealloc_size, &_deallocated_bytes);
const jlong current_live_set = atomic_add_jlong(((jlong)dealloc_size * -1), &_live_set_bytes);
- log_trace(jfr, system)("Deallocation: [" SIZE_FORMAT "] bytes", dealloc_size);
+ log_trace(jfr, system)("Deallocation: [%zu] bytes", dealloc_size);
log_trace(jfr, system)("Total dealloc [" JLONG_FORMAT "] bytes", total_deallocated);
log_trace(jfr, system)("Liveset: [" JLONG_FORMAT "] bytes", current_live_set);
}
@@ -77,7 +76,7 @@ static void hook_memory_deallocation(size_t dealloc_size) {
static void hook_memory_allocation(const char* allocation, size_t alloc_size) {
if (nullptr == allocation) {
if (!JfrRecorder::is_created()) {
- log_warning(jfr, system)("Memory allocation failed for size [" SIZE_FORMAT "] bytes", alloc_size);
+ log_warning(jfr, system)("Memory allocation failed for size [%zu] bytes", alloc_size);
return;
} else {
// after critical startup, fail as by default
diff --git a/src/hotspot/share/jfr/utilities/jfrBlob.cpp b/src/hotspot/share/jfr/utilities/jfrBlob.cpp
index f326ff69d4795..108c473bf363b 100644
--- a/src/hotspot/share/jfr/utilities/jfrBlob.cpp
+++ b/src/hotspot/share/jfr/utilities/jfrBlob.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/utilities/jfrBlob.hpp"
JfrBlob::JfrBlob(const u1* checkpoint, size_t size) :
diff --git a/src/hotspot/share/jfr/utilities/jfrJavaLog.cpp b/src/hotspot/share/jfr/utilities/jfrJavaLog.cpp
index 44b97488f5cb8..2f46853b042ee 100644
--- a/src/hotspot/share/jfr/utilities/jfrJavaLog.cpp
+++ b/src/hotspot/share/jfr/utilities/jfrJavaLog.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/utilities/jfrJavaLog.hpp"
#include "jfr/utilities/jfrLogTagSets.hpp"
diff --git a/src/hotspot/share/jfr/utilities/jfrThreadIterator.cpp b/src/hotspot/share/jfr/utilities/jfrThreadIterator.cpp
index 30de22c5f58a9..2425f7c43ecde 100644
--- a/src/hotspot/share/jfr/utilities/jfrThreadIterator.cpp
+++ b/src/hotspot/share/jfr/utilities/jfrThreadIterator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/support/jfrThreadLocal.hpp"
#include "jfr/utilities/jfrThreadIterator.hpp"
#include "runtime/javaThread.inline.hpp"
diff --git a/src/hotspot/share/jfr/utilities/jfrTime.cpp b/src/hotspot/share/jfr/utilities/jfrTime.cpp
index 363550a78e4c6..75c3bc5cd28ba 100644
--- a/src/hotspot/share/jfr/utilities/jfrTime.cpp
+++ b/src/hotspot/share/jfr/utilities/jfrTime.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/utilities/jfrTime.hpp"
#include "runtime/os.inline.hpp"
#if defined(X86) && !defined(ZERO)
diff --git a/src/hotspot/share/jfr/utilities/jfrTimeConverter.cpp b/src/hotspot/share/jfr/utilities/jfrTimeConverter.cpp
index 4a6ab84400a6b..2ea0fd383d6e7 100644
--- a/src/hotspot/share/jfr/utilities/jfrTimeConverter.cpp
+++ b/src/hotspot/share/jfr/utilities/jfrTimeConverter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2022, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jfr/utilities/jfrTimeConverter.hpp"
#include "jfr/utilities/jfrTime.hpp"
#include "runtime/os.inline.hpp"
diff --git a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp
index d9610bcc97005..7f2d931623b5b 100644
--- a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp
+++ b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,8 +22,6 @@
*
*/
-#include "precompiled.hpp"
-#include "jni.h"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
@@ -32,6 +30,7 @@
#include "jfr/support/jfrThreadLocal.hpp"
#include "jfr/utilities/jfrTypes.hpp"
#include "jfr/writers/jfrJavaEventWriter.hpp"
+#include "jni.h"
#include "memory/iterator.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp
index b93d6ad8cacc0..92a9a7a693e50 100644
--- a/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp
+++ b/src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -25,8 +25,8 @@
#ifndef SHARE_JFR_WRITERS_JFRJAVAEVENTWRITER_HPP
#define SHARE_JFR_WRITERS_JFRJAVAEVENTWRITER_HPP
-#include "jni.h"
#include "jfr/utilities/jfrTypes.hpp"
+#include "jni.h"
#include "memory/allStatic.hpp"
#include "utilities/exceptions.hpp"
diff --git a/src/hotspot/share/jfr/writers/jfrWriterHost.hpp b/src/hotspot/share/jfr/writers/jfrWriterHost.hpp
index 2d28e84fd298e..2d07c8239ceaf 100644
--- a/src/hotspot/share/jfr/writers/jfrWriterHost.hpp
+++ b/src/hotspot/share/jfr/writers/jfrWriterHost.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -25,9 +25,9 @@
#ifndef SHARE_JFR_WRITERS_JFRWRITERHOST_HPP
#define SHARE_JFR_WRITERS_JFRWRITERHOST_HPP
+#include "jfr/utilities/jfrTime.hpp"
#include "jni.h"
#include "utilities/globalDefinitions.hpp"
-#include "jfr/utilities/jfrTime.hpp"
class ClassLoaderData;
class Klass;
diff --git a/src/hotspot/share/jvmci/jvmci.cpp b/src/hotspot/share/jvmci/jvmci.cpp
index 9442c241e1637..609617b4a2073 100644
--- a/src/hotspot/share/jvmci/jvmci.cpp
+++ b/src/hotspot/share/jvmci/jvmci.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "compiler/abstractCompiler.hpp"
#include "compiler/compileTask.hpp"
@@ -380,7 +379,7 @@ void JVMCI::fatal_log(const char* buf, size_t count) {
_fatal_log_fd = log_fd;
} else if (_first_error_tid != current_thread_id) {
// This is not the first thread reporting a libjvmci error
- tty->print_cr("[thread " INTX_FORMAT " also had an error in the JVMCI native library]",
+ tty->print_cr("[thread %zd also had an error in the JVMCI native library]",
current_thread_id);
// Fatal error reporting is single threaded so just block this thread.
diff --git a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
index dc3eecd57917e..5127e29712e27 100644
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "code/compiledIC.hpp"
#include "compiler/compileBroker.hpp"
diff --git a/src/hotspot/share/jvmci/jvmciCompiler.cpp b/src/hotspot/share/jvmci/jvmciCompiler.cpp
index 04cdb4b4b4fda..f3f68a00b4f40 100644
--- a/src/hotspot/share/jvmci/jvmciCompiler.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompiler.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/vmClasses.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
index 9052e6228945b..9bbf4fccae16c 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/stringTable.hpp"
@@ -1000,7 +999,7 @@ C2V_VMENTRY_NULL(jobject, resolveFieldInPool, (JNIEnv* env, jobject, ARGUMENT_PA
if (info.is_null() || JVMCIENV->get_length(info) != 4) {
JVMCI_ERROR_NULL("info must not be null and have a length of 4");
}
- JVMCIENV->put_int_at(info, 0, fd.access_flags().as_int());
+ JVMCIENV->put_int_at(info, 0, fd.access_flags().as_field_flags());
JVMCIENV->put_int_at(info, 1, fd.offset());
JVMCIENV->put_int_at(info, 2, fd.index());
JVMCIENV->put_int_at(info, 3, fd.field_flags().as_uint());
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
index faa23a8417866..a2f6f7f6d5213 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-// no precompiled headers
#ifdef COMPILER1
#include "c1/c1_Compiler.hpp"
#endif
diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp
index 712745e2a021c..78f5bca476957 100644
--- a/src/hotspot/share/jvmci/jvmciEnv.cpp
+++ b/src/hotspot/share/jvmci/jvmciEnv.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
@@ -1592,7 +1591,7 @@ JVMCIObject JVMCIEnv::new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS) {
HotSpotJVMCI::FieldInfo::set_nameIndex(JVMCIENV, obj_h(), (jint)fieldinfo->name_index());
HotSpotJVMCI::FieldInfo::set_signatureIndex(JVMCIENV, obj_h(), (jint)fieldinfo->signature_index());
HotSpotJVMCI::FieldInfo::set_offset(JVMCIENV, obj_h(), (jint)fieldinfo->offset());
- HotSpotJVMCI::FieldInfo::set_classfileFlags(JVMCIENV, obj_h(), (jint)fieldinfo->access_flags().as_int());
+ HotSpotJVMCI::FieldInfo::set_classfileFlags(JVMCIENV, obj_h(), (jint)fieldinfo->access_flags().as_field_flags());
HotSpotJVMCI::FieldInfo::set_internalFlags(JVMCIENV, obj_h(), (jint)fieldinfo->field_flags().as_uint());
HotSpotJVMCI::FieldInfo::set_initializerIndex(JVMCIENV, obj_h(), (jint)fieldinfo->initializer_index());
return wrap(obj_h());
@@ -1603,7 +1602,7 @@ JVMCIObject JVMCIEnv::new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS) {
(jint)fieldinfo->name_index(),
(jint)fieldinfo->signature_index(),
(jint)fieldinfo->offset(),
- (jint)fieldinfo->access_flags().as_int(),
+ (jint)fieldinfo->access_flags().as_field_flags(),
(jint)fieldinfo->field_flags().as_uint(),
(jint)fieldinfo->initializer_index());
diff --git a/src/hotspot/share/jvmci/jvmciJavaClasses.cpp b/src/hotspot/share/jvmci/jvmciJavaClasses.cpp
index aa32e0e3eca02..b8d3d4e3b7ebf 100644
--- a/src/hotspot/share/jvmci/jvmciJavaClasses.cpp
+++ b/src/hotspot/share/jvmci/jvmciJavaClasses.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmClasses.hpp"
diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp
index ac972e97b1b6f..9a2a1de23a536 100644
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
@@ -1008,7 +1007,7 @@ static void _fatal() {
}
}
intx current_thread_id = os::current_thread_id();
- fatal("thread " INTX_FORMAT ": Fatal error in JVMCI shared library", current_thread_id);
+ fatal("thread %zd: Fatal error in JVMCI shared library", current_thread_id);
}
JVMCIRuntime::JVMCIRuntime(JVMCIRuntime* next, int id, bool for_compile_broker) :
diff --git a/src/hotspot/share/jvmci/jvmci_globals.cpp b/src/hotspot/share/jvmci/jvmci_globals.cpp
index 2ae38044df0ff..dfc7e6b597046 100644
--- a/src/hotspot/share/jvmci/jvmci_globals.cpp
+++ b/src/hotspot/share/jvmci/jvmci_globals.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compilerDefinitions.hpp"
#include "gc/shared/gcConfig.hpp"
#include "jvm.h"
diff --git a/src/hotspot/share/jvmci/metadataHandles.cpp b/src/hotspot/share/jvmci/metadataHandles.cpp
index 8bfea49fd0d86..3df7ebe573ae9 100644
--- a/src/hotspot/share/jvmci/metadataHandles.cpp
+++ b/src/hotspot/share/jvmci/metadataHandles.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 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
@@ -21,7 +21,6 @@
* questions.
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "jvmci/metadataHandles.hpp"
#include "runtime/atomic.hpp"
diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
index ba47e5599578f..96d369678f792 100644
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
#include "compiler/compileBroker.hpp"
@@ -273,7 +272,7 @@
nonstatic_field(Klass, _name, Symbol*) \
volatile_nonstatic_field(Klass, _next_sibling, Klass*) \
nonstatic_field(Klass, _java_mirror, OopHandle) \
- nonstatic_field(Klass, _modifier_flags, jint) \
+ nonstatic_field(Klass, _modifier_flags, u2) \
nonstatic_field(Klass, _access_flags, AccessFlags) \
nonstatic_field(Klass, _class_loader_data, ClassLoaderData*) \
nonstatic_field(Klass, _secondary_supers_bitmap, uintx) \
@@ -488,7 +487,6 @@
declare_constant(InvocationEntryBci) \
declare_constant(JVMCINMethodData::SPECULATION_LENGTH_BITS) \
\
- declare_constant(JVM_ACC_WRITTEN_FLAGS) \
declare_constant(FieldInfo::FieldFlags::_ff_injected) \
declare_constant(FieldInfo::FieldFlags::_ff_stable) \
declare_preprocessor_constant("JVM_ACC_VARARGS", JVM_ACC_VARARGS) \
diff --git a/src/hotspot/share/libadt/dict.cpp b/src/hotspot/share/libadt/dict.cpp
index 0343125018e6c..e31df74807380 100644
--- a/src/hotspot/share/libadt/dict.cpp
+++ b/src/hotspot/share/libadt/dict.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "libadt/dict.hpp"
#include "utilities/powerOfTwo.hpp"
diff --git a/src/hotspot/share/libadt/vectset.cpp b/src/hotspot/share/libadt/vectset.cpp
index feb3ab10c65f2..a4224b0adb152 100644
--- a/src/hotspot/share/libadt/vectset.cpp
+++ b/src/hotspot/share/libadt/vectset.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/arena.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/logging/logAsyncWriter.cpp b/src/hotspot/share/logging/logAsyncWriter.cpp
index 3d987d04b8d42..8360a4af91dbd 100644
--- a/src/hotspot/share/logging/logAsyncWriter.cpp
+++ b/src/hotspot/share/logging/logAsyncWriter.cpp
@@ -1,6 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -22,7 +22,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logAsyncWriter.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logFileOutput.hpp"
@@ -108,7 +107,7 @@ AsyncLogWriter::AsyncLogWriter()
size_t size = AsyncLogBufferSize / 2;
_buffer = new Buffer(size);
_buffer_staging = new Buffer(size);
- log_info(logging)("AsyncLogBuffer estimates memory use: " SIZE_FORMAT " bytes", size * 2);
+ log_info(logging)("AsyncLogBuffer estimates memory use: %zu bytes", size * 2);
if (os::create_thread(this, os::asynclog_thread)) {
_initialized = true;
} else {
diff --git a/src/hotspot/share/logging/logAsyncWriter.hpp b/src/hotspot/share/logging/logAsyncWriter.hpp
index 97bae2a581745..4d18e61211063 100644
--- a/src/hotspot/share/logging/logAsyncWriter.hpp
+++ b/src/hotspot/share/logging/logAsyncWriter.hpp
@@ -1,6 +1,6 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -176,7 +176,7 @@ class AsyncLogWriter : public NonJavaThread {
void run() override;
void pre_run() override {
NonJavaThread::pre_run();
- log_debug(logging, thread)("starting AsyncLog Thread tid = " INTX_FORMAT, os::current_thread_id());
+ log_debug(logging, thread)("starting AsyncLog Thread tid = %zd", os::current_thread_id());
}
const char* type_name() const override { return "AsyncLogWriter"; }
void print_on(outputStream* st) const override {
diff --git a/src/hotspot/share/logging/logConfiguration.cpp b/src/hotspot/share/logging/logConfiguration.cpp
index dfddfff2f05c0..5f8a045c356fa 100644
--- a/src/hotspot/share/logging/logConfiguration.cpp
+++ b/src/hotspot/share/logging/logConfiguration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/log.hpp"
#include "logging/logAsyncWriter.hpp"
@@ -214,8 +213,8 @@ size_t LogConfiguration::add_output(LogOutput* output) {
void LogConfiguration::delete_output(size_t idx) {
assert(idx > 1 && idx < _n_outputs,
- "idx must be in range 1 < idx < _n_outputs, but idx = " SIZE_FORMAT
- " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs);
+ "idx must be in range 1 < idx < _n_outputs, but idx = %zu"
+ " and _n_outputs = %zu", idx, _n_outputs);
LogOutput* output = _outputs[idx];
// Swap places with the last output and shrink the array
_outputs[idx] = _outputs[--_n_outputs];
@@ -240,7 +239,7 @@ void LogConfiguration::delete_output(size_t idx) {
//
void LogConfiguration::configure_output(size_t idx, const LogSelectionList& selections, const LogDecorators& decorators) {
assert(ConfigurationLock::current_thread_has_lock(), "Must hold configuration lock to call this function.");
- assert(idx < _n_outputs, "Invalid index, idx = " SIZE_FORMAT " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs);
+ assert(idx < _n_outputs, "Invalid index, idx = %zu and _n_outputs = %zu", idx, _n_outputs);
LogOutput* output = _outputs[idx];
output->_reconfigured = true;
@@ -351,7 +350,7 @@ void LogConfiguration::configure_stdout(LogLevelType level, int exact_match, ...
}
}
assert(i < LogTag::MaxTags || static_cast(va_arg(ap, int)) == LogTag::__NO_TAG,
- "Too many tags specified! Can only have up to " SIZE_FORMAT " tags in a tag set.", LogTag::MaxTags);
+ "Too many tags specified! Can only have up to %zu tags in a tag set.", LogTag::MaxTags);
va_end(ap);
LogSelection selection(tags, !exact_match, level);
@@ -500,7 +499,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,
size_t idx;
bool added = false;
if (outputstr[0] == '#') { // Output specified using index
- int ret = sscanf(outputstr + 1, SIZE_FORMAT, &idx);
+ int ret = sscanf(outputstr + 1, "%zu", &idx);
if (ret != 1 || idx >= _n_outputs) {
errstream->print_cr("Invalid output index '%s'", outputstr);
return false;
@@ -566,7 +565,7 @@ void LogConfiguration::describe_available(outputStream* out) {
void LogConfiguration::describe_current_configuration(outputStream* out) {
out->print_cr("Log output configuration:");
for (size_t i = 0; i < _n_outputs; i++) {
- out->print(" #" SIZE_FORMAT ": ", i);
+ out->print(" #%zu: ", i);
_outputs[i]->describe(out);
if (_outputs[i]->is_reconfigured()) {
out->print(" (reconfigured)");
diff --git a/src/hotspot/share/logging/logDecorations.cpp b/src/hotspot/share/logging/logDecorations.cpp
index 058bd7ab2aad0..e08c6c9cb137d 100644
--- a/src/hotspot/share/logging/logDecorations.cpp
+++ b/src/hotspot/share/logging/logDecorations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/logConfiguration.hpp"
#include "logging/logDecorations.hpp"
@@ -127,7 +126,7 @@ void LogDecorations::print_pid_decoration(outputStream* st) const {
}
void LogDecorations::print_tid_decoration(outputStream* st) const {
- st->print(INTX_FORMAT, _tid);
+ st->print("%zd", _tid);
}
void LogDecorations::print_level_decoration(outputStream* st) const {
diff --git a/src/hotspot/share/logging/logDecorators.cpp b/src/hotspot/share/logging/logDecorators.cpp
index 6c06bd4571627..0b1470f1a2ed3 100644
--- a/src/hotspot/share/logging/logDecorators.cpp
+++ b/src/hotspot/share/logging/logDecorators.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logDecorators.hpp"
#include "runtime/os.hpp"
@@ -100,7 +99,9 @@ bool LogDecorators::parse(const char* decorator_args, outputStream* errstream) {
break;
}
tmp_decorators |= mask(d);
- token = comma_pos + 1;
+ if (comma_pos != nullptr) {
+ token = comma_pos + 1;
+ }
} while (comma_pos != nullptr);
os::free(args_copy);
if (result) {
diff --git a/src/hotspot/share/logging/logDiagnosticCommand.cpp b/src/hotspot/share/logging/logDiagnosticCommand.cpp
index dfd45d611884a..adf596afc9405 100644
--- a/src/hotspot/share/logging/logDiagnosticCommand.cpp
+++ b/src/hotspot/share/logging/logDiagnosticCommand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logDiagnosticCommand.hpp"
#include "memory/resourceArea.hpp"
diff --git a/src/hotspot/share/logging/logFileOutput.cpp b/src/hotspot/share/logging/logFileOutput.cpp
index 783be86586147..568708a59611e 100644
--- a/src/hotspot/share/logging/logFileOutput.cpp
+++ b/src/hotspot/share/logging/logFileOutput.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/log.hpp"
#include "logging/logAsyncWriter.hpp"
@@ -185,7 +184,7 @@ bool LogFileOutput::set_option(const char* key, const char* value, outputStream*
success = Arguments::atojulong(value, &longval);
if (!success || (longval > SIZE_MAX)) {
errstream->print_cr("Invalid option: %s must be in range [0, "
- SIZE_FORMAT "]", FileSizeOptionKey, (size_t)SIZE_MAX);
+ "%zu]", FileSizeOptionKey, (size_t)SIZE_MAX);
success = false;
} else {
_rotate_size = static_cast(longval);
@@ -215,7 +214,7 @@ bool LogFileOutput::initialize(const char* options, outputStream* errstream) {
}
log_trace(logging)("Initializing logging to file '%s' (filecount: %u"
- ", filesize: " SIZE_FORMAT " KiB).",
+ ", filesize: %zu KiB).",
_file_name, _file_count, _rotate_size / K);
if (_file_count > 0 && file_exist) {
@@ -461,7 +460,7 @@ char* LogFileOutput::make_file_name(const char* file_name,
void LogFileOutput::describe(outputStream *out) {
LogFileStreamOutput::describe(out);
- out->print(",filecount=%u,filesize=" SIZE_FORMAT "%s,async=%s", _file_count,
+ out->print(",filecount=%u,filesize=%zu%s,async=%s", _file_count,
byte_size_in_proper_unit(_rotate_size),
proper_unit_for_byte_size(_rotate_size),
LogConfiguration::is_async_mode() ? "true" : "false");
diff --git a/src/hotspot/share/logging/logFileStreamOutput.cpp b/src/hotspot/share/logging/logFileStreamOutput.cpp
index dc34a9b8b1449..f8bbb28472ceb 100644
--- a/src/hotspot/share/logging/logFileStreamOutput.cpp
+++ b/src/hotspot/share/logging/logFileStreamOutput.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/logAsyncWriter.hpp"
#include "logging/logDecorations.hpp"
diff --git a/src/hotspot/share/logging/logLevel.cpp b/src/hotspot/share/logging/logLevel.cpp
index 2b9ef795163c6..9efe07b05e9e6 100644
--- a/src/hotspot/share/logging/logLevel.cpp
+++ b/src/hotspot/share/logging/logLevel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logLevel.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/stringUtils.hpp"
diff --git a/src/hotspot/share/logging/logMessageBuffer.cpp b/src/hotspot/share/logging/logMessageBuffer.cpp
index 268cc191418cb..8f308b1f01506 100644
--- a/src/hotspot/share/logging/logMessageBuffer.cpp
+++ b/src/hotspot/share/logging/logMessageBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logMessageBuffer.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/javaThread.hpp"
diff --git a/src/hotspot/share/logging/logOutput.cpp b/src/hotspot/share/logging/logOutput.cpp
index 17d0e8b555d60..e3c68b49b1305 100644
--- a/src/hotspot/share/logging/logOutput.cpp
+++ b/src/hotspot/share/logging/logOutput.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/log.hpp"
#include "logging/logFileStreamOutput.hpp"
@@ -354,7 +353,9 @@ bool LogOutput::parse_options(const char* options, outputStream* errstream) {
}
break;
}
- pos = comma_pos + 1;
+ if (comma_pos != nullptr) {
+ pos = comma_pos + 1;
+ }
} while (comma_pos != nullptr);
os::free(opts);
diff --git a/src/hotspot/share/logging/logOutputList.cpp b/src/hotspot/share/logging/logOutputList.cpp
index 6367577b1b001..fab06860a4807 100644
--- a/src/hotspot/share/logging/logOutputList.cpp
+++ b/src/hotspot/share/logging/logOutputList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logLevel.hpp"
#include "logging/logOutputList.hpp"
#include "memory/allocation.inline.hpp"
diff --git a/src/hotspot/share/logging/logSelection.cpp b/src/hotspot/share/logging/logSelection.cpp
index 99ecc9f87f272..476fdebc9c540 100644
--- a/src/hotspot/share/logging/logSelection.cpp
+++ b/src/hotspot/share/logging/logSelection.cpp
@@ -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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm_io.h"
#include "logging/log.hpp"
#include "logging/logSelection.hpp"
@@ -145,13 +144,15 @@ static LogSelection parse_internal(char *str, outputStream* errstream) {
}
if (ntags == LogTag::MaxTags) {
if (errstream != nullptr) {
- errstream->print_cr("Too many tags in log selection '%s' (can only have up to " SIZE_FORMAT " tags).",
+ errstream->print_cr("Too many tags in log selection '%s' (can only have up to %zu tags).",
str, LogTag::MaxTags);
}
return LogSelection::Invalid;
}
tags[ntags++] = tag;
- cur_tag = plus_pos + 1;
+ if (plus_pos != nullptr) {
+ cur_tag = plus_pos + 1;
+ }
} while (plus_pos != nullptr);
for (size_t i = 0; i < ntags; i++) {
diff --git a/src/hotspot/share/logging/logSelectionList.cpp b/src/hotspot/share/logging/logSelectionList.cpp
index ac63f20512c2a..f8c2d9e7cfb69 100644
--- a/src/hotspot/share/logging/logSelectionList.cpp
+++ b/src/hotspot/share/logging/logSelectionList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/logSelectionList.hpp"
#include "logging/logTagSet.hpp"
#include "runtime/os.hpp"
@@ -69,10 +68,10 @@ bool LogSelectionList::parse(const char* str, outputStream* errstream) {
}
char* copy = os::strdup_check_oom(str, mtLogging);
// Split string on commas
- for (char *comma_pos = copy, *cur = copy; success && comma_pos != nullptr; cur = comma_pos + 1) {
+ for (char *comma_pos = copy, *cur = copy; success; cur = comma_pos + 1) {
if (_nselections == MaxSelections) {
if (errstream != nullptr) {
- errstream->print_cr("Can not have more than " SIZE_FORMAT " log selections in a single configuration.",
+ errstream->print_cr("Can not have more than %zu log selections in a single configuration.",
MaxSelections);
}
success = false;
@@ -90,6 +89,10 @@ bool LogSelectionList::parse(const char* str, outputStream* errstream) {
break;
}
_selections[_nselections++] = selection;
+
+ if (comma_pos == nullptr) {
+ break;
+ }
}
os::free(copy);
diff --git a/src/hotspot/share/logging/logStream.cpp b/src/hotspot/share/logging/logStream.cpp
index efbd806733d01..813b0aceb4a52 100644
--- a/src/hotspot/share/logging/logStream.cpp
+++ b/src/hotspot/share/logging/logStream.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/logStream.hpp"
#include "runtime/os.hpp"
#include "utilities/align.hpp"
diff --git a/src/hotspot/share/logging/logTag.cpp b/src/hotspot/share/logging/logTag.cpp
index a4cd535cf7afe..d2aeeebfc7996 100644
--- a/src/hotspot/share/logging/logTag.cpp
+++ b/src/hotspot/share/logging/logTag.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logTag.hpp"
#include "utilities/stringUtils.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/logging/logTagSet.cpp b/src/hotspot/share/logging/logTagSet.cpp
index 04da1a1e28d16..3cb04a033c60d 100644
--- a/src/hotspot/share/logging/logTagSet.cpp
+++ b/src/hotspot/share/logging/logTagSet.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/logDecorations.hpp"
#include "logging/logFileStreamOutput.hpp"
diff --git a/src/hotspot/share/logging/logTagSetDescriptions.cpp b/src/hotspot/share/logging/logTagSetDescriptions.cpp
index cc0501771619f..f8edfb9a4c55a 100644
--- a/src/hotspot/share/logging/logTagSetDescriptions.cpp
+++ b/src/hotspot/share/logging/logTagSetDescriptions.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "logging/logTag.hpp"
#include "logging/logTagSet.hpp"
#include "logging/logTagSetDescriptions.hpp"
diff --git a/src/hotspot/share/memory/allocation.cpp b/src/hotspot/share/memory/allocation.cpp
index 096ee6964210e..13280006fe692 100644
--- a/src/hotspot/share/memory/allocation.cpp
+++ b/src/hotspot/share/memory/allocation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/arena.hpp"
diff --git a/src/hotspot/share/memory/arena.cpp b/src/hotspot/share/memory/arena.cpp
index 51d7cda9c61ec..055c6405590b5 100644
--- a/src/hotspot/share/memory/arena.cpp
+++ b/src/hotspot/share/memory/arena.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "compiler/compilationMemoryStatistic.hpp"
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
@@ -142,8 +141,7 @@ Chunk* ChunkPool::allocate_chunk(size_t length, AllocFailType alloc_failmode) {
// - the payload size (length) must be aligned to 64-bit, which takes care of 64-bit
// aligning (D)
- assert(is_aligned(length, ARENA_AMALLOC_ALIGNMENT), "chunk payload length misaligned: "
- SIZE_FORMAT ".", length);
+ assert(is_aligned(length, ARENA_AMALLOC_ALIGNMENT), "chunk payload length misaligned: %zu.", length);
// Try to reuse a freed chunk from the pool
ChunkPool* pool = ChunkPool::get_pool_for_size(length);
Chunk* chunk = nullptr;
diff --git a/src/hotspot/share/memory/classLoaderMetaspace.cpp b/src/hotspot/share/memory/classLoaderMetaspace.cpp
index 4bcbb862a5a4e..efa6adc7a7bf5 100644
--- a/src/hotspot/share/memory/classLoaderMetaspace.cpp
+++ b/src/hotspot/share/memory/classLoaderMetaspace.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "memory/metaspace.hpp"
@@ -148,8 +147,8 @@ MetaWord* ClassLoaderMetaspace::expand_and_allocate(size_t word_size, Metaspace:
Metaspace::tracer()->report_gc_threshold(before, after,
MetaspaceGCThresholdUpdater::ExpandAndAllocate);
// Keeping both for now until I am sure the old variant (gc + metaspace) is not needed anymore
- log_trace(gc, metaspace)("Increase capacity to GC from " SIZE_FORMAT " to " SIZE_FORMAT, before, after);
- UL2(info, "GC threshold increased: " SIZE_FORMAT "->" SIZE_FORMAT ".", before, after);
+ log_trace(gc, metaspace)("Increase capacity to GC from %zu to %zu", before, after);
+ UL2(info, "GC threshold increased: %zu->%zu.", before, after);
}
return res;
diff --git a/src/hotspot/share/memory/guardedMemory.cpp b/src/hotspot/share/memory/guardedMemory.cpp
index 12ffde3cc1b94..4165ccdb62080 100644
--- a/src/hotspot/share/memory/guardedMemory.cpp
+++ b/src/hotspot/share/memory/guardedMemory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -21,7 +21,6 @@
* questions.
*
*/
-#include "precompiled.hpp"
#include "memory/guardedMemory.hpp"
#include "nmt/memTag.hpp"
#include "runtime/os.hpp"
@@ -59,7 +58,7 @@ void GuardedMemory::print_on(outputStream* st) const {
return;
}
st->print_cr("GuardedMemory(" PTR_FORMAT ") base_addr=" PTR_FORMAT
- " tag=" PTR_FORMAT " user_size=" SIZE_FORMAT " user_data=" PTR_FORMAT,
+ " tag=" PTR_FORMAT " user_size=%zu user_data=" PTR_FORMAT,
p2i(this), p2i(_base_addr), p2i(get_tag()), get_user_size(), p2i(get_user_ptr()));
Guard* guard = get_head_guard();
diff --git a/src/hotspot/share/memory/heap.cpp b/src/hotspot/share/memory/heap.cpp
index 1f0db3f08b54f..bcb9d2e6114b9 100644
--- a/src/hotspot/share/memory/heap.cpp
+++ b/src/hotspot/share/memory/heap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/heap.hpp"
#include "memory/memoryReserver.hpp"
#include "oops/oop.inline.hpp"
diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp
index bf9deb530f03a..867ccc6106d8e 100644
--- a/src/hotspot/share/memory/heapInspection.cpp
+++ b/src/hotspot/share/memory/heapInspection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/moduleEntry.hpp"
@@ -592,7 +591,7 @@ void HeapInspection::heap_inspection(outputStream* st, WorkerThreads* workers) {
// populate table with object allocation info
uintx missed_count = populate_table(&cit, nullptr, workers);
if (missed_count != 0) {
- log_info(gc, classhisto)("WARNING: Ran out of C-heap; undercounted " UINTX_FORMAT
+ log_info(gc, classhisto)("WARNING: Ran out of C-heap; undercounted %zu"
" total instances in data below",
missed_count);
}
diff --git a/src/hotspot/share/memory/iterator.cpp b/src/hotspot/share/memory/iterator.cpp
index d2d478cb51851..9569822e03f6f 100644
--- a/src/hotspot/share/memory/iterator.cpp
+++ b/src/hotspot/share/memory/iterator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "code/nmethod.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
diff --git a/src/hotspot/share/memory/memRegion.cpp b/src/hotspot/share/memory/memRegion.cpp
index d6565b0032442..4391e25aec33b 100644
--- a/src/hotspot/share/memory/memRegion.cpp
+++ b/src/hotspot/share/memory/memRegion.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/memRegion.hpp"
diff --git a/src/hotspot/share/memory/memoryReserver.cpp b/src/hotspot/share/memory/memoryReserver.cpp
index d68736c7f2ab3..dad88ae97e53b 100644
--- a/src/hotspot/share/memory/memoryReserver.cpp
+++ b/src/hotspot/share/memory/memoryReserver.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -22,7 +22,6 @@
*
*/
-#include "precompiled.hpp"
#include "jvm.h"
#include "logging/log.hpp"
#include "memory/memoryReserver.hpp"
@@ -68,7 +67,7 @@ static void log_on_large_pages_failure(char* req_addr, size_t bytes) {
// JVM style warning that we did not succeed in using large pages.
char msg[128];
jio_snprintf(msg, sizeof(msg), "Failed to reserve and commit memory using large pages. "
- "req_addr: " PTR_FORMAT " bytes: " SIZE_FORMAT,
+ "req_addr: " PTR_FORMAT " bytes: %zu",
req_addr, bytes);
warning("%s", msg);
}
@@ -89,7 +88,7 @@ static char* reserve_memory_inner(char* requested_address,
// important. If the reservation fails, return null.
if (requested_address != nullptr) {
assert(is_aligned(requested_address, alignment),
- "Requested address " PTR_FORMAT " must be aligned to " SIZE_FORMAT,
+ "Requested address " PTR_FORMAT " must be aligned to %zu",
p2i(requested_address), alignment);
return os::attempt_reserve_memory_at(requested_address, size, exec, mem_tag);
}
@@ -131,8 +130,7 @@ ReservedSpace MemoryReserver::reserve_memory_special(char* requested_address,
size_t alignment,
size_t page_size,
bool exec) {
- log_trace(pagesize)("Attempt special mapping: size: " SIZE_FORMAT "%s, "
- "alignment: " SIZE_FORMAT "%s",
+ log_trace(pagesize)("Attempt special mapping: size: %zu%s, alignment: %zu%s",
byte_size_in_exact_unit(size), exact_unit_for_byte_size(size),
byte_size_in_exact_unit(alignment), exact_unit_for_byte_size(alignment));
@@ -141,7 +139,7 @@ ReservedSpace MemoryReserver::reserve_memory_special(char* requested_address,
if (base != nullptr) {
assert(is_aligned(base, alignment),
"reserve_memory_special() returned an unaligned address, "
- "base: " PTR_FORMAT " alignment: " SIZE_FORMAT_X,
+ "base: " PTR_FORMAT " alignment: 0x%zx",
p2i(base), alignment);
return ReservedSpace(base, size, alignment, page_size, exec, true /* special */);
@@ -255,7 +253,7 @@ static char* map_memory_to_file(char* requested_address,
// important. If the reservation fails, return null.
if (requested_address != nullptr) {
assert(is_aligned(requested_address, alignment),
- "Requested address " PTR_FORMAT " must be aligned to " SIZE_FORMAT,
+ "Requested address " PTR_FORMAT " must be aligned to %zu",
p2i(requested_address), alignment);
return os::attempt_map_memory_to_file_at(requested_address, size, fd, mem_tag);
}
@@ -401,7 +399,7 @@ ReservedSpace HeapReserver::Instance::try_reserve_memory(size_t size,
char* requested_address) {
// Try to reserve the memory for the heap.
log_trace(gc, heap, coops)("Trying to allocate at address " PTR_FORMAT
- " heap of size " SIZE_FORMAT_X,
+ " heap of size 0x%zx",
p2i(requested_address),
size);
@@ -426,19 +424,17 @@ ReservedSpace HeapReserver::Instance::try_reserve_range(char *highest_start,
size_t size,
size_t alignment,
size_t page_size) {
- const size_t attach_range = highest_start - lowest_start;
- // Cap num_attempts at possible number.
- // At least one is possible even for 0 sized attach range.
- const uint64_t num_attempts_possible = (attach_range / attach_point_alignment) + 1;
- const uint64_t num_attempts_to_try = MIN2((uint64_t)HeapSearchSteps, num_attempts_possible);
-
- const size_t stepsize = (attach_range == 0) ? // Only one try.
- (size_t) highest_start : align_up(attach_range / num_attempts_to_try, attach_point_alignment);
-
- // Try attach points from top to bottom.
- for (char* attach_point = highest_start;
- attach_point >= lowest_start && attach_point <= highest_start; // Avoid wrap around.
- attach_point -= stepsize) {
+ assert(is_aligned(highest_start, attach_point_alignment), "precondition");
+ assert(is_aligned(lowest_start, attach_point_alignment), "precondition");
+
+ const size_t attach_range = pointer_delta(highest_start, lowest_start, sizeof(char));
+ const size_t num_attempts_possible = (attach_range / attach_point_alignment) + 1;
+ const size_t num_attempts_to_try = MIN2((size_t)HeapSearchSteps, num_attempts_possible);
+ const size_t num_intervals = num_attempts_to_try - 1;
+ const size_t stepsize = num_intervals == 0 ? 0 : align_down(attach_range / num_intervals, attach_point_alignment);
+
+ for (size_t i = 0; i < num_attempts_to_try; ++i) {
+ char* const attach_point = highest_start - stepsize * i;
ReservedSpace reserved = try_reserve_memory(size, alignment, page_size, attach_point);
if (reserved.is_reserved()) {
@@ -516,7 +512,7 @@ static ReservedSpace establish_noaccess_prefix(const ReservedSpace& reserved, si
fatal("cannot protect protection page");
}
log_debug(gc, heap, coops)("Protected page at the reserved heap base: "
- PTR_FORMAT " / " INTX_FORMAT " bytes",
+ PTR_FORMAT " / %zd bytes",
p2i(reserved.base()),
noaccess_prefix);
assert(CompressedOops::use_implicit_null_checks() == true, "not initialized?");
@@ -639,7 +635,7 @@ ReservedHeapSpace HeapReserver::Instance::reserve_compressed_oops_heap(const siz
// Last, desperate try without any placement.
if (!reserved.is_reserved()) {
- log_trace(gc, heap, coops)("Trying to allocate at address null heap of size " SIZE_FORMAT_X, size + noaccess_prefix);
+ log_trace(gc, heap, coops)("Trying to allocate at address null heap of size 0x%zx", size + noaccess_prefix);
assert(alignment >= os::vm_page_size(), "Unexpected");
reserved = reserve_memory(size + noaccess_prefix, alignment, page_size);
}
diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp
index ccfda8257d319..c1fc0bf669bbd 100644
--- a/src/hotspot/share/memory/metaspace.cpp
+++ b/src/hotspot/share/memory/metaspace.cpp
@@ -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.
* Copyright (c) 2017, 2021 SAP SE. All rights reserved.
* Copyright (c) 2023, 2024, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -24,7 +24,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "cds/metaspaceShared.hpp"
#include "classfile/classLoaderData.hpp"
@@ -217,18 +216,18 @@ void MetaspaceUtils::print_on(outputStream* out) {
// Used from all GCs. It first prints out totals, then, separately, the class space portion.
MetaspaceCombinedStats stats = get_combined_statistics();
out->print_cr(" Metaspace "
- "used " SIZE_FORMAT "K, "
- "committed " SIZE_FORMAT "K, "
- "reserved " SIZE_FORMAT "K",
+ "used %zuK, "
+ "committed %zuK, "
+ "reserved %zuK",
stats.used()/K,
stats.committed()/K,
stats.reserved()/K);
if (Metaspace::using_class_space()) {
out->print_cr(" class space "
- "used " SIZE_FORMAT "K, "
- "committed " SIZE_FORMAT "K, "
- "reserved " SIZE_FORMAT "K",
+ "used %zuK, "
+ "committed %zuK, "
+ "reserved %zuK",
stats.class_space_stats().used()/K,
stats.class_space_stats().committed()/K,
stats.class_space_stats().reserved()/K);
@@ -386,7 +385,7 @@ bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
if (is_class && Metaspace::using_class_space()) {
size_t class_committed = MetaspaceUtils::committed_bytes(Metaspace::ClassType);
if (class_committed + word_size * BytesPerWord > CompressedClassSpaceSize) {
- log_trace(gc, metaspace, freelist)("Cannot expand %s metaspace by " SIZE_FORMAT " words (CompressedClassSpaceSize = " SIZE_FORMAT " words)",
+ log_trace(gc, metaspace, freelist)("Cannot expand %s metaspace by %zu words (CompressedClassSpaceSize = %zu words)",
(is_class ? "class" : "non-class"), word_size, CompressedClassSpaceSize / sizeof(MetaWord));
return false;
}
@@ -395,7 +394,7 @@ bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
// Check if the user has imposed a limit on the metaspace memory.
size_t committed_bytes = MetaspaceUtils::committed_bytes();
if (committed_bytes + word_size * BytesPerWord > MaxMetaspaceSize) {
- log_trace(gc, metaspace, freelist)("Cannot expand %s metaspace by " SIZE_FORMAT " words (MaxMetaspaceSize = " SIZE_FORMAT " words)",
+ log_trace(gc, metaspace, freelist)("Cannot expand %s metaspace by %zu words (MaxMetaspaceSize = %zu words)",
(is_class ? "class" : "non-class"), word_size, MaxMetaspaceSize / sizeof(MetaWord));
return false;
}
@@ -413,8 +412,8 @@ size_t MetaspaceGC::allowed_expansion() {
size_t left_until_GC = capacity_until_gc > committed_bytes ?
capacity_until_gc - committed_bytes : 0;
size_t left_to_commit = MIN2(left_until_GC, left_until_max);
- log_trace(gc, metaspace, freelist)("allowed expansion words: " SIZE_FORMAT
- " (left_until_max: " SIZE_FORMAT ", left_until_GC: " SIZE_FORMAT ".",
+ log_trace(gc, metaspace, freelist)("allowed expansion words: %zu"
+ " (left_until_max: %zu, left_until_GC: %zu.",
left_to_commit / BytesPerWord, left_until_max / BytesPerWord, left_until_GC / BytesPerWord);
return left_to_commit / BytesPerWord;
@@ -478,7 +477,7 @@ void MetaspaceGC::compute_new_size() {
// No expansion, now see if we want to shrink
// We would never want to shrink more than this
assert(capacity_until_GC >= minimum_desired_capacity,
- SIZE_FORMAT " >= " SIZE_FORMAT,
+ "%zu >= %zu",
capacity_until_GC, minimum_desired_capacity);
size_t max_shrink_bytes = capacity_until_GC - minimum_desired_capacity;
@@ -512,7 +511,7 @@ void MetaspaceGC::compute_new_size() {
shrink_bytes = align_down(shrink_bytes, Metaspace::commit_alignment());
assert(shrink_bytes <= max_shrink_bytes,
- "invalid shrink size " SIZE_FORMAT " not <= " SIZE_FORMAT,
+ "invalid shrink size %zu not <= %zu",
shrink_bytes, max_shrink_bytes);
if (current_shrink_factor == 0) {
_shrink_factor = 10;
@@ -554,7 +553,7 @@ void Metaspace::print_compressed_class_space(outputStream* st) {
MetaWord* base = VirtualSpaceList::vslist_class()->base_of_first_node();
size_t size = VirtualSpaceList::vslist_class()->word_size_of_first_node();
MetaWord* top = base + size;
- st->print("Compressed class space mapped at: " PTR_FORMAT "-" PTR_FORMAT ", reserved size: " SIZE_FORMAT,
+ st->print("Compressed class space mapped at: " PTR_FORMAT "-" PTR_FORMAT ", reserved size: %zu",
p2i(base), p2i(top), (top - base) * BytesPerWord);
st->cr();
}
@@ -563,10 +562,10 @@ void Metaspace::print_compressed_class_space(outputStream* st) {
// Given a prereserved space, use that to set up the compressed class space list.
void Metaspace::initialize_class_space(ReservedSpace rs) {
assert(rs.size() >= CompressedClassSpaceSize,
- SIZE_FORMAT " != " SIZE_FORMAT, rs.size(), CompressedClassSpaceSize);
+ "%zu != %zu", rs.size(), CompressedClassSpaceSize);
assert(using_class_space(), "Must be using class space");
- assert(rs.size() == CompressedClassSpaceSize, SIZE_FORMAT " != " SIZE_FORMAT,
+ assert(rs.size() == CompressedClassSpaceSize, "%zu != %zu",
rs.size(), CompressedClassSpaceSize);
assert(is_aligned(rs.base(), Metaspace::reserve_alignment()) &&
is_aligned(rs.size(), Metaspace::reserve_alignment()),
@@ -692,7 +691,7 @@ void Metaspace::ergo_initialize() {
// Lets just live with that, its not a big deal.
if (adjusted_ccs_size != CompressedClassSpaceSize) {
FLAG_SET_ERGO(CompressedClassSpaceSize, adjusted_ccs_size);
- log_info(metaspace)("Setting CompressedClassSpaceSize to " SIZE_FORMAT ".",
+ log_info(metaspace)("Setting CompressedClassSpaceSize to %zu.",
CompressedClassSpaceSize);
}
}
@@ -761,7 +760,7 @@ void Metaspace::global_initialize() {
if (!is_aligned(base, Metaspace::reserve_alignment())) {
vm_exit_during_initialization(
err_msg("CompressedClassSpaceBaseAddress=" PTR_FORMAT " invalid "
- "(must be aligned to " SIZE_FORMAT_X ").",
+ "(must be aligned to 0x%zx).",
CompressedClassSpaceBaseAddress, Metaspace::reserve_alignment()));
}
@@ -793,7 +792,7 @@ void Metaspace::global_initialize() {
// ...failing that, give up.
if (!rs.is_reserved()) {
vm_exit_during_initialization(
- err_msg("Could not allocate compressed class space: " SIZE_FORMAT " bytes",
+ err_msg("Could not allocate compressed class space: %zu bytes",
CompressedClassSpaceSize));
}
@@ -859,7 +858,7 @@ size_t Metaspace::max_allocation_word_size() {
MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
MetaspaceObj::Type type, bool use_class_space) {
assert(word_size <= Metaspace::max_allocation_word_size(),
- "allocation size too large (" SIZE_FORMAT ")", word_size);
+ "allocation size too large (%zu)", word_size);
assert(loader_data != nullptr, "Should never pass around a null loader_data. "
"ClassLoaderData::the_null_class_loader_data() should have been used.");
@@ -935,7 +934,7 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s
{
LogMessage(gc, metaspace, freelist, oom) log;
if (log.is_info()) {
- log.info("Metaspace (%s) allocation failed for size " SIZE_FORMAT,
+ log.info("Metaspace (%s) allocation failed for size %zu",
is_class_space_allocation(mdtype) ? "class" : "data", word_size);
ResourceMark rm;
if (log.is_debug()) {
diff --git a/src/hotspot/share/memory/metaspace/binList.hpp b/src/hotspot/share/memory/metaspace/binList.hpp
index 9442ea3cd5200..18e1b2c7fb86d 100644
--- a/src/hotspot/share/memory/metaspace/binList.hpp
+++ b/src/hotspot/share/memory/metaspace/binList.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* Copyright (c) 2023 Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -78,7 +78,7 @@ class BinListImpl {
Block(Block* next) : _next(next) {}
};
-#define BLOCK_FORMAT "Block @" PTR_FORMAT ": size: " SIZE_FORMAT ", next: " PTR_FORMAT
+#define BLOCK_FORMAT "Block @" PTR_FORMAT ": size: %zu, next: " PTR_FORMAT
#define BLOCK_FORMAT_ARGS(b, sz) p2i(b), (sz), p2i((b)->_next)
// Block size must be exactly one word size.
@@ -161,7 +161,7 @@ class BinListImpl {
// Block may be larger.
MetaBlock remove_block(size_t word_size) {
assert(word_size >= MinWordSize &&
- word_size <= MaxWordSize, "bad block size " SIZE_FORMAT ".", word_size);
+ word_size <= MaxWordSize, "bad block size %zu.", word_size);
MetaBlock result;
int index = index_for_word_size(word_size);
index = index_for_next_non_empty_list(index);
diff --git a/src/hotspot/share/memory/metaspace/blockTree.cpp b/src/hotspot/share/memory/metaspace/blockTree.cpp
index 85e7750883667..33237494b50b0 100644
--- a/src/hotspot/share/memory/metaspace/blockTree.cpp
+++ b/src/hotspot/share/memory/metaspace/blockTree.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/chunklevel.hpp"
#include "memory/metaspace/blockTree.hpp"
#include "memory/resourceArea.hpp"
@@ -44,7 +43,7 @@ const size_t BlockTree::MinWordSize;
", left " PTR_FORMAT \
", right " PTR_FORMAT \
", next " PTR_FORMAT \
- ", size " SIZE_FORMAT
+ ", size %zu"
#define NODE_FORMAT_ARGS(n) \
p2i(n), \
diff --git a/src/hotspot/share/memory/metaspace/blockTree.hpp b/src/hotspot/share/memory/metaspace/blockTree.hpp
index 8bcdd30919ae9..a01f60b166f14 100644
--- a/src/hotspot/share/memory/metaspace/blockTree.hpp
+++ b/src/hotspot/share/memory/metaspace/blockTree.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -348,7 +348,7 @@ class BlockTree: public CHeapObj {
void add_block(MetaBlock block) {
DEBUG_ONLY(zap_block(block);)
const size_t word_size = block.word_size();
- assert(word_size >= MinWordSize, "invalid block size " SIZE_FORMAT, word_size);
+ assert(word_size >= MinWordSize, "invalid block size %zu", word_size);
Node* n = new(block.base()) Node(word_size);
if (_root == nullptr) {
_root = n;
@@ -361,7 +361,7 @@ class BlockTree: public CHeapObj {
// Given a word_size, search and return the smallest block that is equal or
// larger than that size.
MetaBlock remove_block(size_t word_size) {
- assert(word_size >= MinWordSize, "invalid block size " SIZE_FORMAT, word_size);
+ assert(word_size >= MinWordSize, "invalid block size %zu", word_size);
MetaBlock result;
Node* n = find_closest_fit(word_size);
diff --git a/src/hotspot/share/memory/metaspace/chunkHeaderPool.cpp b/src/hotspot/share/memory/metaspace/chunkHeaderPool.cpp
index 050dd74276358..ac63d0d022593 100644
--- a/src/hotspot/share/memory/metaspace/chunkHeaderPool.cpp
+++ b/src/hotspot/share/memory/metaspace/chunkHeaderPool.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/chunkHeaderPool.hpp"
#include "runtime/os.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/memory/metaspace/chunkManager.cpp b/src/hotspot/share/memory/metaspace/chunkManager.cpp
index 7b51198bc79a3..2c787046ce8d9 100644
--- a/src/hotspot/share/memory/metaspace/chunkManager.cpp
+++ b/src/hotspot/share/memory/metaspace/chunkManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/metaspace/chunkManager.hpp"
@@ -141,7 +140,7 @@ Metachunk* ChunkManager::get_chunk_locked(chunklevel_t preferred_level, chunklev
DEBUG_ONLY(chunklevel::check_valid_level(preferred_level);)
UL2(debug, "requested chunk: pref_level: " CHKLVL_FORMAT
- ", max_level: " CHKLVL_FORMAT ", min committed size: " SIZE_FORMAT ".",
+ ", max_level: " CHKLVL_FORMAT ", min committed size: %zu.",
preferred_level, max_level, min_committed_words);
// First, optimistically look for a chunk which is already committed far enough to hold min_word_size.
@@ -212,7 +211,7 @@ Metachunk* ChunkManager::get_chunk_locked(chunklevel_t preferred_level, chunklev
const size_t to_commit = min_committed_words;
if (c->committed_words() < to_commit) {
if (c->ensure_committed_locked(to_commit) == false) {
- UL2(info, "failed to commit " SIZE_FORMAT " words on chunk " METACHUNK_FORMAT ".",
+ UL2(info, "failed to commit %zu words on chunk " METACHUNK_FORMAT ".",
to_commit, METACHUNK_FORMAT_ARGS(c));
return_chunk_locked(c);
c = nullptr;
@@ -434,7 +433,7 @@ void ChunkManager::print_on(outputStream* st) const {
void ChunkManager::print_on_locked(outputStream* st) const {
assert_lock_strong(Metaspace_lock);
- st->print_cr("cm %s: %d chunks, total word size: " SIZE_FORMAT ".", _name,
+ st->print_cr("cm %s: %d chunks, total word size: %zu.", _name,
total_num_chunks(), total_word_size());
_chunks.print_on(st);
}
diff --git a/src/hotspot/share/memory/metaspace/chunklevel.cpp b/src/hotspot/share/memory/metaspace/chunklevel.cpp
index c8bb19373d600..371ba0e68cd14 100644
--- a/src/hotspot/share/memory/metaspace/chunklevel.cpp
+++ b/src/hotspot/share/memory/metaspace/chunklevel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/chunklevel.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -36,7 +35,7 @@ using namespace chunklevel;
chunklevel_t chunklevel::level_fitting_word_size(size_t word_size) {
assert(MAX_CHUNK_WORD_SIZE >= word_size,
- SIZE_FORMAT " - too large allocation size.", word_size * BytesPerWord);
+ "%zu - too large allocation size.", word_size * BytesPerWord);
if (word_size <= MIN_CHUNK_WORD_SIZE) {
return HIGHEST_CHUNK_LEVEL;
}
diff --git a/src/hotspot/share/memory/metaspace/commitLimiter.cpp b/src/hotspot/share/memory/metaspace/commitLimiter.cpp
index 8887804b030d1..97bf9faa9c659 100644
--- a/src/hotspot/share/memory/metaspace/commitLimiter.cpp
+++ b/src/hotspot/share/memory/metaspace/commitLimiter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace.hpp"
#include "memory/metaspace/commitLimiter.hpp"
#include "memory/metaspaceUtils.hpp"
diff --git a/src/hotspot/share/memory/metaspace/commitMask.cpp b/src/hotspot/share/memory/metaspace/commitMask.cpp
index a1bc985210bf1..b6227f16b8ad3 100644
--- a/src/hotspot/share/memory/metaspace/commitMask.cpp
+++ b/src/hotspot/share/memory/metaspace/commitMask.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/commitMask.hpp"
#include "memory/metaspace/metaspaceCommon.hpp"
#include "memory/metaspace/metaspaceSettings.hpp"
@@ -61,7 +60,7 @@ void CommitMask::check_pointer(const MetaWord* p) const {
void CommitMask::check_pointer_aligned(const MetaWord* p) const {
check_pointer(p);
assert(is_aligned(p, _words_per_bit * BytesPerWord),
- "Pointer " PTR_FORMAT " should be aligned to commit granule size " SIZE_FORMAT ".",
+ "Pointer " PTR_FORMAT " should be aligned to commit granule size %zu.",
p2i(p), _words_per_bit * BytesPerWord);
}
// Given a range, check if it points into the range this bitmap covers,
@@ -69,7 +68,7 @@ void CommitMask::check_pointer_aligned(const MetaWord* p) const {
void CommitMask::check_range(const MetaWord* start, size_t word_size) const {
check_pointer_aligned(start);
assert(is_aligned(word_size, _words_per_bit),
- "Range " SIZE_FORMAT " should be aligned to commit granule size " SIZE_FORMAT ".",
+ "Range %zu should be aligned to commit granule size %zu.",
word_size, _words_per_bit);
check_pointer(start + word_size - 1);
}
diff --git a/src/hotspot/share/memory/metaspace/freeBlocks.cpp b/src/hotspot/share/memory/metaspace/freeBlocks.cpp
index ab65387043a7e..93f68d89ecd4d 100644
--- a/src/hotspot/share/memory/metaspace/freeBlocks.cpp
+++ b/src/hotspot/share/memory/metaspace/freeBlocks.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/freeBlocks.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/memory/metaspace/freeChunkList.cpp b/src/hotspot/share/memory/metaspace/freeChunkList.cpp
index 65eace074f933..3640f9d354d90 100644
--- a/src/hotspot/share/memory/metaspace/freeChunkList.cpp
+++ b/src/hotspot/share/memory/metaspace/freeChunkList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/freeChunkList.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -155,7 +154,7 @@ void FreeChunkListVector::print_on(outputStream* st) const {
list_for_level(l)->print_on(st);
st->cr();
}
- st->print_cr("total chunks: %d, total word size: " SIZE_FORMAT ".",
+ st->print_cr("total chunks: %d, total word size: %zu.",
num_chunks(), word_size());
}
diff --git a/src/hotspot/share/memory/metaspace/internalStats.cpp b/src/hotspot/share/memory/metaspace/internalStats.cpp
index d7b0e4495051e..0f386eb33a5c1 100644
--- a/src/hotspot/share/memory/metaspace/internalStats.cpp
+++ b/src/hotspot/share/memory/metaspace/internalStats.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/internalStats.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
@@ -41,7 +40,7 @@ void InternalStats::print_on(outputStream* st) {
#define xstr(s) str(s)
#define str(s) #s
-#define PRINT_COUNTER(name) st->print_cr("%s: " UINTX_FORMAT ".", xstr(name), _##name);
+#define PRINT_COUNTER(name) st->print_cr("%s: %zu.", xstr(name), _##name);
ALL_MY_COUNTERS(PRINT_COUNTER, PRINT_COUNTER)
#undef PRINT_COUNTER
diff --git a/src/hotspot/share/memory/metaspace/metablock.hpp b/src/hotspot/share/memory/metaspace/metablock.hpp
index 96e27ff8702e8..4b2dfdfe6803e 100644
--- a/src/hotspot/share/memory/metaspace/metablock.hpp
+++ b/src/hotspot/share/memory/metaspace/metablock.hpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023 Red Hat, Inc. All rights reserved.
- * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 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
@@ -68,7 +68,7 @@ class MetaBlock {
void print_on(outputStream* st) const;
};
-#define METABLOCKFORMAT "block (@" PTR_FORMAT " word size " SIZE_FORMAT ")"
+#define METABLOCKFORMAT "block (@" PTR_FORMAT " word size %zu)"
#define METABLOCKFORMATARGS(__block__) p2i((__block__).base()), (__block__).word_size()
} // namespace metaspace
diff --git a/src/hotspot/share/memory/metaspace/metachunk.cpp b/src/hotspot/share/memory/metaspace/metachunk.cpp
index 0bf7e98f13022..df3718d7bfa54 100644
--- a/src/hotspot/share/memory/metaspace/metachunk.cpp
+++ b/src/hotspot/share/memory/metaspace/metachunk.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "memory/metaspace/metachunk.hpp"
#include "memory/metaspace/metaspaceCommon.hpp"
@@ -102,7 +101,7 @@ bool Metachunk::commit_up_to(size_t new_committed_words) {
assert(commit_to <= word_size(), "Sanity");
if (commit_to > commit_from) {
log_debug(metaspace)("Chunk " METACHUNK_FORMAT ": attempting to move commit line to "
- SIZE_FORMAT " words.", METACHUNK_FORMAT_ARGS(this), commit_to);
+ "%zu words.", METACHUNK_FORMAT_ARGS(this), commit_to);
if (!_vsnode->ensure_range_is_committed(base() + commit_from, commit_to - commit_from)) {
DEBUG_ONLY(verify();)
return false;
@@ -271,10 +270,10 @@ void Metachunk::verify() const {
assert(base() != nullptr, "No base ptr");
assert(committed_words() >= used_words(),
- "mismatch: committed: " SIZE_FORMAT ", used: " SIZE_FORMAT ".",
+ "mismatch: committed: %zu, used: %zu.",
committed_words(), used_words());
assert(word_size() >= committed_words(),
- "mismatch: word_size: " SIZE_FORMAT ", committed: " SIZE_FORMAT ".",
+ "mismatch: word_size: %zu, committed: %zu.",
word_size(), committed_words());
// Test base pointer
@@ -304,8 +303,8 @@ void Metachunk::verify() const {
void Metachunk::print_on(outputStream* st) const {
// Note: must also work with invalid/random data. (e.g. do not call word_size())
st->print("Chunk @" PTR_FORMAT ", state %c, base " PTR_FORMAT ", "
- "level " CHKLVL_FORMAT " (" SIZE_FORMAT " words), "
- "used " SIZE_FORMAT " words, committed " SIZE_FORMAT " words.",
+ "level " CHKLVL_FORMAT " (%zu words), "
+ "used %zu words, committed %zu words.",
p2i(this), get_state_char(), p2i(base()), level(),
(chunklevel::is_valid_level(level()) ? chunklevel::word_size_for_level(level()) : SIZE_MAX),
used_words(), committed_words());
diff --git a/src/hotspot/share/memory/metaspace/metachunk.hpp b/src/hotspot/share/memory/metaspace/metachunk.hpp
index efd849c6e5a36..c025343231b1c 100644
--- a/src/hotspot/share/memory/metaspace/metachunk.hpp
+++ b/src/hotspot/share/memory/metaspace/metachunk.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -362,7 +362,7 @@ class Metachunk {
#define METACHUNK_FORMAT "@" PTR_FORMAT ", %c, base " PTR_FORMAT ", level " CHKLVL_FORMAT
#define METACHUNK_FORMAT_ARGS(chunk) p2i(chunk), chunk->get_state_char(), p2i(chunk->base()), chunk->level()
-#define METACHUNK_FULL_FORMAT "@" PTR_FORMAT ", %c, base " PTR_FORMAT ", level " CHKLVL_FORMAT " (" SIZE_FORMAT "), used: " SIZE_FORMAT ", committed: " SIZE_FORMAT ", committed-free: " SIZE_FORMAT
+#define METACHUNK_FULL_FORMAT "@" PTR_FORMAT ", %c, base " PTR_FORMAT ", level " CHKLVL_FORMAT " (%zu), used: %zu, committed: %zu, committed-free: %zu"
#define METACHUNK_FULL_FORMAT_ARGS(chunk) p2i(chunk), chunk->get_state_char(), p2i(chunk->base()), chunk->level(), chunk->word_size(), chunk->used_words(), chunk->committed_words(), chunk->free_below_committed_words()
} // namespace metaspace
diff --git a/src/hotspot/share/memory/metaspace/metachunkList.cpp b/src/hotspot/share/memory/metaspace/metachunkList.cpp
index e691f9e359425..d8a956060683a 100644
--- a/src/hotspot/share/memory/metaspace/metachunkList.cpp
+++ b/src/hotspot/share/memory/metaspace/metachunkList.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/metachunkList.hpp"
#include "memory/metaspace/metaspaceCommon.hpp"
#include "utilities/debug.hpp"
diff --git a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp
index 33f1bfc46a31d..709bbfd90a119 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/metaspace/chunkManager.hpp"
@@ -84,7 +83,7 @@ MetaBlock MetaspaceArena::salvage_chunk(Metachunk* c) {
Metachunk* MetaspaceArena::allocate_new_chunk(size_t requested_word_size) {
// Should this ever happen, we need to increase the maximum possible chunk size.
guarantee(requested_word_size <= chunklevel::MAX_CHUNK_WORD_SIZE,
- "Requested size too large (" SIZE_FORMAT ") - max allowed size per allocation is " SIZE_FORMAT ".",
+ "Requested size too large (%zu) - max allowed size per allocation is %zu.",
requested_word_size, chunklevel::MAX_CHUNK_WORD_SIZE);
const chunklevel_t max_level = chunklevel::level_fitting_word_size(requested_word_size);
@@ -150,7 +149,7 @@ MetaspaceArena::~MetaspaceArena() {
c = c2;
}
- UL2(debug, "returned %d chunks, total capacity " SIZE_FORMAT " words.",
+ UL2(debug, "returned %d chunks, total capacity %zu words.",
return_counter.count(), return_counter.total_size());
_total_used_words_counter->decrement_by(return_counter.total_size());
@@ -216,7 +215,7 @@ bool MetaspaceArena::attempt_enlarge_current_chunk(size_t requested_word_size) {
// 4) Attempt to get a new chunk and allocate from that chunk.
// At any point, if we hit a commit limit, we return null.
MetaBlock MetaspaceArena::allocate(size_t requested_word_size, MetaBlock& wastage) {
- UL2(trace, "requested " SIZE_FORMAT " words.", requested_word_size);
+ UL2(trace, "requested %zu words.", requested_word_size);
const size_t aligned_word_size = get_raw_word_size_for_requested_word_size(requested_word_size);
@@ -234,7 +233,7 @@ MetaBlock MetaspaceArena::allocate(size_t requested_word_size, MetaBlock& wastag
wastage = result.split_off_tail(result.word_size() - aligned_word_size);
// Stats, logging
DEBUG_ONLY(InternalStats::inc_num_allocs_from_deallocated_blocks();)
- UL2(trace, "returning " METABLOCKFORMAT " with wastage " METABLOCKFORMAT " - taken from fbl (now: %d, " SIZE_FORMAT ").",
+ UL2(trace, "returning " METABLOCKFORMAT " with wastage " METABLOCKFORMAT " - taken from fbl (now: %d, %zu).",
METABLOCKFORMATARGS(result), METABLOCKFORMATARGS(wastage), _fbl->count(), _fbl->total_size());
// Note: free blocks in freeblock dictionary still count as "used" as far as statistics go;
// therefore we don't need to adjust any usage counters (see epilogue of allocate_inner()).
@@ -314,7 +313,7 @@ MetaBlock MetaspaceArena::allocate_inner(size_t word_size, MetaBlock& wastage) {
// chunk.
if (!current_chunk_too_small) {
if (!current_chunk()->ensure_committed_additional(word_size_plus_alignment)) {
- UL2(info, "commit failure (requested size: " SIZE_FORMAT ")", word_size_plus_alignment);
+ UL2(info, "commit failure (requested size: %zu)", word_size_plus_alignment);
commit_failure = true;
}
}
@@ -339,7 +338,7 @@ MetaBlock MetaspaceArena::allocate_inner(size_t word_size, MetaBlock& wastage) {
Metachunk* new_chunk = allocate_new_chunk(word_size);
if (new_chunk != nullptr) {
- UL2(debug, "allocated new chunk " METACHUNK_FORMAT " for requested word size " SIZE_FORMAT ".",
+ UL2(debug, "allocated new chunk " METACHUNK_FORMAT " for requested word size %zu.",
METACHUNK_FORMAT_ARGS(new_chunk), word_size);
assert(new_chunk->free_below_committed_words() >= word_size, "Sanity");
@@ -359,7 +358,7 @@ MetaBlock MetaspaceArena::allocate_inner(size_t word_size, MetaBlock& wastage) {
assert(p != nullptr, "Allocation from chunk failed.");
result = MetaBlock(p, word_size);
} else {
- UL2(info, "failed to allocate new chunk for requested word size " SIZE_FORMAT ".", word_size);
+ UL2(info, "failed to allocate new chunk for requested word size %zu.", word_size);
}
}
@@ -407,7 +406,7 @@ void MetaspaceArena::deallocate(MetaBlock block) {
#else
add_allocation_to_fbl(block);
#endif
- UL2(trace, "added to fbl: " METABLOCKFORMAT ", (now: %d, " SIZE_FORMAT ").",
+ UL2(trace, "added to fbl: " METABLOCKFORMAT ", (now: %d, %zu).",
METABLOCKFORMATARGS(block), _fbl->count(), _fbl->total_size());
SOMETIMES(verify();)
}
@@ -482,7 +481,7 @@ bool MetaspaceArena::contains(MetaBlock bl) const {
#endif // ASSERT
void MetaspaceArena::print_on(outputStream* st) const {
- st->print_cr("sm %s: %d chunks, total word size: " SIZE_FORMAT ", committed word size: " SIZE_FORMAT, _name,
+ st->print_cr("sm %s: %d chunks, total word size: %zu, committed word size: %zu", _name,
_chunks.count(), _chunks.calc_word_size(), _chunks.calc_committed_word_size());
_chunks.print_on(st);
st->cr();
diff --git a/src/hotspot/share/memory/metaspace/metaspaceArenaGrowthPolicy.cpp b/src/hotspot/share/memory/metaspace/metaspaceArenaGrowthPolicy.cpp
index 0698c1509cf38..b16f2d216103c 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceArenaGrowthPolicy.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceArenaGrowthPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/metaspaceArenaGrowthPolicy.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp b/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp
index aec656201fe81..947b4843436fe 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceCommon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/freeBlocks.hpp"
#include "memory/metaspace/metaspaceCommon.hpp"
#include "memory/metaspace/metaspaceSettings.hpp"
@@ -98,9 +97,9 @@ void print_human_readable_size(outputStream* st, size_t byte_size, size_t scale,
if (width == -1) {
if (scale == 1) {
- st->print(SIZE_FORMAT " bytes", byte_size);
+ st->print("%zu bytes", byte_size);
} else if (scale == BytesPerWord) {
- st->print(SIZE_FORMAT " words", byte_size / BytesPerWord);
+ st->print("%zu words", byte_size / BytesPerWord);
} else {
const char* display_unit = display_unit_for_scale(scale);
float display_value = (float) byte_size / (float)scale;
@@ -162,9 +161,9 @@ const char* classes_plural(uintx num) {
}
void print_number_of_classes(outputStream* out, uintx classes, uintx classes_shared) {
- out->print(UINTX_FORMAT " %s", classes, classes_plural(classes));
+ out->print("%zu %s", classes, classes_plural(classes));
if (classes_shared > 0) {
- out->print(" (" UINTX_FORMAT " shared)", classes_shared);
+ out->print(" (%zu shared)", classes_shared);
}
}
diff --git a/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp b/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp
index d296ffd6cd7f0..e9f51d05aa5cb 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceCommon.hpp
@@ -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.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -80,8 +80,8 @@ void print_percentage(outputStream* st, size_t total, size_t part);
#ifdef ASSERT
#define assert_is_aligned(value, alignment) \
assert(is_aligned((value), (alignment)), \
- SIZE_FORMAT_X " is not aligned to " \
- SIZE_FORMAT_X, (size_t)(uintptr_t)value, (size_t)(alignment))
+ "0x%zx is not aligned to 0x%zx", \
+ (size_t)(uintptr_t)value, (size_t)(alignment))
#define assert_is_aligned_metaspace_pointer(p) \
assert_is_aligned((p), metaspace::AllocationAlignmentByteSize)
#else
diff --git a/src/hotspot/share/memory/metaspace/metaspaceContext.cpp b/src/hotspot/share/memory/metaspace/metaspaceContext.cpp
index b43f4cd3b15b2..b38e32e23f63a 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceContext.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/chunkManager.hpp"
#include "memory/metaspace/commitLimiter.hpp"
#include "memory/metaspace/metaspaceContext.hpp"
diff --git a/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp b/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp
index 32fee96ad7d09..0ab83b44a7627 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace.hpp"
#include "memory/metaspace/metaspaceDCmd.hpp"
#include "memory/metaspace/metaspaceReporter.hpp"
diff --git a/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp b/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp
index cbd2400444ff0..3cff2a50d033f 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp
@@ -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.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "cds/cdsConfig.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/classLoaderDataGraph.hpp"
@@ -218,7 +217,7 @@ void MetaspaceReporter::print_report(outputStream* out, size_t scale, int flags)
{
uintx num_loaders = cl._num_loaders_by_spacetype[space_type];
uintx num_classes = cl._num_classes_by_spacetype[space_type];
- out->print("%s - " UINTX_FORMAT " %s",
+ out->print("%s - %zu %s",
describe_spacetype((Metaspace::MetaspaceType)space_type),
num_loaders, loaders_plural(num_loaders));
if (num_classes > 0) {
@@ -239,7 +238,7 @@ void MetaspaceReporter::print_report(outputStream* out, size_t scale, int flags)
out->cr();
{
uintx num_loaders = cl._num_loaders;
- out->print("Total Usage - " UINTX_FORMAT " %s, ",
+ out->print("Total Usage - %zu %s, ",
num_loaders, loaders_plural(num_loaders));
print_number_of_classes(out, cl._num_classes, cl._num_classes_shared);
out->print(":");
@@ -360,7 +359,7 @@ void MetaspaceReporter::print_report(outputStream* out, size_t scale, int flags)
cl._stats_total._arena_stats_class._free_blocks_word_size;
out->print("Deallocated from chunks in use: ");
print_scaled_words_and_percentage(out, free_blocks_cap_words, committed_words, scale, 6);
- out->print(" (" UINTX_FORMAT " blocks)", free_blocks_num);
+ out->print(" (%zu blocks)", free_blocks_num);
out->cr();
// Print total waste.
diff --git a/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp b/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp
index b812341a2da34..23d38e0d77544 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/metaspace/metaspaceSettings.hpp"
@@ -49,9 +48,9 @@ void Settings::ergo_initialize() {
}
void Settings::print_on(outputStream* st) {
- st->print_cr(" - commit_granule_bytes: " SIZE_FORMAT ".", commit_granule_bytes());
- st->print_cr(" - commit_granule_words: " SIZE_FORMAT ".", commit_granule_words());
- st->print_cr(" - virtual_space_node_default_size: " SIZE_FORMAT ".", virtual_space_node_default_word_size());
+ st->print_cr(" - commit_granule_bytes: %zu.", commit_granule_bytes());
+ st->print_cr(" - commit_granule_words: %zu.", commit_granule_words());
+ st->print_cr(" - virtual_space_node_default_size: %zu.", virtual_space_node_default_word_size());
st->print_cr(" - enlarge_chunks_in_place: %d.", (int)enlarge_chunks_in_place());
}
diff --git a/src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp b/src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp
index 32329831e7cc5..d4cf551d05428 100644
--- a/src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp
+++ b/src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp
@@ -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.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "memory/metaspace/metaspaceCommon.hpp"
#include "memory/metaspace/metaspaceStatistics.hpp"
#include "utilities/debug.hpp"
@@ -128,7 +127,7 @@ void InUseChunkStats::print_on(outputStream* st, size_t scale) const {
void InUseChunkStats::verify() const {
assert(_word_size >= _committed_words &&
_committed_words == _used_words + _free_words + _waste_words,
- "Sanity: cap " SIZE_FORMAT ", committed " SIZE_FORMAT ", used " SIZE_FORMAT ", free " SIZE_FORMAT ", waste " SIZE_FORMAT ".",
+ "Sanity: cap %zu, committed %zu, used %zu, free %zu, waste %zu.",
_word_size, _committed_words, _used_words, _free_words, _waste_words);
}
#endif
@@ -174,13 +173,13 @@ void ArenaStats::print_on(outputStream* st, size_t scale, bool detailed) const
}
if (_free_blocks_num > 0) {
st->cr_indent();
- st->print("deallocated: " UINTX_FORMAT " blocks with ", _free_blocks_num);
+ st->print("deallocated: %zu blocks with ", _free_blocks_num);
print_scaled_words(st, _free_blocks_word_size, scale);
}
} else {
totals().print_on(st, scale);
st->print(", ");
- st->print("deallocated: " UINTX_FORMAT " blocks with ", _free_blocks_num);
+ st->print("deallocated: %zu blocks with ", _free_blocks_num);
print_scaled_words(st, _free_blocks_word_size, scale);
}
}
diff --git a/src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.cpp b/src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.cpp
index 100a009ca8738..8dc16cd177746 100644
--- a/src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.cpp
+++ b/src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -23,7 +23,6 @@
*
*/
-#include "precompiled.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/javaClasses.hpp"
#include "memory/classLoaderMetaspace.hpp"
@@ -106,7 +105,7 @@ void PrintCLDMetaspaceInfoClosure::do_cld(ClassLoaderData* cld) {
// Optionally, print
if (_do_print) {
- _out->print(UINTX_FORMAT_W(4) ": ", _num_loaders);
+ _out->print("%4zu: ", _num_loaders);
// Print "CLD for [,] instance of "
// or "CLD for