Package com.android.dx.rop.cst
Class CstInvokeDynamic
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.CstInvokeDynamic
- All Implemented Interfaces:
ToHuman
,Comparable<Constant>
Constants of type
InvokeDynamic
. These are present in the class file.-
Method Summary
Modifier and TypeMethodDescriptionCreates aCstCallSiteRef
that refers to this instance.protected int
compareTo0
(Constant other) Compare the values of this and another instance, which are guaranteed to be of the same class.int
Gets the bootstrap method index.Gets the call site associated with this instance.Gets the declaring class of this instance.getNat()
Gets theCstNat
value.Gets thePrototype
of theinvokedynamic
call site.Gets the list of references to this instance.Gets the return type.boolean
Returnstrue
if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, orfalse
if this instance is category-1.static CstInvokeDynamic
Makes an instance for the given value.void
setCallSite
(CstCallSite callSite) Sets the call site associated with this instance.void
setDeclaringClass
(CstType declaringClass) Sets the declaring class of this instance.toHuman()
Return the "human" string form of this instance.toString()
typeName()
Returns the human name for the particular type of constant this instance is.
-
Method Details
-
make
Makes an instance for the given value. This may (but does not necessarily) return an already-allocated instance.- Parameters:
bootstrapMethodIndex
- The index of the bootstrap method in the bootstrap method tablenat
- the name and type- Returns:
non-null;
the appropriate instance
-
addReference
Creates aCstCallSiteRef
that refers to this instance.- Returns:
non-null;
a reference to this instance
-
getReferences
Gets the list of references to this instance.- Returns:
non-null;
the list of references to this instance
-
toString
-
typeName
Returns the human name for the particular type of constant this instance is. -
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
.- Returns:
non-null;
the human string form
-
isCategory2
public boolean isCategory2()Returnstrue
if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, orfalse
if this instance is category-1.- Specified by:
isCategory2
in classConstant
- Returns:
true
iff this instance is category-2
-
compareTo0
Compare the values of this and another instance, which are guaranteed to be of the same class. Subclasses must implement this.- Specified by:
compareTo0
in classConstant
- Parameters:
other
-non-null;
the instance to compare to- Returns:
-1
,0
, or1
, as usual for a comparison
-
getBootstrapMethodIndex
public int getBootstrapMethodIndex()Gets the bootstrap method index.- Returns:
- the bootstrap method index
-
getNat
Gets theCstNat
value.- Returns:
- the name and type
-
getPrototype
Gets thePrototype
of theinvokedynamic
call site.- Returns:
- the
invokedynamic
call site prototype
-
getReturnType
Gets the return type.- Returns:
non-null;
the return type
-
setDeclaringClass
Sets the declaring class of this instance. This is a set-once property.- Parameters:
declaringClass
-non-null;
the declaring class
-
getDeclaringClass
Gets the declaring class of this instance.- Returns:
- the declaring class
-
setCallSite
Sets the call site associated with this instance. This is set-once property.- Parameters:
callSite
-non-null;
the call site created for this instance
-
getCallSite
Gets the call site associated with this instance.- Returns:
- the call site associated with this instance
-