RFR: 8324129: C2: Remove some ttyLocker usages in preparation for JDK-8306767
David Holmes
dholmes at openjdk.org
Mon Jan 22 10:36:35 UTC 2024
On Fri, 19 Jan 2024 08:03:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> FTR the code should not be assuming that `st` is `tty`!
>
>> Is that also a concern in this method?
>
> I don't think so, since `BytecodeTracer::print_method_codes` has its own local instance of `BytecodePrinter`, whereas `BytecodeTracer::trace_interpreter` uses the global instance `_interpreter_printer`.
>
> Using the `ttyLocker` for mutual exclusion on `_interpreter_printer` seems a bit ugly, and the comment seems to suggest as much. We can fix that in the future, if we want.
>
>> FTR the code should not be assuming that st is tty!
>
> Why are you saying that? I guess, yes, the code was already suspicios, since `st` was not guaranteed to be `tty`. But taking the `ttyLocker` was kinda ok if it was tty or now. Anyway, it is better if it is gone now.
I was just pointing out that the code was "wrong" to assume `st` had to be the tty - though as you point out it is harmless even if not useful.
Thanks for clarifying that we don't need the ttyLocker for mutual exclusion here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17486#discussion_r1461660805
More information about the hotspot-dev
mailing list