Package com.android.dx.rop.code
Class LocalVariableInfo
java.lang.Object
com.android.dx.util.MutabilityControl
com.android.dx.rop.code.LocalVariableInfo
Container for local variable information for a particular
RopMethod
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssignment
(Insn insn, RegisterSpec spec) Adds an assignment association for the given instruction and register spec.void
getAssignment
(Insn insn) Gets the named register being assigned by the given instruction, if previously stored in this instance.int
Gets the number of assignments recorded by this instance.getStarts
(int label) Gets the register set associated with the start of the block with the given label.getStarts
(BasicBlock block) Gets the register set associated with the start of the given block.boolean
mergeStarts
(int label, RegisterSpecSet specs) Merges the given register set into the set for the block with the given label.mutableCopyOfStarts
(int label) Gets a mutable copy of the register set associated with the start of the block with the given label.void
setStarts
(int label, RegisterSpecSet specs) Sets the register set associated with the start of the block with the given label.Methods inherited from class com.android.dx.util.MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
-
Constructor Details
-
LocalVariableInfo
Constructs an instance.- Parameters:
method
-non-null;
the method being represented by this instance
-
-
Method Details
-
setStarts
Sets the register set associated with the start of the block with the given label.- Parameters:
label
->= 0;
the block labelspecs
-non-null;
the register set to associate with the block
-
mergeStarts
Merges the given register set into the set for the block with the given label. If there was not already an associated set, then this is the same as callingsetStarts(int, com.android.dx.rop.code.RegisterSpecSet)
. Otherwise, this will merge the two sets and callsetStarts(int, com.android.dx.rop.code.RegisterSpecSet)
on the result of the merge.- Parameters:
label
->= 0;
the block labelspecs
-non-null;
the register set to merge into the start set for the block- Returns:
true
if the merge resulted in an actual change to the associated set (including storing one for the first time) orfalse
if there was no change
-
getStarts
Gets the register set associated with the start of the block with the given label. This returns an empty set with the appropriate max size if no set was associated with the block in question.- Parameters:
label
->= 0;
the block label- Returns:
non-null;
the associated register set
-
getStarts
Gets the register set associated with the start of the given block. This is just convenient shorthand forgetStarts(block.getLabel())
.- Parameters:
block
-non-null;
the block in question- Returns:
non-null;
the associated register set
-
mutableCopyOfStarts
Gets a mutable copy of the register set associated with the start of the block with the given label. This returns a newly-allocated emptyRegisterSpecSet
of appropriate max size if there is not yet any set associated with the block.- Parameters:
label
->= 0;
the block label- Returns:
non-null;
the associated register set
-
addAssignment
Adds an assignment association for the given instruction and register spec. This throws an exception if the instruction doesn't actually perform a named variable assignment. Note: Although the instruction contains its own spec for the result, it still needs to be passed in explicitly to this method, since the spec that is stored here should always have a simple type and the one in the instruction can be an arbitraryTypeBearer
(such as a constant value).- Parameters:
insn
-non-null;
the instruction in questionspec
-non-null;
the associated register spec
-
getAssignment
Gets the named register being assigned by the given instruction, if previously stored in this instance.- Parameters:
insn
-non-null;
instruction in question- Returns:
null-ok;
the named register being assigned, if any
-
getAssignmentCount
public int getAssignmentCount()Gets the number of assignments recorded by this instance.- Returns:
>= 0;
the number of assignments
-
debugDump
public void debugDump()
-