Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accelerate java.lang.String.indexOf(String, int) in Java 9+ #6404

Open
fjeremic opened this issue Jul 9, 2019 · 0 comments
Open

Accelerate java.lang.String.indexOf(String, int) in Java 9+ #6404

fjeremic opened this issue Jul 9, 2019 · 0 comments

Comments

@fjeremic
Copy link
Contributor

fjeremic commented Jul 9, 2019

While investigating #6403 I noted that we did not have to make the fix for Java 9+. The reason is because of the way we implement the indexOf(String, int) API in Java 9+ [1] using the helpers already available in StringLatin1 and StringUTF16. These helper methods [2] [3] effectively reduce to the JITHelpers intrinsicIndexOfStringLatin1 and intrinsicIndexOfStringUTF16 APIs which already exist and which we already take advantage of for Java 8.

We need to investigate whether we can map the StringLatin1 and StringUTF16 intrinsics to our existing JITHelper methods and make sure we intrinsically reduce the java.lang.String.indexOf API on Java 9+. We should also take this opportunity to see if we can map the character overload of the indexOf API to the APIs which exist in StringLatin1 and StringUTF16.

[1] https://github.com/eclipse/openj9/blob/eb860ecf4551c9982b0bc4ca9c6fed61fe70868c/jcl/src/java.base/share/classes/java/lang/String.java#L2033-L2066
[2] https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/91be2043cf6c6008939b34e33ce381479638405c/src/java.base/share/classes/java/lang/StringLatin1.java#L232-L253
[3] https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/91be2043cf6c6008939b34e33ce381479638405c/src/java.base/share/classes/java/lang/StringUTF16.java#L383-L388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant