|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.ssa.SsaInsn
com.android.dx.ssa.PhiInsn
public final class PhiInsn
A Phi instruction (magical post-control-flow-merge) instruction in SSA form. Will be converted to moves in predecessor blocks before conversion back to ROP form.
| Nested Class Summary | |
|---|---|
static interface |
PhiInsn.Visitor
Visitor interface for instances of this (outer) class. |
| Constructor Summary | |
|---|---|
PhiInsn(int resultReg,
SsaBasicBlock block)
Makes a phi insn with a void result type. |
|
PhiInsn(RegisterSpec resultReg,
SsaBasicBlock block)
Constructs a new phi insn with no operands. |
|
| Method Summary | |
|---|---|
void |
accept(SsaInsn.Visitor v)
Accepts a visitor. |
void |
addPhiOperand(RegisterSpec registerSpec,
SsaBasicBlock predBlock)
Adds an operand to this phi instruction. |
boolean |
areAllOperandsEqual()
|
boolean |
canThrow()
Always returns false for PhiInsns. |
void |
changeResultType(TypeBearer type,
LocalItem local)
Changes the result type. |
PhiInsn |
clone()
|
Rop |
getOpcode()
Returns the Rop opcode for this insn, or null if this is a phi insn. |
Insn |
getOriginalRopInsn()
Returns the original Rop insn for this insn, or null if this is a phi insn. |
int |
getRopResultReg()
Gets the original rop-form result reg. |
RegisterSpecList |
getSources()
Gets sources. |
boolean |
hasSideEffect()
Returns true if this insn is considered to have a side effect beyond that of assigning to the result reg. |
boolean |
isPhiOrMove()
|
boolean |
isRegASource(int reg)
Indicates whether the specified register is amongst the registers used as sources for this instruction. |
void |
mapSourceRegisters(RegisterMapper mapper)
Maps only source registers. |
int |
predBlockIndexForSourcesIndex(int sourcesIndex)
Gets the index of the pred block associated with the RegisterSpec at the particular getSources() index. |
List<SsaBasicBlock> |
predBlocksForReg(int reg,
SsaMethod ssaMeth)
Returns the list of predecessor blocks associated with all operands that have reg as an operand register. |
void |
removePhiRegister(RegisterSpec registerSpec)
Removes all operand uses of a register from this phi instruction. |
String |
toHuman()
Return the "human" string form of this instance. |
protected String |
toHumanWithInline(String extra)
Returns human-readable string for listing dumps. |
Insn |
toRopInsn()
Always throws an exeption, since a phi insn may not be converted back to rop form. |
void |
updateSourcesToDefinitions(SsaMethod ssaMeth)
Updates the TypeBearers of all the sources (phi operands) to be the current TypeBearer of the register-defining instruction's result. |
| Methods inherited from class com.android.dx.ssa.SsaInsn |
|---|
changeResultReg, getBlock, getLocalAssignment, getResult, isMoveException, isNormalMoveInsn, isResultReg, makeFromRop, mapRegisters, setResult, setResultLocal |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PhiInsn(RegisterSpec resultReg,
SsaBasicBlock block)
resultReg - the result reg for this phi insnblock - block containing this insn.
public PhiInsn(int resultReg,
SsaBasicBlock block)
resultReg - the result register for this phi insn.block - block containing this insn.| Method Detail |
|---|
public PhiInsn clone()
clone in class SsaInsnpublic void updateSourcesToDefinitions(SsaMethod ssaMeth)
Note that local association of operands are preserved in this step.
ssaMeth - method that contains this insn
public void changeResultType(TypeBearer type,
LocalItem local)
type - non-null; new TypeBearerlocal - null-ok; new local info, if availablepublic int getRopResultReg()
public void addPhiOperand(RegisterSpec registerSpec,
SsaBasicBlock predBlock)
registerSpec - register spec, including type and reg of operandpredBlock - predecessor block to be associated with this operandpublic void removePhiRegister(RegisterSpec registerSpec)
registerSpec - register spec, including type and reg of operandpublic int predBlockIndexForSourcesIndex(int sourcesIndex)
sourcesIndex - index of source in getSources()
public Rop getOpcode()
PhiInsns.
getOpcode in class SsaInsnnull-ok; Rop opcode if there is one.public Insn getOriginalRopInsn()
PhiInsns.
getOriginalRopInsn in class SsaInsnnull-ok; Rop insn if there is one.public boolean canThrow()
PhiInsns.
canThrow in class SsaInsnpublic RegisterSpecList getSources()
getSources in class SsaInsnnon-null; sources listpublic boolean isRegASource(int reg)
isRegASource in class SsaInsnreg - the register in question
public boolean areAllOperandsEqual()
public final void mapSourceRegisters(RegisterMapper mapper)
mapSourceRegisters in class SsaInsnmapper - new mappingpublic Insn toRopInsn()
toRopInsn in class SsaInsn
public List<SsaBasicBlock> predBlocksForReg(int reg,
SsaMethod ssaMeth)
reg as an operand register.
reg - register to look upssaMeth - method we're operating on
public boolean isPhiOrMove()
isPhiOrMove in class SsaInsnpublic boolean hasSideEffect()
hasSideEffect in class SsaInsnpublic void accept(SsaInsn.Visitor v)
accept in class SsaInsnv - non-null the visitorpublic String toHuman()
toString().
non-null; the human string formprotected final String toHumanWithInline(String extra)
extra - null-ok; the argument to print after the opcode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||