RFR: 8349191: Test compiler/ciReplay/TestIncrementalInlining.java failed
Benoît Maillard
bmaillard at openjdk.org
Mon Aug 11 10:59:12 UTC 2025
On Thu, 7 Aug 2025 09:00:37 GMT, Benoît Maillard <bmaillard at openjdk.org> wrote:
>> src/hotspot/share/opto/printinlining.cpp line 52:
>>
>>> 50: stringStream ss;
>>> 51: _root.dump(&ss, -1);
>>> 52: tty->print_raw(ss.freeze());
>>
>> General thought: I see that we use the proposed pattern to print a `stringStream` in existing code but also a different pattern with `as_string()`:
>> https://github.com/openjdk/jdk/blob/c56fb0b6eff7d3f36bc65f300b784e0dd73c563e/src/hotspot/share/opto/compile.cpp#L614
>>
>> Can anybody comment on which one is preferred?
>
> Good point, I am also curious about the answer.
It seems that `as_string()` makes a copy of the internal buffer and returns a pointer to it, while `freeze()` simply returns a pointer to the internal buffer. Then it looks like `freeze()` is the right thing to use here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26654#discussion_r2266341686
More information about the hotspot-compiler-dev
mailing list