RFR: 8254807: Optimize startsWith() for String.substring() [v2]

Xin Liu xliu at openjdk.java.net
Tue Nov 10 23:04:20 UTC 2020


> The optimization transforms code from s=substring(base, beg, end); s.startsWith(prefix)
> to substring(base, beg, end) | base.startsWith(prefix, beg). 
> 
> it reduces uses of substring. hopefully c2 optimizer can remove the used substring.

Xin Liu has updated the pull request incrementally with one additional commit since the last revision:

  8254807: Optimize startsWith() for String.substring()
  
  improve microbenchmark based on the PR feedback.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/974/files
  - new: https://git.openjdk.java.net/jdk/pull/974/files/56108f76..2543aa88

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=974&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=974&range=00-01

  Stats: 180 lines in 2 files changed: 110 ins; 70 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/974.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/974/head:pull/974

PR: https://git.openjdk.java.net/jdk/pull/974


More information about the hotspot-compiler-dev mailing list