RFR: JDK-8269650: Optimize gc-locker in [Get|Release]StringCritical for latin string

Kim Barrett kbarrett at openjdk.java.net
Wed Jun 30 21:45:00 UTC 2021


On Wed, 30 Jun 2021 11:55:49 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Currently, JNI GetStringCritical locks gc locker for all strings including latin and non-latin until ReleaseStringCritical.
> But for latin, it's not necessary to still lock gc locker after GetStringCritical, as it's copied anyway whether obj pining is supported or not, so it's fine to unlock gc locker after GetStringCritical.

It turns out that fixing JDK-8269661 involves some code rearrangement that makes it both simple and obvious to not do the gc-locker/pinning in the latin1 case; it would actually make things messier to not include that change.  So unless David's research comes up with something unexpected, I'll probably take over the optimization as part of that bug fix.  Still need to do more testing before sending out a PR.

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

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


More information about the hotspot-dev mailing list