public class MonomorphicCallSite extends AbstractRelinkableCallSite
DynamicLinker
.Constructor and Description |
---|
MonomorphicCallSite(CallSiteDescriptor descriptor)
Creates a new call site with monomorphic inline caching strategy.
|
Modifier and Type | Method and Description |
---|---|
void |
relink(GuardedInvocation guardedInvocation,
MethodHandle relink)
This method will be called by the dynamic linker every time the call site is normally relinked.
|
void |
resetAndRelink(GuardedInvocation guardedInvocation,
MethodHandle relink)
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.
|
getDescriptor, initialize
dynamicInvoker, getTarget, setTarget, syncAll
public MonomorphicCallSite(CallSiteDescriptor descriptor)
descriptor
- the descriptor for this call sitepublic void relink(GuardedInvocation guardedInvocation, MethodHandle relink)
RelinkableCallSite
GuardedInvocation
that the call site should incorporate into its target method handle. When this method
is called, the call site is allowed to keep other non-invalidated invocations around for implementation of
polymorphic inline caches and compose them with this invocation to form its final target.guardedInvocation
- the guarded invocation that the call site should incorporate into its target method
handle.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.relink(GuardedInvocation, MethodHandle)
or
RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle)
, and finally invoke the target.public void resetAndRelink(GuardedInvocation guardedInvocation, MethodHandle relink)
RelinkableCallSite
GuardedInvocation
that the call site
should use to build its target method handle. When this method is called, the call site is discouraged from
keeping previous state around, and is supposed to only link the current invocation.guardedInvocation
- the guarded invocation that the call site should use to build its target method handle.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.relink(GuardedInvocation, MethodHandle)
or
RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle)
, and finally invoke the target.Copyright © 2018 Attila Szegedi. All rights reserved.