public class ConstantCallSite extends CallSite
setTarget(MethodHandle)
will result in an UnsupportedOperationException.Modifier | Constructor and Description |
---|---|
|
ConstantCallSite(MethodHandle permanentTarget)
Create a ConstantCallSite with a target MethodHandle that cannot change.
|
protected |
ConstantCallSite(MethodType targetType,
MethodHandle hook)
Create a ConstantCallSite and assign the hook MethodHandle's result to its permanent target.
|
Modifier and Type | Method and Description |
---|---|
MethodHandle |
dynamicInvoker()
Return the target MethodHandle of this CallSite.
|
MethodHandle |
getTarget()
Return the target MethodHandle of this CallSite.
|
void |
setTarget(MethodHandle newTarget)
Throws UnsupportedOperationException as a ConstantCallSite is permanently
bound to its initial target MethodHandle.
|
public ConstantCallSite(MethodHandle permanentTarget)
permanentTarget
- - the target MethodHandle to permanently associate with this CallSite.protected ConstantCallSite(MethodType targetType, MethodHandle hook) throws Throwable, WrongMethodTypeException, NullPointerException, ClassCastException
The hook MethodHandle is required if the ConstantCallSite's target needs to have access to the ConstantCallSite instance. This is an action that user code cannot perform on its own.
The hook must return a MethodHandle that is exactly of type targetType.
Until the result of the hook has been installed in the ConstantCallSite, any call to getTarget() or dynamicInvoker() will throw an IllegalStateException. It is always valid to call type().
targetType
- - the type of the ConstantCallSite's targethook
- - the hook handle, with signature (ConstantCallSite)MethodHandleThrowable
- anything thrown by the hook.WrongMethodTypeException
- if the hook has the wrong signature or returns a MethodHandle with the wrong signatureNullPointerException
- if the hook is null or returns nullClassCastException
- if the result of the hook is not a MethodHandlepublic final MethodHandle dynamicInvoker() throws IllegalStateException
dynamicInvoker
in class CallSite
IllegalStateException
- - if the target has not yet been assigned in the ConstantCallSite constructorpublic final MethodHandle getTarget() throws IllegalStateException
getTarget
in class CallSite
IllegalStateException
- - if the target has not yet been assigned in the ConstantCallSite constructorpublic final void setTarget(MethodHandle newTarget)
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1993, 2025 IBM Corp. and others.