RFR: 8358890: VM option -XX:AllowRedefinitionToAddDeleteMethods should be obsoleted then expired [v3]

Coleen Phillimore coleenp at openjdk.org
Fri Jul 11 15:05:40 UTC 2025


On Fri, 11 Jul 2025 05:49:40 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> The VM option -XX:AllowRedefinitionToAddDeleteMethods was added in JDK 13 as a temporary backward compatibility flag under JDK-8192936 and was immediately marked as Deprecate. The fix is to obsolete this option in JDK 26 and expire in JDK 27.
>> 
>> TBD: Need to submit a related CSR.
>> 
>> There are two concerns which may require some negotiation with the Runtime (@coleenp @dcubed-ojdk @dholmes-ora) and SQE (@lmesnik) teams:
>>  - Class redefinition/retransformation can impact lambda expressions which are supported with private methods
>>  - Many tests depend on this VM option and are being removed. I'm not sure if it is okay to completely remove those e may want another way to handle this (e.g. problem-listing the impacted tests for now).
>>  
>> Testing:
>>  - mach5 tiers 1-6 are good
>>  - may need to run mach5 tiers > 6
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review: keep right order of the obsoleted VM options

It's nice to be able to clean this code out but I also think it's being used in the wild.  Was there another mechanism that we suggest for instrumenting native methods?  And there was code once to prefix native methods so this adding private method mechanism worked.

src/hotspot/share/oops/methodFlags.hpp line 49:

> 47:    status(is_old                      , 1 << 2) /* RedefineClasses() has replaced this method */ \
> 48:    status(is_obsolete                 , 1 << 3) /* RedefineClasses() has made method obsolete */ \
> 49:    status(RESERVED                    , 1 << 4) \

Maybe change to unused rather than reserved.

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

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26232#pullrequestreview-3010624569
PR Review Comment: https://git.openjdk.org/jdk/pull/26232#discussion_r2200936076


More information about the hotspot-dev mailing list