On Thu, 19 Jan 2023 19:14:38 GMT, Mandy Chung <mch...@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. src/java.base/share/classes/java/lang/invoke/VarHandles.java line 187: > 185: // Required by instance static field handles > 186: static Field getStaticFieldFromBaseAndOffset(Class<?> receiverType, > 187: Object base, `base` is now unused. ------------- PR: https://git.openjdk.org/jdk/pull/12100