PlainInsnpublic final class PlainInsn extends Insn Plain instruction, which has no embedded data and which cannot possibly
throw an exception. |
Constructors Summary |
---|
public PlainInsn(Rop opcode, SourcePosition position, RegisterSpec result, RegisterSpecList sources)Constructs an instance.
super(opcode, position, result, sources);
switch (opcode.getBranchingness()) {
case Rop.BRANCH_SWITCH:
case Rop.BRANCH_THROW: {
throw new IllegalArgumentException("bogus branchingness");
}
}
if (result != null && opcode.getBranchingness() != Rop.BRANCH_NONE) {
// move-result-pseudo is required here
throw new IllegalArgumentException
("can't mix branchingness with result");
}
| public PlainInsn(Rop opcode, SourcePosition position, RegisterSpec result, RegisterSpec source)Constructs a single-source instance.
this(opcode, position, result, RegisterSpecList.make(source));
|
Methods Summary |
---|
public void | accept(Visitor visitor){@inheritDoc}
visitor.visitPlainInsn(this);
| public com.android.dx.rop.type.TypeList | getCatches(){@inheritDoc}
return StdTypeList.EMPTY;
| public Insn | withAddedCatch(com.android.dx.rop.type.Type type){@inheritDoc}
throw new UnsupportedOperationException("unsupported");
| public Insn | withLastSourceLiteral(){@inheritDoc}
RegisterSpecList sources = getSources();
int szSources = sources.size();
if (szSources == 0) {
return this;
}
TypeBearer lastType = sources.get(szSources - 1).getTypeBearer();
if (!lastType.isConstant()) {
return this;
}
Constant cst = (Constant) lastType;
RegisterSpecList newSources = sources.withoutLast();
Rop newRop;
try {
newRop = Rops.ropFor(getOpcode().getOpcode(),
getResult(), newSources, (Constant)lastType);
} catch (IllegalArgumentException ex) {
// There's no rop for this case
return this;
}
return new PlainCstInsn(newRop, getPosition(),
getResult(), newSources, cst);
| public Insn | withNewRegisters(RegisterSpec result, RegisterSpecList sources){@inheritDoc}
return new PlainInsn(getOpcode(), getPosition(),
result,
sources);
| public Insn | withRegisterOffset(int delta){@inheritDoc}
return new PlainInsn(getOpcode(), getPosition(),
getResult().withOffset(delta),
getSources().withOffset(delta));
|
|