Example usage for org.objectweb.asm Opcodes MULTIANEWARRAY

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

Introduction

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

Prototype

int MULTIANEWARRAY

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

Click Source Link

Usage

From source file:de.unisb.cs.st.javaslicer.common.classRepresentation.instructions.MultiANewArrayInstruction2.java

License:Open Source License

public MultiANewArrayInstruction2(final ReadMethod readMethod, final String desc, final int dims,
        final int lineNumber, final int index, long[] newobjectidentifiers) {
    super(readMethod, Opcodes.MULTIANEWARRAY, lineNumber, index);
    this.typeDesc = desc;
    this.dims = dims;
    this.newObjectIdentifiers = newobjectidentifiers;
}

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

License:Open Source License

private void interpret(MultiANewArrayInsnNode insn, FrameState frame, BBInfo block) {
    assert insn.getOpcode() == Opcodes.MULTIANEWARRAY;
    Klass k = getKlassByInternalName(insn.desc);
    Value[] dims = new Value[insn.dims];
    for (int i = dims.length - 1; i >= 0; --i)
        dims[i] = frame.stack.pop();/*from   w ww .j a  v  a2 s  .  c  o m*/
    NewArrayInst nai = new NewArrayInst(typeFactory.getArrayType(k), dims);
    block.block.instructions().add(nai);
    frame.stack.push(nai);
}

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

License:Open Source License

@Override
public void visitMultiANewArrayInsn(final String desc, final int dims) {
    /************/*from  w w  w . j  av a  2  s.co m*/
     * NEWARRAY *
     ************/
    // operation works different from other newarrays, descriptor contains array with
    // dimension > given sizes on stack, e.g.: new int[1][2][3][][], dimension is 3 and
    // descriptor is [[[[[I
    T elementT = getDu().getDescT(desc);
    if (elementT == null) {
        log.warn(getM() + ": Cannot read element type from descriptor '" + desc + "' for MULTIANEWARRAY!");
        elementT = T.ANY;
    }
    add(new NEWARRAY(this.ops.size(), Opcodes.MULTIANEWARRAY, this.line, elementT, dims));
}

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

License:Open Source License

/**
 * Determine how many bytes the current instruction occupies together with
 * its operands//from   w  w w  . j  a v a2  s.  c  o  m
 * 
 * @return
 */
private int getBytecodeIncrement(AbstractInsnNode instructionNode) {
    int opcode = instructionNode.getOpcode();
    switch (opcode) {
    case Opcodes.ALOAD: // index
    case Opcodes.ASTORE: // index
    case Opcodes.DLOAD:
    case Opcodes.DSTORE:
    case Opcodes.FLOAD:
    case Opcodes.FSTORE:
    case Opcodes.ILOAD:
    case Opcodes.ISTORE:
    case Opcodes.LLOAD:
    case Opcodes.LSTORE:
        VarInsnNode varNode = (VarInsnNode) instructionNode;
        if (varNode.var > 3)
            return 1;
        else
            return 0;
    case Opcodes.BIPUSH: // byte
    case Opcodes.NEWARRAY:
    case Opcodes.RET:
        return 1;
    case Opcodes.LDC:
        LdcInsnNode ldcNode = (LdcInsnNode) instructionNode;
        if (ldcNode.cst instanceof Double || ldcNode.cst instanceof Long)
            return 2; // LDC2_W
        else
            return 1;
    case 19: //LDC_W
    case 20: //LDC2_W
        return 2;
    case Opcodes.ANEWARRAY: // indexbyte1, indexbyte2
    case Opcodes.CHECKCAST: // indexbyte1, indexbyte2
    case Opcodes.GETFIELD:
    case Opcodes.GETSTATIC:
    case Opcodes.GOTO:
    case Opcodes.IF_ACMPEQ:
    case Opcodes.IF_ACMPNE:
    case Opcodes.IF_ICMPEQ:
    case Opcodes.IF_ICMPNE:
    case Opcodes.IF_ICMPGE:
    case Opcodes.IF_ICMPGT:
    case Opcodes.IF_ICMPLE:
    case Opcodes.IF_ICMPLT:
    case Opcodes.IFLE:
    case Opcodes.IFLT:
    case Opcodes.IFGE:
    case Opcodes.IFGT:
    case Opcodes.IFNE:
    case Opcodes.IFEQ:
    case Opcodes.IFNONNULL:
    case Opcodes.IFNULL:
    case Opcodes.IINC:
    case Opcodes.INSTANCEOF:
    case Opcodes.INVOKESPECIAL:
    case Opcodes.INVOKESTATIC:
    case Opcodes.INVOKEVIRTUAL:
    case Opcodes.JSR:
    case Opcodes.NEW:
    case Opcodes.PUTFIELD:
    case Opcodes.PUTSTATIC:
    case Opcodes.SIPUSH:
        // case Opcodes.LDC_W
        // case Opcodes.LDC2_W

        return 2;
    case Opcodes.MULTIANEWARRAY:
        return 3;
    case Opcodes.INVOKEDYNAMIC:
    case Opcodes.INVOKEINTERFACE:
        return 4;

    case Opcodes.LOOKUPSWITCH:
    case Opcodes.TABLESWITCH:
        // TODO: Could be more
        return 4;
    // case Opcodes.GOTO_W 
    // case Opcodes.JSR_W
    }
    return 0;
}

From source file:org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter.java

License:Open Source License

@Override
public void visitMultiANewArrayInsn(String desc, int dims) {
    super.visitMultiANewArrayInsn(desc, dims);
    cfg.add(Opcodes.MULTIANEWARRAY, desc, dims);
}