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.
| Modifier and Type | Method and Description |
|---|---|
| public CallSiteDescriptor | Returns: the descriptor for this call site.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. |
| public void | relink(GuardedInvocation
the guarded invocation that the call site should
incorporate into its target method handle. guardedInvocation, MethodHandle a relink-and-invoke method handle. This is a
method handle matching the method type of the call site that is supplied
by the relinkAndInvoke)DynamicLinker as a callback. It should be used by this
call site as the ultimate fallback when it can't invoke its target with
the passed arguments. The fallback method is such that when it's invoked,
it'll try to obtain an adequate target GuardedInvocation for the
invocation, and subsequently invoke
relink(GuardedInvocation, MethodHandle) or
resetAndRelink(GuardedInvocation, MethodHandle), and finally
invoke the target.This method will be called by the dynamic linker every time the call site
is relinked (but see
|
| public void | resetAndRelink(GuardedInvocation
the guarded invocation that the call site should
use to build its target method handle. guardedInvocation, MethodHandle a relink-and-invoke method handle. This is a
method handle matching the method type of the call site that is supplied
by the relinkAndInvoke)DynamicLinker as a callback. It should be used by this
call site as the ultimate fallback when it can't invoke its target with
the passed arguments. The fallback method is such that when it's invoked,
it'll try to obtain an adequate target GuardedInvocation for the
invocation, and subsequently invoke
relink(GuardedInvocation, MethodHandle) or
resetAndRelink(GuardedInvocation, MethodHandle), and finally
invoke the target.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
|
| getDescriptor | back to summary |
|---|---|
| public CallSiteDescriptor getDescriptor() Returns the descriptor for this call site.
| |
| initialize | back 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
| |
| relink | back to summary |
|---|---|
| public void relink(GuardedInvocation guardedInvocation, MethodHandle relinkAndInvoke) This method will be called by the dynamic linker every time the call site
is relinked (but see
| |
| resetAndRelink | back to summary |
|---|---|
| public void resetAndRelink(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
| |