RFR: 8303078: Reduce allocations when pretty printing JCTree during compilation [v3]

Christoph Dreis duke at openjdk.org
Wed Feb 22 19:02:56 UTC 2023


On Wed, 22 Feb 2023 18:57:47 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Done - but had to change the one with the `sep` argument to take a char instead of String. Seems not used elsewhere, but wasn't sure because of the `protected`
>
> While `DocPretty` is public, the package is not publicly exported from the `jdk.compiler` module, and there are no subtypes within the JDK code base, so I think we can ignore the `protected` for now.
> 
> If we wanted to be paranoid, it would be reasonable to change `print(char)` to something along the lines of
> 
> if (Character.isASCII(ch)) out.write(ch); else print((Character) ch);

Should we (I in that case) be paranoid, though? I would leave it as-is. There is a big class comment above that anyone depending on the internal api uses this at his own risk.

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

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


More information about the compiler-dev mailing list