RFR: 8297757: VarHandles.getStaticFieldFromBaseAndOffset should get the receiver type from VarHandle [v2]

Alan Bateman alanb at openjdk.org
Fri Jan 20 06:59:29 UTC 2023


On Thu, 19 Jan 2023 23:37:17 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.
>
> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove the base parameter which is unused

Marked as reviewed by alanb (Reviewer).

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

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


More information about the core-libs-dev mailing list