RFR: 8294954: Remove superfluous ResourceMarks when using LogStream

Casper Norrbin cnorrbin at openjdk.org
Fri Mar 21 15:45:45 UTC 2025


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.

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

Commit messages:
 - remove resourcemark extra assert
 - removed logstream resourcemarks

Changes: https://git.openjdk.org/jdk/pull/24162/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24162&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8294954
  Stats: 40 lines in 26 files changed: 1 ins; 39 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/24162.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24162/head:pull/24162

PR: https://git.openjdk.org/jdk/pull/24162


More information about the hotspot-dev mailing list