[jdk11u-dev] Integrated: 8269661: JNI_GetStringCritical does not lock char array

Zhengyu Gu zgu at openjdk.java.net
Mon Jul 26 18:12:34 UTC 2021


On Wed, 7 Jul 2021 18:09:53 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> I would like to backport this patch to openjdk11u.
> 
> This patch mainly impacts Shenandoah GC, which is the only GC that supports object pinning and string deduplication.
> 
> The original patch does not apply cleanly, because it uses new string deduplication API introduced in jdk17. openjdk11u cannot prevent a string from being deduplicated, so it risks the possibility that string deduplication modifies string value while string critical session is in progress.
> 
> I purpose to take an alternative approach in openjdk11u: return a copy of string value when object pinning + string deduplication is enabled.
> 
> Test:
> - [x] tier1 with UseShenandoahGC + UseStringDeduplication on Linux x86_64.

This pull request has now been integrated.

Changeset: 2a3d9080
Author:    Zhengyu Gu <zgu at openjdk.org>
URL:       https://git.openjdk.java.net/jdk11u-dev/commit/2a3d9080e19282f8451cdb93e3e36191f622ea3c
Stats:     60 lines in 1 file changed: 43 ins; 9 del; 8 mod

8269661: JNI_GetStringCritical does not lock char array
8269650: Optimize gc-locker in [Get|Release]StringCritical for latin string

Reviewed-by: shade
Backport-of: 0f4e07b7d9190dd44b2fd65eff58fb6ec983a467

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

PR: https://git.openjdk.java.net/jdk11u-dev/pull/109


More information about the jdk-updates-dev mailing list