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

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


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

>> src/hotspot/share/prims/jvmtiRedefineClasses.cpp line 4053:
>> 
>>> 4051: }
>>> 4052: 
>>> 4053: void VM_RedefineClasses::compute_matching_methods() {
>> 
>> I can't see that this method actually still does anything useful. ??
>
> I think it does:
>  - has asserts on added/deleted methods
>  - collects `_matching_old_methods` and `_matching_new_methods`
>  
>  It seems that the `_old_methods` is same as `_matching_old_methods` and `_new_methods` is same as `_matching_new_methods`. But I do not want to make a deeper refactoring at this point until we have a decision on the full removal of added/deleted methods support. It feels like we may need to keep some support for lambda expression changes in class redefinitions/retransformations.

What this does now is that the redefined class can have matching method names in a different order because of the signature.  So this sorts this out.  I don't know why we don't sort methods according to name and signature when creating the klass though.  That would make this just a method to check that the methods match.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26232#discussion_r2200944838


More information about the hotspot-dev mailing list