當前位置: 首頁>>代碼示例>>Java>>正文


Java Opcodes.IFLT屬性代碼示例

本文整理匯總了Java中org.objectweb.asm.Opcodes.IFLT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Opcodes.IFLT屬性的具體用法?Java Opcodes.IFLT怎麽用?Java Opcodes.IFLT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.IFLT屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ifType

private static If.Type ifType(int opcode) {
  switch (opcode) {
    case Opcodes.IFEQ:
    case Opcodes.IF_ICMPEQ:
    case Opcodes.IF_ACMPEQ:
      return If.Type.EQ;
    case Opcodes.IFNE:
    case Opcodes.IF_ICMPNE:
    case Opcodes.IF_ACMPNE:
      return If.Type.NE;
    case Opcodes.IFLT:
    case Opcodes.IF_ICMPLT:
      return If.Type.LT;
    case Opcodes.IFGE:
    case Opcodes.IF_ICMPGE:
      return If.Type.GE;
    case Opcodes.IFGT:
    case Opcodes.IF_ICMPGT:
      return If.Type.GT;
    case Opcodes.IFLE:
    case Opcodes.IF_ICMPLE:
      return If.Type.LE;
    default:
      throw new Unreachable("Unexpected If instruction opcode: " + opcode);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:26,代碼來源:JarSourceCode.java

示例2: getForSingleValueJump

/**
 * This are values compared against 0, like {@code value < 0}
 *
 * @return
 */
public static Truthness getForSingleValueJump(int value, int opcode) {

    switch (opcode) {
        case Opcodes.IFEQ: // ie, val == 0
            return getForValueComparison(value, 0, Opcodes.IF_ICMPEQ);

        case Opcodes.IFNE: // ie val != 0  ->  ! (val == 0)
            return getForSingleValueJump(value, Opcodes.IFEQ).invert();

        case Opcodes.IFLT: // ie, val < 0
            return getForValueComparison(value, 0, Opcodes.IF_ICMPLT);

        case Opcodes.IFGE: // ie, val >= 0  -> ! (val < 0)
            return getForSingleValueJump(value, Opcodes.IFLT).invert();

        case Opcodes.IFLE: // ie, val <= 0  ->  0 >= val  -> ! (0 < val)
            return getForValueComparison(0, value, Opcodes.IF_ICMPLT).invert();

        case Opcodes.IFGT: // ie, val > 0  ->  0 < val
            return getForValueComparison(0, value, Opcodes.IF_ICMPLT);

        default:
            throw new IllegalArgumentException("Cannot handle opcode " + opcode);
    }
}
 
開發者ID:EMResearch,項目名稱:EvoMaster,代碼行數:30,代碼來源:HeuristicsForJumps.java

示例3: test_IFLT_pos

@Test
public void test_IFLT_pos(){
    //val < 0
    int code = Opcodes.IFLT;

    Truthness t3 = getForSingleValueJump(3, code);
    assertFalse(t3.isTrue());
    assertTrue(t3.isFalse());

    Truthness t5 = getForSingleValueJump(5, code);
    assertFalse(t5.isTrue());
    assertTrue(t5.isFalse());

    Truthness t12 = getForSingleValueJump(12, code);
    assertFalse(t12.isTrue());
    assertTrue(t12.isFalse());

    assertTrue(t5.getOfTrue() < t3.getOfTrue());
    assertTrue(t5.getOfTrue() > t12.getOfTrue());
}
 
開發者ID:EMResearch,項目名稱:EvoMaster,代碼行數:20,代碼來源:HeuristicsForJumpsTest.java

示例4: test_IFLT_neg

@Test
public void test_IFLT_neg(){
    //val < 0
    int code = Opcodes.IFLT;

    Truthness tm3 = getForSingleValueJump(-3, code);
    assertTrue(tm3.isTrue());
    assertFalse(tm3.isFalse());

    Truthness tm5 = getForSingleValueJump(-5, code);
    assertTrue(tm5.isTrue());
    assertFalse(tm5.isFalse());

    Truthness tm12 = getForSingleValueJump(-12, code);
    assertTrue(tm12.isTrue());
    assertFalse(tm12.isFalse());

    assertTrue(tm5.getOfFalse() < tm3.getOfFalse());
    assertTrue(tm5.getOfFalse() > tm12.getOfFalse());
}
 
開發者ID:EMResearch,項目名稱:EvoMaster,代碼行數:20,代碼來源:HeuristicsForJumpsTest.java

示例5: getJumpTargets

private int[] getJumpTargets(JumpInsnNode jump) {
  switch (jump.getOpcode()) {
    case Opcodes.IFEQ:
    case Opcodes.IFNE:
    case Opcodes.IFLT:
    case Opcodes.IFGE:
    case Opcodes.IFGT:
    case Opcodes.IFLE:
    case Opcodes.IF_ICMPEQ:
    case Opcodes.IF_ICMPNE:
    case Opcodes.IF_ICMPLT:
    case Opcodes.IF_ICMPGE:
    case Opcodes.IF_ICMPGT:
    case Opcodes.IF_ICMPLE:
    case Opcodes.IF_ACMPEQ:
    case Opcodes.IF_ACMPNE:
    case Opcodes.IFNULL:
    case Opcodes.IFNONNULL:
      return new int[]{getOffset(jump.label), getOffset(jump.getNext())};
    case Opcodes.GOTO:
      return new int[]{getOffset(jump.label)};
    case Opcodes.JSR: {
      throw new Unreachable("JSR should be handled by the ASM jsr inliner");
    }
    default:
      throw new Unreachable("Unexpected opcode in jump instruction: " + jump);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:28,代碼來源:JarSourceCode.java

示例6: visitJumpInsn

/**
 * Imports branch instructions, both conditional and unconditional.
 *
 * @param opcode Opcode.
 * @param label  Destination of branch.
 */
@Override
public void visitJumpInsn(final int opcode, final Label label) {
  BasicBlock section = getBasicBlock(label);
    
  switch(opcode) {
    // Unconditional Branch
    case Opcodes.GOTO: finishBlock(section); setCurrent(null); break;
    
    // Zero Test
    case Opcodes.IFEQ: createZeroCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IFNE: createZeroCondition(Condition.Operator.NE, section); break;
    case Opcodes.IFLT: createZeroCondition(Condition.Operator.LT, section); break;
    case Opcodes.IFGE: createZeroCondition(Condition.Operator.GE, section); break;
    case Opcodes.IFGT: createZeroCondition(Condition.Operator.GT, section); break;
    case Opcodes.IFLE: createZeroCondition(Condition.Operator.LE, section); break;
    
    // Integer Comparison
    case Opcodes.IF_ICMPEQ: createCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IF_ICMPNE: createCondition(Condition.Operator.NE, section); break;
    case Opcodes.IF_ICMPLT: createCondition(Condition.Operator.LT, section); break;
    case Opcodes.IF_ICMPGE: createCondition(Condition.Operator.GE, section); break;
    case Opcodes.IF_ICMPGT: createCondition(Condition.Operator.GT, section); break;
    case Opcodes.IF_ICMPLE: createCondition(Condition.Operator.LE, section); break;

    // Reference Comparisons
    case Opcodes.IF_ACMPEQ: createCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IF_ACMPNE: createCondition(Condition.Operator.NE, section); break;
    case Opcodes.IFNULL:    createNullCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IFNONNULL: createNullCondition(Condition.Operator.NE, section); break;
    
    // TODO: JSR (paired with RET)
    case Opcodes.JSR: System.err.println("visitJumpInsn: JSR");
  }
}
 
開發者ID:adnanmitf09,項目名稱:Rubus,代碼行數:40,代碼來源:MethodImporter.java

示例7: test_IFLT_m10

@Test
public void test_IFLT_m10(){
    //val < 0
    int code = Opcodes.IFLT;

    Truthness t0 = getForSingleValueJump(-10, code);
    assertTrue(t0.isTrue());
    assertFalse(t0.isFalse());
}
 
開發者ID:EMResearch,項目名稱:EvoMaster,代碼行數:9,代碼來源:HeuristicsForJumpsTest.java

示例8: test_IFLT_0

@Test
public void test_IFLT_0() {
    //val < 0
    int code = Opcodes.IFLT;

    Truthness tm3 = getForSingleValueJump(0, code);
    assertFalse(tm3.isTrue());
    assertTrue(tm3.isFalse());
}
 
開發者ID:EMResearch,項目名稱:EvoMaster,代碼行數:9,代碼來源:HeuristicsForJumpsTest.java

示例9: visitJumpInsn

@Override
public void visitJumpInsn(final int opcode, final Label label) {
    switch (opcode) {
    case Opcodes.IFEQ:
        ifeq(label);
        break;
    case Opcodes.IFNE:
        ifne(label);
        break;
    case Opcodes.IFLT:
        iflt(label);
        break;
    case Opcodes.IFGE:
        ifge(label);
        break;
    case Opcodes.IFGT:
        ifgt(label);
        break;
    case Opcodes.IFLE:
        ifle(label);
        break;
    case Opcodes.IF_ICMPEQ:
        ificmpeq(label);
        break;
    case Opcodes.IF_ICMPNE:
        ificmpne(label);
        break;
    case Opcodes.IF_ICMPLT:
        ificmplt(label);
        break;
    case Opcodes.IF_ICMPGE:
        ificmpge(label);
        break;
    case Opcodes.IF_ICMPGT:
        ificmpgt(label);
        break;
    case Opcodes.IF_ICMPLE:
        ificmple(label);
        break;
    case Opcodes.IF_ACMPEQ:
        ifacmpeq(label);
        break;
    case Opcodes.IF_ACMPNE:
        ifacmpne(label);
        break;
    case Opcodes.GOTO:
        goTo(label);
        break;
    case Opcodes.JSR:
        jsr(label);
        break;
    case Opcodes.IFNULL:
        ifnull(label);
        break;
    case Opcodes.IFNONNULL:
        ifnonnull(label);
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:61,代碼來源:InstructionAdapter.java


注:本文中的org.objectweb.asm.Opcodes.IFLT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。