use of jadx.core.dex.instructions.args.InsnArg in project jadx by skylot.
the class LiveVarAnalysis method fillBasicBlockInfo.
private void fillBasicBlockInfo() {
for (BlockNode block : mth.getBasicBlocks()) {
int blockId = block.getId();
BitSet gen = uses[blockId];
BitSet kill = defs[blockId];
for (InsnNode insn : block.getInstructions()) {
for (InsnArg arg : insn.getArguments()) {
if (arg.isRegister()) {
int regNum = ((RegisterArg) arg).getRegNum();
if (!kill.get(regNum)) {
gen.set(regNum);
}
}
}
RegisterArg result = insn.getResult();
if (result != null) {
int regNum = result.getRegNum();
kill.set(regNum);
assignBlocks[regNum].set(blockId);
}
}
}
}
use of jadx.core.dex.instructions.args.InsnArg in project jadx by skylot.
the class SSATransform method removePhiList.
private static boolean removePhiList(MethodNode mth, List<PhiInsn> insnToRemove) {
for (BlockNode block : mth.getBasicBlocks()) {
PhiListAttr phiList = block.get(AType.PHI_LIST);
if (phiList == null) {
continue;
}
List<PhiInsn> list = phiList.getList();
for (PhiInsn phiInsn : insnToRemove) {
if (list.remove(phiInsn)) {
for (InsnArg arg : phiInsn.getArguments()) {
if (arg == null) {
continue;
}
SSAVar sVar = ((RegisterArg) arg).getSVar();
if (sVar != null) {
sVar.setUsedInPhi(null);
}
}
InstructionRemover.remove(mth, block, phiInsn);
}
}
if (list.isEmpty()) {
block.remove(AType.PHI_LIST);
}
}
insnToRemove.clear();
return true;
}
Aggregations