RFR: 8254807: Optimize startsWith() for String.substring()

Kelvin Nilsen github.com+51720475+kdnilsen at openjdk.java.net
Thu Nov 12 02:35:55 UTC 2020


On Fri, 16 Oct 2020 17:15:16 GMT, Xin Liu <xliu at openjdk.org> wrote:

> 8254807: Optimize startsWith() for String.substring()

src/hotspot/share/opto/stringopts.cpp line 54:

> 52:   return false;
> 53: }
> 54: 

Was there a reason to shift the order of this function with respect to class StringConcat declaration?  The change in ordering makes it more difficult to spot the differences, if any.

src/hotspot/share/opto/stringopts.cpp line 572:

> 570: }
> 571: 
> 572: void PhaseStringOpts::eliminate_call(CallNode* call, CallProjections& projs) {

Similar comment here.  Could the eliminate_call() function after patch be in same sequence as before patch?

test/hotspot/jtreg/compiler/c2/TestOptimizeSubstring.java line 77:

> 75:         String newStringAlloc = /*call ,*/"static  wrapper for: _new_array_nozero_Java";
> 76:         try {
> 77:             oa = ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions", "-Xbootclasspath/a:.",

Is this comment identifying a future TODO item?  That's not entirely clear to me.

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

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


More information about the hotspot-compiler-dev mailing list