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

Christoph Dreis duke at openjdk.org
Wed Feb 22 18:22:16 UTC 2023


On Wed, 22 Feb 2023 17:59:17 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Christoph Dreis has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - 8303078: Replace some more character print calls
>>  - 8303078: Replace some more character print calls
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java line 195:
> 
>> 193:     public Void visitDocRoot(DocRootTree node, Void p) {
>> 194:         try {
>> 195:             print("{");
> 
> there are some instances of `print("\n");` that could be `print('\n');` few lines above this point

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`

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

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


More information about the compiler-dev mailing list