Example usage for org.objectweb.asm Opcodes IINC

List of usage examples for org.objectweb.asm Opcodes IINC

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes IINC.

Prototype

int IINC

To view the source code for org.objectweb.asm Opcodes IINC.

Click Source Link

Usage

From source file:edu.mit.streamjit.util.bytecode.MethodResolver.java

License:Open Source License

private void interpret(IincInsnNode insn, FrameState frame, BBInfo block) {
    switch (insn.getOpcode()) {
    case Opcodes.IINC:
        Constant<Integer> c = module.constants().getConstant(insn.incr);
        BinaryInst bi = new BinaryInst(frame.locals[insn.var], BinaryInst.Operation.ADD, c);
        block.block.instructions().add(bi);
        frame.locals[insn.var] = bi;
        break;//from  w  w  w  .j  a  v  a  2  s.c om
    default:
        throw new UnsupportedOperationException("" + insn.getOpcode());
    }
}

From source file:net.transmutator4j.mutations.IncrementMutation.java

License:Open Source License

@Override
public int getMutatedOpCode() {
    return Opcodes.IINC;
}

From source file:net.transmutator4j.mutations.IncrementMutation.java

License:Open Source License

@Override
public int getOriginalOpCode() {
    return Opcodes.IINC;
}

From source file:net.transmutator4j.mutations.TestIncrementMutation.java

License:Open Source License

@Test
public void positiveMutation() {
    assertEquals(-5, positiveMutation.getMutatedIncrement());
    assertEquals(Opcodes.IINC, positiveMutation.getOriginalOpCode());
    assertEquals(Opcodes.IINC, positiveMutation.getMutatedOpCode());
    assertEquals("increment of 5 became increment of -5", positiveMutation.description());
    assertFalse(positiveMutation.equals(negativeMutation));
    assertFalse(positiveMutation.hashCode() == negativeMutation.hashCode());
}

From source file:net.transmutator4j.mutations.TestIncrementMutation.java

License:Open Source License

@Test
public void negativeMutation() {
    assertEquals(5, negativeMutation.getMutatedIncrement());
    assertEquals(Opcodes.IINC, negativeMutation.getOriginalOpCode());
    assertEquals(Opcodes.IINC, negativeMutation.getMutatedOpCode());
    assertEquals("increment of -5 became increment of 5", negativeMutation.description());
    assertFalse(negativeMutation.equals(positiveMutation));
    assertFalse(negativeMutation.hashCode() == positiveMutation.hashCode());
}

From source file:org.adjective.stout.tools.StackVisualiserMethodVisitor.java

License:Apache License

public void visitIincInsn(int var, int increment) {
    print(Opcodes.IINC, Integer.toString(var) + " " + increment);
}

From source file:org.decojer.cavaj.readers.asm.ReadMethodVisitor.java

License:Open Source License

@Override
public void visitIincInsn(final int var, final int increment) {
    /*******/*from   ww w  .j  a v  a2 s.co m*/
     * INC *
     *******/
    add(new INC(this.ops.size(), Opcodes.IINC, this.line, T.INT, var, increment));
}

From source file:org.evosuite.graphs.cfg.ASMWrapper.java

License:Open Source License

/**
 * <p>// w ww  .  j  a  v a2  s.  com
 * isLocalVarDefinition
 * </p>
 * 
 * @return a boolean.
 */
public boolean isLocalVariableDefinition() {
    return asmNode.getOpcode() == Opcodes.ISTORE || asmNode.getOpcode() == Opcodes.LSTORE
            || asmNode.getOpcode() == Opcodes.FSTORE || asmNode.getOpcode() == Opcodes.DSTORE
            || asmNode.getOpcode() == Opcodes.ASTORE || asmNode.getOpcode() == Opcodes.IINC
            || isLocalArrayDefinition();
}

From source file:org.evosuite.graphs.cfg.ASMWrapper.java

License:Open Source License

/**
 * <p>//from  w ww  .jav a 2 s  . c  o  m
 * isLocalVarUse
 * </p>
 * 
 * @return a boolean.
 */
public boolean isLocalVariableUse() {
    return asmNode.getOpcode() == Opcodes.ILOAD || asmNode.getOpcode() == Opcodes.LLOAD
            || asmNode.getOpcode() == Opcodes.FLOAD || asmNode.getOpcode() == Opcodes.DLOAD
            || asmNode.getOpcode() == Opcodes.IINC
            || (asmNode.getOpcode() == Opcodes.ALOAD && !loadsReferenceToThis());
}

From source file:org.evosuite.graphs.cfg.ASMWrapper.java

License:Open Source License

public boolean isIINC() {
    return asmNode.getOpcode() == Opcodes.IINC;
}