public class DynamicCallSiteDesc extends Object
invokedynamic
call site.
Concrete subtypes of DynamicCallSiteDesc must be value-based.
Modifier and Type | Method | Description |
---|---|---|
ConstantDesc[] |
bootstrapArgs() |
Returns
ConstantDesc s describing the bootstrap arguments for the
invokedynamic . |
MethodHandleDesc |
bootstrapMethod() |
Returns a
MethodHandleDesc descripbing the bootstrap method for
the invokedynamic . |
boolean |
equals(Object o) |
Compares the specified object with this descriptor for equality.
|
int |
hashCode() |
Returns a hash code value for the object.
|
String |
invocationName() |
Returns the invocation name that would appear in the
NameAndType
operand of the invokedynamic . |
MethodTypeDesc |
invocationType() |
Returns a
MethodTypeDesc describing the invocation type that
would appear in the NameAndType operand of the invokedynamic . |
static DynamicCallSiteDesc |
of(DirectMethodHandleDesc bootstrapMethod,
MethodTypeDesc invocationType) |
Create a nominal descriptor for an
invokedynamic call site whose
bootstrap method has no static arguments and for which the name parameter
is ConstantDescs.DEFAULT_NAME . |
static DynamicCallSiteDesc |
of(DirectMethodHandleDesc bootstrapMethod,
String invocationName,
MethodTypeDesc invocationType) |
Create a nominal descriptor for an
invokedynamic call site whose
bootstrap method has no static arguments. |
static DynamicCallSiteDesc |
of(DirectMethodHandleDesc bootstrapMethod,
String invocationName,
MethodTypeDesc invocationType,
ConstantDesc... bootstrapArgs) |
Create a nominal descriptor for an
invokedynamic call site. |
CallSite |
resolveCallSiteDesc(MethodHandles.Lookup lookup) |
Reflectively invokes the bootstrap method with the specified arguments,
and return the resulting
CallSite |
String |
toString() |
Returns a string representation of the object.
|
DynamicCallSiteDesc |
withArgs(ConstantDesc... bootstrapArgs) |
Return a nominal descriptor for an
invokedynamic call site whose
bootstrap method, name, and invocation type are the same as this one, but
with the specified bootstrap arguments. |
DynamicCallSiteDesc |
withNameAndType(String invocationName,
MethodTypeDesc invocationType) |
Return a nominal descriptor for an
invokedynamic call site whose
bootstrap and bootstrap arguments are the same as this one, but with the
specified invocationName and invocation invocationType |
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs)
invokedynamic
call site.bootstrapMethod
- a DirectMethodHandleDescImpl
describing the
bootstrap method for the invokedynamic
invocationName
- The unqualified name that would appear in the NameAndType
operand of the invokedynamic
invocationType
- a MethodTypeDesc
describing the invocation
type that would appear in the NameAndType
operand of the invokedynamic
bootstrapArgs
- ConstantDesc
s describing the static arguments
to the bootstrap, that would appear in the
BootstrapMethods
attributeNullPointerException
- if any parameter is nullIllegalArgumentException
- if the invocation name has the incorrect
formatpublic static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType)
invokedynamic
call site whose
bootstrap method has no static arguments.bootstrapMethod
- The bootstrap method for the invokedynamic
invocationName
- The invocationName that would appear in the
NameAndType
operand of the invokedynamic
invocationType
- The invocation invocationType that would appear
in the NameAndType
operand of the invokedynamic
NullPointerException
- if any parameter is nullpublic static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, MethodTypeDesc invocationType)
invokedynamic
call site whose
bootstrap method has no static arguments and for which the name parameter
is ConstantDescs.DEFAULT_NAME
.bootstrapMethod
- a DirectMethodHandleDescImpl
describing the
bootstrap method for the invokedynamic
invocationType
- a MethodTypeDesc
describing the invocation
type that would appear in the NameAndType
operand of the invokedynamic
NullPointerException
- if any parameter is nullIllegalArgumentException
- if the invocation name has the incorrect
formatpublic DynamicCallSiteDesc withArgs(ConstantDesc... bootstrapArgs)
invokedynamic
call site whose
bootstrap method, name, and invocation type are the same as this one, but
with the specified bootstrap arguments.bootstrapArgs
- ConstantDesc
s describing the static arguments
to the bootstrap, that would appear in the
BootstrapMethods
attributeNullPointerException
- if any parameter is nullpublic DynamicCallSiteDesc withNameAndType(String invocationName, MethodTypeDesc invocationType)
invokedynamic
call site whose
bootstrap and bootstrap arguments are the same as this one, but with the
specified invocationName and invocation invocationTypeinvocationName
- The unqualified name that would appear in the NameAndType
operand of the invokedynamic
invocationType
- a MethodTypeDesc
describing the invocation
type that would appear in the NameAndType
operand of the invokedynamic
NullPointerException
- if any parameter is nullIllegalArgumentException
- if the invocation name has the incorrect
formatpublic String invocationName()
NameAndType
operand of the invokedynamic
.public MethodTypeDesc invocationType()
MethodTypeDesc
describing the invocation type that
would appear in the NameAndType
operand of the invokedynamic
.public MethodHandleDesc bootstrapMethod()
MethodHandleDesc
descripbing the bootstrap method for
the invokedynamic
.invokedynamic
public ConstantDesc[] bootstrapArgs()
ConstantDesc
s describing the bootstrap arguments for the
invokedynamic
.invokedynamic
public CallSite resolveCallSiteDesc(MethodHandles.Lookup lookup) throws Throwable
CallSite
lookup
- The MethodHandles.Lookup
used to resolve class namesCallSite
Throwable
- if any exception is thrown by the bootstrap methodpublic boolean equals(Object o)
true
if and only if the specified object is also a
DynamicCallSiteDesc, and both descriptors have equal
bootstrap methods, bootstrap argument lists, invocation name, and
invocation type.equals
in class Object
o
- the DynamicCallSiteDesc
to compare to this
DynamicCallSiteDesc
true
if the specified DynamicCallSiteDesc
is
equals to this DynamicCallSiteDesc
.Object.hashCode()
,
HashMap
public int hashCode()
Object
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined
by class Object
does return distinct integers for
distinct objects. (The hashCode may or may not be implemented
as some function of an object's memory address at some point
in time.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())