use of com.android.dx.dex.code.SimpleInsn in project J2ME-Loader by nikita36078.
the class Form12x method isCompatible.
/**
* {@inheritDoc}
*/
@Override
public boolean isCompatible(DalvInsn insn) {
if (!(insn instanceof SimpleInsn)) {
return false;
}
RegisterSpecList regs = insn.getRegisters();
RegisterSpec rs1;
RegisterSpec rs2;
switch(regs.size()) {
case 2:
{
rs1 = regs.get(0);
rs2 = regs.get(1);
break;
}
case 3:
{
/*
* This format is allowed for ops that are effectively
* 3-arg but where the first two args are identical.
*/
rs1 = regs.get(1);
rs2 = regs.get(2);
if (rs1.getReg() != regs.get(0).getReg()) {
return false;
}
break;
}
default:
{
return false;
}
}
return unsignedFitsInNibble(rs1.getReg()) && unsignedFitsInNibble(rs2.getReg());
}
use of com.android.dx.dex.code.SimpleInsn in project buck by facebook.
the class Form12x method isCompatible.
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
if (!(insn instanceof SimpleInsn)) {
return false;
}
RegisterSpecList regs = insn.getRegisters();
RegisterSpec rs1;
RegisterSpec rs2;
switch(regs.size()) {
case 2:
{
rs1 = regs.get(0);
rs2 = regs.get(1);
break;
}
case 3:
{
/*
* This format is allowed for ops that are effectively
* 3-arg but where the first two args are identical.
*/
rs1 = regs.get(1);
rs2 = regs.get(2);
if (rs1.getReg() != regs.get(0).getReg()) {
return false;
}
break;
}
default:
{
return false;
}
}
return unsignedFitsInNibble(rs1.getReg()) && unsignedFitsInNibble(rs2.getReg());
}
Aggregations