public final class SsaMethod
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
int |
blockIndexToRopLabel(int bi) |
int |
borrowSpareRegister(int category)
Borrows a register to use as a temp.
|
java.util.BitSet |
computeReachability()
Computes reachability for all blocks in the method.
|
void |
deleteInsns(java.util.Set<SsaInsn> deletedInsns)
Deletes all insns in the set from this method.
|
void |
forEachBlockDepthFirst(boolean reverse,
SsaBasicBlock.Visitor v)
Walks the basic block tree in depth-first order, calling the visitor
method once for every block.
|
void |
forEachBlockDepthFirstDom(SsaBasicBlock.Visitor v)
Visits blocks in dom-tree order, starting at the current node.
|
void |
forEachInsn(SsaInsn.Visitor visitor)
Visits all insns in this method.
|
void |
forEachPhiInsn(PhiInsn.Visitor v)
Visits each phi insn in this method
|
java.util.ArrayList<SsaBasicBlock> |
getBlocks() |
SsaInsn |
getDefinitionForRegister(int reg)
Returns the insn that defines the given register
|
SsaBasicBlock |
getEntryBlock() |
int |
getEntryBlockIndex() |
SsaBasicBlock |
getExitBlock() |
int |
getExitBlockIndex() |
int |
getParamWidth() |
int |
getRegCount() |
java.util.ArrayList<SsaInsn>[] |
getUseListCopy()
Returns a modifiable copy of the register use list.
|
java.util.List<SsaInsn> |
getUseListForRegister(int reg)
Returns the list of all source uses (not results) for a register.
|
static IntList |
indexListFromLabelList(BasicBlockList ropBlocks,
IntList labelList)
Builds an IntList of block indices from a basic block list and a list
of labels taken from Rop form.
|
boolean |
isRegALocal(RegisterSpec spec)
Checks to see if the given SSA reg is ever associated with a local
local variable.
|
boolean |
isStatic()
Returns
true if this is a static method. |
SsaBasicBlock |
makeNewGotoBlock()
Makes a new basic block for this method, which is empty besides
a single
GOTO. |
int |
makeNewSsaReg()
Makes a new SSA register.
|
void |
mapRegisters(RegisterMapper mapper)
Remaps unversioned registers.
|
static SsaMethod |
newFromRopMethod(RopMethod ropMethod,
int paramWidth,
boolean isStatic) |
void |
onInsnsChanged()
Indicates that the instruction list has changed or the SSA register
count has increased, so that internal datastructures that rely on
it should be rebuild.
|
void |
returnSpareRegisters()
Returns all borrowed registers.
|
void |
setBackMode()
Sets "back-convert mode".
|
public static SsaMethod newFromRopMethod(RopMethod ropMethod, int paramWidth, boolean isStatic)
ropMethod - rop-form method to convert fromparamWidth - the total width, in register-units, of the
method's parametersisStatic - true if this method has no this
pointer argumentpublic static IntList indexListFromLabelList(BasicBlockList ropBlocks, IntList labelList)
ropBlocks - Rop blockslabelList - list of rop block labelspublic SsaBasicBlock makeNewGotoBlock()
GOTO. Successors and predecessors are not yet
set.public int getEntryBlockIndex()
public SsaBasicBlock getEntryBlock()
public int getExitBlockIndex()
-1 if there is nonepublic SsaBasicBlock getExitBlock()
null-ok; block of exit block or null if
there is nonepublic int blockIndexToRopLabel(int bi)
bi - block index or -1 for nonebi was -1public int getRegCount()
public int getParamWidth()
public boolean isStatic()
true if this is a static method.true if this is a static methodpublic int borrowSpareRegister(int category)
category - width (1 or 2) of the registerpublic void returnSpareRegisters()
public java.util.ArrayList<SsaBasicBlock> getBlocks()
non-null; basic block list. Do not modify.public java.util.BitSet computeReachability()
public void mapRegisters(RegisterMapper mapper)
mapper - maps old registers to new.public SsaInsn getDefinitionForRegister(int reg)
reg - register in questionpublic void onInsnsChanged()
public java.util.List<SsaInsn> getUseListForRegister(int reg)
reg - register in questionpublic java.util.ArrayList<SsaInsn>[] getUseListCopy()
public boolean isRegALocal(RegisterSpec spec)
spec - non-null; ssa regpublic int makeNewSsaReg()
>=0; new SSA register.public void forEachInsn(SsaInsn.Visitor visitor)
visitor - non-null; callback interfacepublic void forEachPhiInsn(PhiInsn.Visitor v)
v - non-null; callback.public void forEachBlockDepthFirst(boolean reverse,
SsaBasicBlock.Visitor v)
reverse - true if this should walk backwards from the exit pointsv - non-null; callback interface. parent is set
unless this is the root nodepublic void forEachBlockDepthFirstDom(SsaBasicBlock.Visitor v)
parent parameter of the Visitor.visitBlock callback
is currently always set to null.v - non-null; callback interfacepublic void deleteInsns(java.util.Set<SsaInsn> deletedInsns)
deletedInsns - non-null; insns to deletepublic void setBackMode()
Copyright © 2020. All Rights Reserved.