Correct way to use VarHandle in Java 9?
It is used for instance in AtomicReference, where previously in Java 8, sun.misc.Unsafe was used: public final void lazySet(V newValue) { unsafe.putOrderedObject(this, valueOffset, newValue); } public final boolean compareAndSet(V expect, V update) { return unsafe.compareAndSwapObject(this, valueOffset, expect, update); } Here the this pointer is used together with a field offset to access the field. But …