示例#1
0
 @Override
 public void visit(BinaryBranchingInstruction insn) {
   int a = insn.getFirstOperand().getIndex();
   int b = insn.getSecondOperand().getIndex();
   BasicBlock consequent = insn.getConsequent();
   BasicBlock alternative = insn.getAlternative();
   switch (insn.getCondition()) {
     case EQUAL:
       branch(
           withLocation(Expr.binary(BinaryOperation.EQUALS, Expr.var(a), Expr.var(b))),
           consequent,
           alternative);
       break;
     case REFERENCE_EQUAL:
       branch(
           withLocation(Expr.binary(BinaryOperation.STRICT_EQUALS, Expr.var(a), Expr.var(b))),
           consequent,
           alternative);
       break;
     case NOT_EQUAL:
       branch(
           withLocation(Expr.binary(BinaryOperation.NOT_EQUALS, Expr.var(a), Expr.var(b))),
           consequent,
           alternative);
       break;
     case REFERENCE_NOT_EQUAL:
       branch(
           withLocation(Expr.binary(BinaryOperation.STRICT_NOT_EQUALS, Expr.var(a), Expr.var(b))),
           consequent,
           alternative);
       break;
   }
 }