RFR: 8325467: Support methods with many arguments in C2 [v16]

Daniel Lundén dlunden at openjdk.org
Thu Apr 10 09:50:49 UTC 2025


On Wed, 9 Apr 2025 14:37:38 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Daniel Lundén has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Update comments
>>  - Revise TestNestedSynchronize to make use of CompileFramework
>
> test/hotspot/jtreg/compiler/locks/TestNestedSynchronize.java line 106:
> 
>> 104:                   %s
>> 105:                           }""", test_class_name, inner);
>> 106:             }
> 
> Probably this is not so bad with only 100 repetitions ... but this leads to a lot of successive strings generated, resulting in larger and larger strings allocated, essentially requiring quadratic memory. A StringBuilder would help here. Maybe this is just an FYI: the TemplateFramework internally uses a StringBuilder to avoid this successive concatenation / allocation issue.

Thanks for the comment; I implemented it in this way for readability. I refactored it now to avoid the quadratic behavior (assuming `addAll`, `addFirst`, and `addLast` are O(1) for `LinkedList`, and that `String.join` is linear). Please have a look! `StringBuilder` is efficient for appending, but not prepending, right?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2036961838


More information about the hotspot-compiler-dev mailing list