RFR: 8371431: Warning message when turning off CompactStrings

David Holmes dholmes at openjdk.org
Mon Nov 10 00:46:29 UTC 2025


On Mon, 27 Oct 2025 20:21:03 GMT, Chen Liang <liach at openjdk.org> wrote:

>> A warning message should be given before removing the CompactStrings off option.
>
> I think the code change looks like:
> 
> diff --git a/src/hotspot/cpu/arm/globals_arm.hpp b/src/hotspot/cpu/arm/globals_arm.hpp
> index 363a9a2c25c..d64615dd142 100644
> --- a/src/hotspot/cpu/arm/globals_arm.hpp
> +++ b/src/hotspot/cpu/arm/globals_arm.hpp
> @@ -69,7 +69,7 @@ define_pd_global(bool,  PreserveFramePointer,     false);
>  define_pd_global(uintx, TypeProfileLevel, 0);
>  
>  // No performance work done here yet.
> -define_pd_global(bool, CompactStrings, false);
> +define_pd_global(bool, CompactStrings, true);
>  
>  define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
>  
> diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
> index 0d92f22af79..ac9eb7b6932 100644
> --- a/src/hotspot/share/runtime/arguments.cpp
> +++ b/src/hotspot/share/runtime/arguments.cpp
> @@ -541,6 +541,7 @@ static SpecialFlag const special_jvm_flags[] = {
>  
>    // -------------- Obsolete Flags - sorted by expired_in --------------
>  
> +  { "CompactStrings",                JDK_Version::jdk(25),  JDK_Version::jdk(27), JDK_Version::jdk(28) },
>  #ifdef LINUX
>    { "UseOprofile",                  JDK_Version::jdk(25), JDK_Version::jdk(26), JDK_Version::jdk(27) },
>  #endif
> 
> 
> And backport the arguments.cpp but not globals_arm back to 25 updates.

@liach we can't just enable CS for ARM-32-bit. Unclear if it even works if you try to do that, but there are no C2 intrinsics related to CS so performance could take quite a hit.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27995#issuecomment-3465595986


More information about the hotspot-dev mailing list