Integrated: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle

Mandy Chung mchung at openjdk.org
Fri Jan 20 17:28:56 UTC 2023


On Thu, 19 Jan 2023 19:14:38 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> `VarHandles.getStaticFieldFromBaseAndOffset` maps a base/offset/fieldType to a static `Field`.   It's fragile to assume that the location of a static field returned by `Unsafe.staticFieldBase` is a Class object.    This changes the VarHandle implementation for static fields (i.e. `FieldStaticReadOnly` and `FieldStaticReadWrite` classes) to include the receiver type in addition to the base and offset.

This pull request has now been integrated.

Changeset: facd4151
Author:    Mandy Chung <mchung at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/facd41511b972e940ecab3bc57f5f23efca43343
Stats:     35 lines in 2 files changed: 2 ins; 2 del; 31 mod

8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle

Reviewed-by: psandoz, alanb

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

PR: https://git.openjdk.org/jdk/pull/12100


More information about the core-libs-dev mailing list