public interface CallSiteDescriptor
CallSiteDescriptorFactory for descriptors that you can use, or you can create your own
descriptor classes, especially if you need to add further information (values passed in additional parameters to the
bootstrap method) to them. Call site descriptors are used in this library in place of passing a real call site to
guarding linkers so they aren't tempted to directly manipulate the call sites. The constructors of built-in
RelinkableCallSite implementations all need a call site descriptor. Even if you create your own call site
descriptors consider using CallSiteDescriptorFactory.tokenizeName(String) in your implementation.| Modifier and Type | Field and Description |
|---|---|
static int |
NAME_OPERAND
The index of the name token that will usually carry a name of an operand (of a property, method, etc.)
|
static int |
OPERATOR
The index of the name token that will usually carry the operation name.
|
static String |
OPERATOR_DELIMITER
Character used to delimit operation names in a composite operation specification.
|
static int |
SCHEME
The index of the name token that will carry the operation scheme prefix (usually, "dyn").
|
static String |
TOKEN_DELIMITER
Character used to delimit tokens in an call site name.
|
| Modifier and Type | Method and Description |
|---|---|
CallSiteDescriptor |
changeParameterType(int num,
Class<?> newType)
Creates a new call site descriptor from this descriptor, which is identical to this, except it changes the type
of one of the parameters in the method type.
|
CallSiteDescriptor |
changeReturnType(Class<?> newType)
Creates a new call site descriptor from this descriptor, which is identical to this, except it changes the return
type in the method type.
|
CallSiteDescriptor |
dropParameterTypes(int from,
int to)
Creates a new call site descriptor from this descriptor, which is identical to this, except it drops few of the
parameters from the method type.
|
MethodHandles.Lookup |
getLookup()
Returns the lookup passed to the bootstrap method.
|
MethodType |
getMethodType()
The type of the method at the call site.
|
String |
getName()
Returns the name of the method at the call site.
|
String |
getNameToken(int i)
Returns the ith token in the method name at the call site.
|
int |
getNameTokenCount()
Returns the number of tokens in the name of the method at the call site.
|
static final int SCHEME
static final int OPERATOR
static final int NAME_OPERAND
static final String TOKEN_DELIMITER
static final String OPERATOR_DELIMITER
int getNameTokenCount()
String getNameToken(int i)
i - the index of the token. Must be between 0 (inclusive) and getNameTokenCount() (exclusive)IllegalArgumentException - if the index is outside the allowed range.String getName()
MethodType getMethodType()
MethodHandles.Lookup getLookup()
CallSiteDescriptor dropParameterTypes(int from, int to)
from - the index of the first parameter to dropto - the index of the first parameter after "from" not to dropCallSiteDescriptor changeParameterType(int num, Class<?> newType)
num - the index of the parameter type to changenewType - the new type for the parameterCallSiteDescriptor changeReturnType(Class<?> newType)
newType - the new return typeCopyright © 2012 Attila Szegedi. All Rights Reserved.