On Mon, 30 Jun 2025 11:53:36 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiImpl.cpp line 188:
>> 
>>> 186: 
>>> 187: void VM_ChangeBreakpoints::doit() {
>>> 188:  if (_bp->method() != Method::resolve_jmethod_id(_preservred_method)) {
>> 
>> Suggestion:
>> 
>>  if (_bp->method() != Method::resolve_jmethod_id(_preserved_method)) {
>
> I see what you're doing.  You're checking if the methodID is changed by 
> redefinition. Can you just check if the method->is_old() and skip the 
> breakpoint then?  Although the callers might want a breakpoint at the new 
> method if it's emcp.  Maybe it could call Method::get_new_method() if is_old 
> and set the breakpoint on the new method?

Or as you say, the breakpoint will be cleared by the redefinition anyway if the 
VM_ChangeBreakpoints::doit() succeeded before it, so returning an error should 
be fine too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26031#discussion_r2174902032

Reply via email to