- All Known Implementing Classes:
public interface RelinkableCallSite
Interface for call sites managed by a
DynamicLinker. Users of Dynalink must use subclasses of
CallSitethat also implement this interface as their call site implementations. There is a readily usable
SimpleRelinkableCallSitesubclass that implements monomorphic inline caching strategy as well as
ChainedCallSitethat implements a polymorphic inline caching strategy and retains a chain of previously linked method handles. A relinkable call site will be managed by a
DynamicLinkerobject after being associated with it using its
Modifier and Type Method Description
()Returns the descriptor for this call site.
MethodHandle relinkAndInvoke)(Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle.
GuardedInvocation guardedInvocation, MethodHandle relinkAndInvoke)(This method will be called by the dynamic linker every time the call site is relinked (but see
resetAndRelink(GuardedInvocation, MethodHandle)for an exception).
GuardedInvocation guardedInvocation, MethodHandle relinkAndInvoke)(This method will be called by the dynamic linker every time the call site is relinked and the linker wishes the call site to throw away any prior linkage state (that is how it differs from
initializevoid 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.
relinkAndInvoke- a relink-and-invoke method handle supplied by Dynalink.
getDescriptorCallSiteDescriptor getDescriptor()Returns the descriptor for this call site.
- the descriptor for this call site.