RFR: 8341696: C2: Non-fluid StringBuilder pattern bails out in OptoStringConcat

theoweidmannoracle duke at openjdk.org
Wed Dec 4 08:26:01 UTC 2024


Extends stringopts to also recognize non-fluid uses of StringBuilder and optimize them the same way.

For example, this basic case was not optimized before and is optimized with this PR:


StringBuilder sb = new StringBuilder();
sb.append("a");
sb.append(a);
return sb.toString();

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

Commit messages:
 - Fix copyright year
 - Correctly handle constructor
 - Move into method
 - Update copyright
 - Add non-fluid stringopt

Changes: https://git.openjdk.org/jdk/pull/22537/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22537&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8341696
  Stats: 312 lines in 4 files changed: 249 ins; 43 del; 20 mod
  Patch: https://git.openjdk.org/jdk/pull/22537.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22537/head:pull/22537

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


More information about the hotspot-compiler-dev mailing list