Integrated: 8285007: Use correct lookup mode for MethodHandleStatics.UNSAFE

Claes Redestad redestad at openjdk.java.net
Tue Apr 19 20:28:29 UTC 2022


On Tue, 19 Apr 2022 13:19:31 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Trivially fix the resolution of the `NF_UNSAFE` named function to use the appropriate lookup mode.
> 
> In [JDK-8187826](https://bugs.openjdk.java.net/browse/JDK-8187826) we changed from regular reflection to use a `NamedFunction` for this field, but it appears the lookup mode came out wrong. This mismatch appears to be benign and ignored by HotSpot, but a user implementing an experimental JVM ran into some issues (and additionally noticed the resolve throws the wrong exception). 
> 
> This patch is a point fix to this particular issue, but I think we should consider following up with a stronger assertion or test for proper staticness of fields somewhere when resolving fields via `MemberName.getFactory().resolveOrNull(..)`.

This pull request has now been integrated.

Changeset: 5d1ec54d
Author:    Claes Redestad <redestad at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/5d1ec54d6c20dfe67a459c9d102cdfa0394bcc1e
Stats:     3 lines in 1 file changed: 0 ins; 0 del; 3 mod

8285007: Use correct lookup mode for MethodHandleStatics.UNSAFE

Reviewed-by: psandoz, mchung

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

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


More information about the core-libs-dev mailing list