use of com.android.dx.ssa.SsaInsn in project J2ME-Loader by nikita36078.
the class LivenessAnalyzer method coInterferePhis.
/**
* Ensures that all the phi result registers for all the phis in the
* same basic block interfere with each other. This is needed since
* the dead code remover has allowed through "dead-end phis" whose
* results are not used except as local assignments. Without this step,
* a the result of a dead-end phi might be assigned the same register
* as the result of another phi, and the phi removal move scheduler may
* generate moves that over-write the live result.
*
* @param ssaMeth {@code non-null;} method to pricess
* @param interference {@code non-null;} interference graph
*/
private static void coInterferePhis(SsaMethod ssaMeth, InterferenceGraph interference) {
for (SsaBasicBlock b : ssaMeth.getBlocks()) {
List<SsaInsn> phis = b.getPhiInsns();
int szPhis = phis.size();
for (int i = 0; i < szPhis; i++) {
for (int j = 0; j < szPhis; j++) {
if (i == j) {
continue;
}
interference.add(phis.get(i).getResult().getReg(), phis.get(j).getResult().getReg());
}
}
}
}
use of com.android.dx.ssa.SsaInsn in project J2ME-Loader by nikita36078.
the class SsaToRop method verifyValidExitPredecessor.
/**
* Validates that a basic block is a valid end predecessor. It must
* end in a RETURN or a THROW. Throws a runtime exception on error.
*
* @param b {@code non-null;} block to validate
* @throws RuntimeException on error
*/
private void verifyValidExitPredecessor(SsaBasicBlock b) {
ArrayList<SsaInsn> insns = b.getInsns();
SsaInsn lastInsn = insns.get(insns.size() - 1);
Rop opcode = lastInsn.getOpcode();
if (opcode.getBranchingness() != Rop.BRANCH_RETURN && opcode != Rops.THROW) {
throw new RuntimeException("Exit predecessor must end" + " in valid exit statement.");
}
}
Aggregations