RelinkableCallSite
public class SimpleRelinkableCallSite extends AbstractRelinkableCallSite
GuardedInvocation
at any given time. If the guard of that single invocation fails, or it has an invalidated switch point, or its invalidating exception triggered, then the call site will throw it away and ask its associated DynamicLinker
to relink it.Constructor | Description |
---|---|
SimpleRelinkableCallSite |
Creates a new call site with monomorphic inline caching strategy. |
Modifier and Type | Method | Description |
---|---|---|
void |
relink |
This method will be called by the dynamic linker every time the call site is relinked (but see RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle) for an exception). |
void |
resetAndRelink |
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 RelinkableCallSite.relink(GuardedInvocation, MethodHandle) ). |
getDescriptor, initialize
dynamicInvoker, getTarget, setTarget, syncAll
public SimpleRelinkableCallSite(CallSiteDescriptor descriptor)
descriptor
- the descriptor for this call sitepublic void relink(GuardedInvocation guardedInvocation, MethodHandle relinkAndInvoke)
RelinkableCallSite
RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle)
for an exception). It will be passed a 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.relinkAndInvoke
- a relink-and-invoke method handle. This is a method handle matching the method type of the call site that is supplied by the 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 RelinkableCallSite.relink(GuardedInvocation, MethodHandle)
or RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle)
, and finally invoke the target.public void resetAndRelink(GuardedInvocation guardedInvocation, MethodHandle relinkAndInvoke)
RelinkableCallSite
RelinkableCallSite.relink(GuardedInvocation, MethodHandle)
). It will be passed a GuardedInvocation
that the call site should use to build its new target method handle. When this method is called, the call site is discouraged from keeping any previous state, 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.relinkAndInvoke
- a relink-and-invoke method handle. This is a method handle matching the method type of the call site that is supplied by the 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 RelinkableCallSite.relink(GuardedInvocation, MethodHandle)
or RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle)
, and finally invoke the target.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.dynalink/jdk/dynalink/support/SimpleRelinkableCallSite.html