Uses of Class
java.lang.invoke.VarHandle
Packages that use VarHandle
Package
Description
The
java.lang.invoke
package provides low-level primitives for interacting
with the Java Virtual Machine. Classes to support low-level, safe and efficient memory access.
-
Uses of VarHandle in java.lang.invoke
Methods in java.lang.invoke that return VarHandleModifier and TypeMethodDescriptionstatic VarHandle
MethodHandles.arrayElementVarHandle(Class<?> arrayClass)
Produces a VarHandle giving access to elements of an array of typearrayClass
.static VarHandle
ConstantBootstraps.arrayVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> arrayClass)
Finds aVarHandle
for an array type.static VarHandle
MethodHandles.byteArrayViewVarHandle(Class<?> viewArrayClass, ByteOrder byteOrder)
Produces a VarHandle giving access to elements of abyte[]
array viewed as if it were a different primitive array type, such asint[]
orlong[]
.static VarHandle
MethodHandles.byteBufferViewVarHandle(Class<?> viewArrayClass, ByteOrder byteOrder)
Produces a VarHandle giving access to elements of aByteBuffer
viewed as if it were an array of elements of a different primitive component type to that ofbyte
, such asint[]
orlong[]
.static VarHandle
ConstantBootstraps.fieldVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> declaringClass, Class<?> fieldType)
Finds aVarHandle
for an instance field.MethodHandles.Lookup.findStaticVarHandle(Class<?> decl, String name, Class<?> type)
Produces a VarHandle giving access to a static fieldname
of typetype
declared in a class of typedecl
.MethodHandles.Lookup.findVarHandle(Class<?> recv, String name, Class<?> type)
Produces a VarHandle giving access to a non-static fieldname
of typetype
declared in a class of typerecv
.VarHandle.VarHandleDesc.resolveConstantDesc(MethodHandles.Lookup lookup)
static VarHandle
ConstantBootstraps.staticFieldVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> declaringClass, Class<?> fieldType)
Finds aVarHandle
for a static field.MethodHandles.Lookup.unreflectVarHandle(Field f)
Produces a VarHandle giving access to a reflected fieldf
of typeT
declared in a class of typeR
.Method parameters in java.lang.invoke with type arguments of type VarHandleModifier and TypeMethodDescriptionstatic VarHandle
ConstantBootstraps.arrayVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> arrayClass)
Finds aVarHandle
for an array type.static VarHandle
ConstantBootstraps.fieldVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> declaringClass, Class<?> fieldType)
Finds aVarHandle
for an instance field.static VarHandle
ConstantBootstraps.staticFieldVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> declaringClass, Class<?> fieldType)
Finds aVarHandle
for a static field. -
Uses of VarHandle in jdk.incubator.foreign
Methods in jdk.incubator.foreign that return VarHandleModifier and TypeMethodDescriptionstatic VarHandle
MemoryHandles.asAddressVarHandle(VarHandle target)
Adapt an existing var handle into a new var handle whose carrier type isMemoryAddress
.static VarHandle
MemoryHandles.asUnsigned(VarHandle target, Class<?> adaptedType)
Adapts a target var handle by narrowing incoming values and widening outgoing values, to and from the given type, respectively.static VarHandle
MemoryHandles.collectCoordinates(VarHandle target, int pos, MethodHandle filter)
Adapts a target var handle handle by pre-processing a sub-sequence of its coordinate values with a filter (a method handle).static VarHandle
MemoryHandles.dropCoordinates(VarHandle target, int pos, Class<?>... valueTypes)
Returns a var handle which will discard some dummy coordinates before delegating to the target var handle.static VarHandle
MemoryHandles.filterCoordinates(VarHandle target, int pos, MethodHandle... filters)
Adapts a target var handle by pre-processing incoming coordinate values using unary filter functions.static VarHandle
MemoryHandles.filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget)
Adapts a target var handle by pre-processing incoming and outgoing values using a pair of filter functions.static VarHandle
MemoryHandles.insertCoordinates(VarHandle target, int pos, Object... values)
Provides a target var handle with one or more bound coordinates in advance of the var handle's invocation.static VarHandle
MemoryHandles.permuteCoordinates(VarHandle target, List<Class<?>> newCoordinates, int... reorder)
Provides a var handle which adapts the coordinate values of the target var handle, by re-arranging them so that the new coordinates match the provided ones.static VarHandle
Creates a memory access var handle with the given carrier type, alignment constraint, and byte order.static VarHandle
Creates a memory access var handle with the given carrier type and byte order.default VarHandle
MemoryLayout.varHandle(Class<?> carrier, MemoryLayout.PathElement... elements)
Creates a memory access var handle that can be used to dereference memory at the layout selected by a given layout path, where the path is considered rooted in this layout.static VarHandle
MemoryHandles.withOffset(VarHandle target, long bytesOffset)
Returns a var handle that adds a fixed offset to the incomingMemoryAddress
coordinate and then propagates such value to the target var handle.static VarHandle
MemoryHandles.withStride(VarHandle target, long bytesStride)
Returns a var handle which adds a variable offset to the incomingMemoryAddress
access coordinate value and then propagates such value to the target var handle.Methods in jdk.incubator.foreign with parameters of type VarHandleModifier and TypeMethodDescriptionstatic VarHandle
MemoryHandles.asAddressVarHandle(VarHandle target)
Adapt an existing var handle into a new var handle whose carrier type isMemoryAddress
.static VarHandle
MemoryHandles.asUnsigned(VarHandle target, Class<?> adaptedType)
Adapts a target var handle by narrowing incoming values and widening outgoing values, to and from the given type, respectively.static VarHandle
MemoryHandles.collectCoordinates(VarHandle target, int pos, MethodHandle filter)
Adapts a target var handle handle by pre-processing a sub-sequence of its coordinate values with a filter (a method handle).static VarHandle
MemoryHandles.dropCoordinates(VarHandle target, int pos, Class<?>... valueTypes)
Returns a var handle which will discard some dummy coordinates before delegating to the target var handle.static VarHandle
MemoryHandles.filterCoordinates(VarHandle target, int pos, MethodHandle... filters)
Adapts a target var handle by pre-processing incoming coordinate values using unary filter functions.static VarHandle
MemoryHandles.filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget)
Adapts a target var handle by pre-processing incoming and outgoing values using a pair of filter functions.static VarHandle
MemoryHandles.insertCoordinates(VarHandle target, int pos, Object... values)
Provides a target var handle with one or more bound coordinates in advance of the var handle's invocation.static VarHandle
MemoryHandles.permuteCoordinates(VarHandle target, List<Class<?>> newCoordinates, int... reorder)
Provides a var handle which adapts the coordinate values of the target var handle, by re-arranging them so that the new coordinates match the provided ones.static VarHandle
MemoryHandles.withOffset(VarHandle target, long bytesOffset)
Returns a var handle that adds a fixed offset to the incomingMemoryAddress
coordinate and then propagates such value to the target var handle.static VarHandle
MemoryHandles.withStride(VarHandle target, long bytesStride)
Returns a var handle which adds a variable offset to the incomingMemoryAddress
access coordinate value and then propagates such value to the target var handle.