On Mon, 10 Aug 2026 17:50:36 GMT, Coleen Phillimore <[email protected]> wrote:

>> This patch removes the work to save the Method name in the backtrace that 
>> was used for the case where redefinition could delete the method that was on 
>> the stack in the stack trace, but saved then deleted with redefinition 
>> later. RedefineClasses' ability to add/delete methods has been deprecated 
>> for many releases, so adding code and memory for this case is wasting space 
>> and time. This change speeds up Throwable microbenchmarks by about 10-30%, 
>> and speeds up DaCapo pmd by a bit.
>> 
>> Remerged with the change to factor out javaStackTraceClasses.
>> 
>> Tested with tier1-4.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Coleen Phillimore has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Change redefine deleted name

Looks good so far, just leaving some drive-by comments before I get deeper into 
the code. Mostly nits

src/hotspot/share/classfile/javaStackTraceClasses.cpp line 247:

> 245: 
> 246:  private:
> 247:   // Move this up.

Leftover comment here

src/hotspot/share/classfile/javaStackTraceClasses.cpp line 291:

> 289:     }
> 290: 
> 291:     _methods_and_bcis->long_at_put(_index,

Indentation seems off here

src/hotspot/share/classfile/javaStackTraceClasses.cpp line 769:

> 767: }
> 768: 
> 769: 

Extra line deleted here

src/hotspot/share/classfile/javaStackTraceClasses.cpp line 1222:

> 1220: }
> 1221: 
> 1222: 

Extra line deleted

test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineRunningMethodsWithBacktrace.java
 line 137:

> 135:         // The first version of this method is running so we have the 
> line number,
> 136:         // the second is cleaned up, so we don't, the third version is 
> current so we do.
> 137:         return lineNumber == 82 || lineNumber == -1 || lineNumber == 13;

Can these be fields instead of constants? I'm concerned that some change 
elsewhere could cascade and change the line numbers down the line.

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

Changes requested by matsaave (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/32202#pullrequestreview-4940996207
PR Review Comment: https://git.openjdk.org/jdk/pull/32202#discussion_r3786997326
PR Review Comment: https://git.openjdk.org/jdk/pull/32202#discussion_r3786999073
PR Review Comment: https://git.openjdk.org/jdk/pull/32202#discussion_r3787001397
PR Review Comment: https://git.openjdk.org/jdk/pull/32202#discussion_r3787002572
PR Review Comment: https://git.openjdk.org/jdk/pull/32202#discussion_r3787010589

Reply via email to