Methods Summary |
---|
public void | accept(Visitor v){@inheritDoc}
if (isNormalMoveInsn()) {
v.visitMoveInsn(this);
} else {
v.visitNonMoveInsn(this);
}
|
public boolean | canThrow(){@inheritDoc}
return insn.canThrow();
|
public final void | changeOneSource(int index, com.android.dx.rop.code.RegisterSpec newSpec)Changes one of the insn's sources. New source should be of same type
and category.
RegisterSpecList origSources = insn.getSources();
int sz = origSources.size();
RegisterSpecList newSources = new RegisterSpecList(sz);
for (int i = 0; i < sz; i++) {
newSources.set(i, i == index ? newSpec : origSources.get(i));
}
newSources.setImmutable();
RegisterSpec origSpec = origSources.get(index);
if (origSpec.getReg() != newSpec.getReg()) {
/*
* If the register remains unchanged, we're only changing
* the type or local var name so don't update use list
*/
getBlock().getParent().onSourceChanged(this, origSpec, newSpec);
}
insn = insn.withNewRegisters(getResult(), newSources);
|
public com.android.dx.ssa.NormalSsaInsn | clone(){@inheritDoc}
return (NormalSsaInsn) super.clone();
|
public com.android.dx.rop.code.RegisterSpec | getLocalAssignment(){@inheritDoc}
RegisterSpec assignment;
if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
assignment = insn.getSources().get(0);
} else {
assignment = getResult();
}
if (assignment == null) {
return null;
}
LocalItem local = assignment.getLocalItem();
if (local == null) {
return null;
}
return assignment;
|
public com.android.dx.rop.code.Rop | getOpcode()
return insn.getOpcode();
|
public com.android.dx.rop.code.Insn | getOriginalRopInsn(){@inheritDoc}
return insn;
|
public com.android.dx.rop.code.RegisterSpecList | getSources()Like rop.Insn.getSources().
return insn.getSources();
|
public boolean | hasSideEffect(){@inheritDoc}
TODO: Increase the scope of this.
Rop opcode = getOpcode();
if (opcode.getBranchingness() != Rop.BRANCH_NONE) {
return true;
}
boolean hasLocalSideEffect
= Optimizer.getPreserveLocals() && getLocalAssignment() != null;
switch (opcode.getOpcode()) {
case RegOps.MOVE_RESULT:
case RegOps.MOVE:
case RegOps.CONST:
return hasLocalSideEffect;
default:
return true;
}
|
public boolean | isMoveException(){@inheritDoc}
return insn.getOpcode().getOpcode() == RegOps.MOVE_EXCEPTION;
|
public boolean | isNormalMoveInsn()
return insn.getOpcode().getOpcode() == RegOps.MOVE;
|
public boolean | isPhiOrMove(){@inheritDoc}
return isNormalMoveInsn();
|
public final void | mapSourceRegisters(RegisterMapper mapper){@inheritDoc}
RegisterSpecList oldSources = insn.getSources();
RegisterSpecList newSources = mapper.map(oldSources);
if (newSources != oldSources) {
insn = insn.withNewRegisters(getResult(), newSources);
getBlock().getParent().onSourcesChanged(this, oldSources);
}
|
public final void | setNewSources(com.android.dx.rop.code.RegisterSpecList newSources)Changes the source list of the insn. New source list should be the
same size and consist of sources of identical types.
RegisterSpecList origSources = insn.getSources();
if (origSources.size() != newSources.size()) {
throw new RuntimeException("Sources counts don't match");
}
insn = insn.withNewRegisters(getResult(), newSources);
|
public java.lang.String | toHuman(){@inheritDoc}
return toRopInsn().toHuman();
|
public com.android.dx.rop.code.Insn | toRopInsn(){@inheritDoc}
return insn.withNewRegisters(getResult(), insn.getSources());
|
public void | upgradeToLiteral()Upgrades this insn to a version that represents the constant source
literally. If the upgrade is not possible, this does nothing.
RegisterSpecList oldSources = insn.getSources();
insn = insn.withSourceLiteral();
getBlock().getParent().onSourcesChanged(this, oldSources);
|