RFR: 8294954: Remove superfluous ResourceMarks when using LogStream

Johan Sjölen jsjolen at openjdk.org
Wed Mar 26 07:41:12 UTC 2025


On Fri, 21 Mar 2025 15:38:21 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

> Hi everyone,
> 
> This PR removes redundant `ResourceMark` instances where `LogStream` is used. Previously, `LogStream` inherited from `ResourceObj`, which required a `ResourceMark`, but this is no longer the case, making these instances unnecessary.
> 
> Process:
> 1. I added assertions to check for resource unwinding in places where `ResourceMark`s were used with `LogStream`s.
> 2. Ran tests up to tier7 to confirm no unwinding was happening. This helped filter out cases where `ResourceMark`s were still required for other reasons.
> 3. Manually verified the remaining cases by tracing function calls to ensure the `ResourceMark`s were truly unnecessary.
> 4. Removed the redundant `ResourceMark` instances.

OK with this

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

Marked as reviewed by jsjolen (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24162#pullrequestreview-2716150401


More information about the hotspot-dev mailing list