From 180df75095c38f9bbc2aca2e9bf7618cf4482fcb Mon Sep 17 00:00:00 2001 From: Dan Heidinga Date: Mon, 20 Nov 2023 14:19:43 -0500 Subject: [PATCH] JDK-8320335: Deprecate `RegisterFinalizersAtInit` option and code Deprecate the -XX:[+-]RegisterFinalizersAtInit option in JDK22. Goal is complete removal by JDK24. --- src/hotspot/share/runtime/arguments.cpp | 1 + src/hotspot/share/runtime/globals.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index dc1e15121b282..f6c1b0003e83c 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -509,6 +509,7 @@ static SpecialFlag const special_jvm_flags[] = { { "DynamicDumpSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, + { "RegisterFinalizersAtInit", JDK_Version::jdk(22), JDK_Version::jdk(23), JDK_Version::jdk(24) }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 4ae156a773ea3..f3c1ceab3d7fa 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -667,8 +667,8 @@ const int ObjectAlignmentInBytes = 8; "Print JVM warnings to output stream") \ \ product(bool, RegisterFinalizersAtInit, true, \ - "Register finalizable objects at end of Object. or " \ - "after allocation") \ + "(Deprecated) Register finalizable objects at end of " \ + "Object. or after allocation") \ \ develop(bool, RegisterReferences, true, \ "Tell whether the VM should register soft/weak/final/phantom " \