public class ChainedCallSite extends AbstractRelinkableCallSite
MethodHandles.guardWithTest(MethodHandle, MethodHandle, MethodHandle). When this call site has to link a new
method handle and the length of the chain is already at the maximum, it will throw away the oldest method handle.
Switchpoint-invalidated handles in the chain are removed eagerly (on each linking request, and whenever a
switchpoint-invalidated method handle is traversed during invocation). There is currently no profiling
attached to the handles in the chain, so they are never reordered based on usage; the most recently linked method
handle is always at the start of the chain.| Constructor and Description |
|---|
ChainedCallSite(CallSiteDescriptor descriptor)
Creates a new chained call site.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
getMaxChainLength()
The maximum number of method handles in the chain.
|
void |
setGuardedInvocation(GuardedInvocation invocation,
MethodHandle relink)
This method will be called once by the dynamic linker every time the call site is relinked.
|
getDescriptor, setRelinkAndInvokedynamicInvoker, getTarget, setTarget, syncAllpublic ChainedCallSite(CallSiteDescriptor descriptor)
descriptor - the descriptor for the call site.protected int getMaxChainLength()
public void setGuardedInvocation(GuardedInvocation invocation, MethodHandle relink)
RelinkableCallSiteinvocation - the guarded invocation that the call site should set as its current target. Note that
the call sites are allowed to keep other non-invalidated invocations around for implementation of polymorphic
inline caches.relink - the fallback method. This is a method matching the method type of the call site that is supplied
by the DynamicLinker to be used by this call site as a 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 discover the adequate target
for the invocation, subsequently invoke RelinkableCallSite.setGuardedInvocation(GuardedInvocation, MethodHandle), and
finally invoke the target.Copyright © 2012 Attila Szegedi. All Rights Reserved.