RFR: 8327247: C2 uses up to 2GB of RAM to compile complex string concat in extreme cases [v3]
Aleksey Shipilev
shade at openjdk.org
Fri Apr 26 09:11:34 UTC 2024
On Fri, 26 Apr 2024 08:45:45 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> Splitting out the ASM-based version from #18690 to push that first under the JBS (to help backporting). Keeping #18690 open to rebase and follow-up on this as a subtask. See discussion in that #18690 for more details, discussion and motivation for this.
>
> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>
> Copyright and comment about ProxyClassDumper
Looks okay, thanks. Only cosmetic nits:
src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line 108:
> 106: static {
> 107: String highArity = VM.getSavedProperty("java.lang.invoke.StringConcat.highArityThreshold");
> 108: HIGH_ARITY_THRESHOLD = Integer.parseInt(highArity != null ? highArity : "20");
Maybe write this as `= (highArity != null) ? Integer.parseInt(highArity) : 20` to help interpreter a bit.
src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line 1105:
> 1103: for (int c = 0; c < constants.length; c++) {
> 1104: if (constants[c] != null)
> 1105: len += constants[c].length();
Braces?
src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line 1118:
> 1116: );
> 1117:
> 1118:
Extra new-line?
src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line 1164:
> 1162: }
> 1163:
> 1164:
Extra new-line?
-------------
Marked as reviewed by shade (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18953#pullrequestreview-2024514742
PR Review Comment: https://git.openjdk.org/jdk/pull/18953#discussion_r1580723293
PR Review Comment: https://git.openjdk.org/jdk/pull/18953#discussion_r1580723981
PR Review Comment: https://git.openjdk.org/jdk/pull/18953#discussion_r1580724174
PR Review Comment: https://git.openjdk.org/jdk/pull/18953#discussion_r1580724568
More information about the core-libs-dev
mailing list