APIdia Launch Partner
Top Description Methods
jdk.dynalink

public Interface RelinkableCallSite

Known Direct Implementers
jdk.dynalink.support.AbstractRelinkableCallSite
Imports
java.lang.invoke.CallSite, .MethodHandle, jdk.dynalink.linker.GuardedInvocation, jdk.dynalink.support.ChainedCallSite, .SimpleRelinkableCallSite

Interface for call sites managed by a DynamicLinker. Users of Dynalink must use subclasses of CallSite that also implement this interface as their call site implementations. There is a readily usable SimpleRelinkableCallSite subclass that implements monomorphic inline caching strategy as well as ChainedCallSite that implements a polymorphic inline caching strategy and retains a chain of previously linked method handles. A relinkable call site will be managed by a DynamicLinker object after being associated with it using its DynamicLinker#link(RelinkableCallSite) method.
Since
9

Method Summary

Modifier and TypeMethod and Description
public CallSiteDescriptor

Returns:

the descriptor for this call site.
getDescriptor
()

Returns the descriptor for this call site.

public void
initialize(MethodHandle
a relink-and-invoke method handle supplied by Dynalink.
relinkAndInvoke
)

Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle.

Method Detail

getDescriptorback to summary
public CallSiteDescriptor getDescriptor()

Returns the descriptor for this call site.

Returns:CallSiteDescriptor

the descriptor for this call site.

initializeback to summary
public void initialize(MethodHandle relinkAndInvoke)

Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle. The call site implementation is supposed to set this method handle as its target using CallSite#setTarget(MethodHandle). Relink-and-invoke is the initial method handle set by DynamicLinker#link(RelinkableCallSite) that will cause the call site to be relinked to an appropriate target on its first invocation based on its arguments, and that linked target will then be invoked (hence the name). This linking protocol effectively delays linking until the call site is invoked with actual arguments and thus ensures that linkers can make nuanced linking decisions based on those arguments and not just on the static method type of the call site.

Parameters
relinkAndInvoke:MethodHandle

a relink-and-invoke method handle supplied by Dynalink.