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

Daniel Lundén dlunden at openjdk.org
Fri Apr 25 18:30:11 UTC 2025


On Wed, 23 Apr 2025 08:39:28 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Refactor and improve TestNestedSynchronize.java
>
> test/hotspot/jtreg/compiler/locks/TestNestedSynchronize.java line 107:
> 
>> 105:         acc.addFirst(String.format("public class %s {", test_class_name));
>> 106:         acc.addLast("}");
>> 107:         return String.join("\n", acc);
> 
> Nit: What prevented you from generating it with a `ArrayList`, and just only append at the end?
> 
> In fact, that would allow you to use a StringBuilder directly.
> 
> And you could format the `synchronized` string only once. That might be even more efficient.
> 
> You can also leave it, this is really a nit :)

Nothing prevented it, it just felt more natural doing it in this way. I guess a habit from doing a lot of functional programming :slightly_smiling_face:  It should have the same time complexity now as using a `StringBuilder` (linear), so I'd prefer leaving it as is unless you strongly object!

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

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


More information about the hotspot-compiler-dev mailing list