Spec-Zone.ru › OpenJDK 27

Class AbstractRelinkableCallSite

java.lang.Object
java.lang.invoke.CallSite
java.lang.invoke.MutableCallSite
jdk.dynalink.support.AbstractRelinkableCallSite
All Implemented Interfaces:
RelinkableCallSite
Direct Known Subclasses:
ChainedCallSite, SimpleRelinkableCallSite
public abstract class AbstractRelinkableCallSite extends MutableCallSite implements RelinkableCallSite
A basic implementation of the RelinkableCallSite as a MutableCallSite. It carries a CallSiteDescriptor passed in the constructor and provides the correct implementation of the initialize(MethodHandle) method. Subclasses must provide RelinkableCallSite.relink(GuardedInvocation, MethodHandle) and RelinkableCallSite.resetAndRelink(GuardedInvocation, MethodHandle) methods.
Since:
9

Constructor Summary

AbstractRelinkableCallSite(CallSiteDescriptor descriptor)
Modifier Constructor Description
protected
Creates a new abstract relinkable call site.

Method Summary

Modifier and Type Method Description
CallSiteDescriptor getDescriptor()
Returns the descriptor for this call site.
void initialize(MethodHandle relinkAndInvoke)
Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle.

Methods declared in class MutableCallSite

dynamicInvoker, getTarget, setTarget, syncAll
Modifier and Type Method Description
final MethodHandle dynamicInvoker()
Produces a method handle equivalent to an invokedynamic instruction which has been linked to this call site.
final MethodHandle getTarget()
Returns the target method of the call site, which behaves like a normal field of the MutableCallSite.
void setTarget(MethodHandle newTarget)
Updates the target method of this call site, as a normal variable.
static void syncAll(MutableCallSite[] sites)
Performs a synchronization operation on each call site in the given array, forcing all other threads to throw away any cached values previously loaded from the target of any of the call sites.

Methods declared in class CallSite

type
Modifier and Type Method Description
MethodType type()
Returns the type of this call site's target.

Methods declared in class Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Modifier and Type Method Description
protected Object clone()
Creates and returns a copy of this object.
boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
protected void finalize()
Deprecated, for removal: This API element is subject to removal in a future version.
Finalization is deprecated and subject to removal in a future release.
final Class<?> getClass()
Returns the runtime class of this Object.
int hashCode()
Returns a hash code value for this object.
final void notify()
Wakes up a single thread that is waiting on this object's monitor.
final void notifyAll()
Wakes up all threads that are waiting on this object's monitor.
String toString()
Returns a string representation of the object.
final void wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
final void wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final void wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

Methods declared in interface RelinkableCallSite

relink, resetAndRelink
Modifier and Type Method Description
void relink(GuardedInvocation guardedInvocation, MethodHandle relinkAndInvoke)
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(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 RelinkableCallSite.relink(GuardedInvocation, MethodHandle)).

Constructor Details

AbstractRelinkableCallSite

protected AbstractRelinkableCallSite(CallSiteDescriptor descriptor)
Creates a new abstract relinkable call site.
Parameters:
descriptor - the descriptor for this call site that will be returned from getDescriptor(). The call site's CallSite.type() will be equal to descriptor's CallSiteDescriptor.getMethodType().
Throws:
NullPointerException - if descriptor is null.

Method Details

getDescriptor

public CallSiteDescriptor getDescriptor()
Description copied from interface: RelinkableCallSite
Returns the descriptor for this call site.
Specified by:
getDescriptor in interface RelinkableCallSite
Returns:
the descriptor for this call site.

initialize

public void initialize(MethodHandle relinkAndInvoke)
Description copied from interface: RelinkableCallSite
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.
Specified by:
initialize in interface RelinkableCallSite
Parameters:
relinkAndInvoke - a relink-and-invoke method handle supplied by Dynalink.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

© 1993, 2025, 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.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API