Example usage for org.objectweb.asm.tree InsnList add

List of usage examples for org.objectweb.asm.tree InsnList add

Introduction

In this page you can find the example usage for org.objectweb.asm.tree InsnList add.

Prototype

public void add(final InsnList insnList) 

Source Link

Document

Adds the given instructions to the end of this list.

Usage

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void push(InsnList insnList, final int value) {
    if (value >= -1 && value <= 5) {
        insnList.add(new InsnNode(Opcodes.ICONST_0 + value));
    } else if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) {
        insnList.add(new IntInsnNode(Opcodes.BIPUSH, value));
    } else if (value >= Short.MIN_VALUE && value <= Short.MAX_VALUE) {
        insnList.add(new IntInsnNode(Opcodes.SIPUSH, value));
    } else {//from  ww w .  j av a2 s . c  o  m
        insnList.add(new LdcInsnNode(value));
    }
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void push(InsnList insnList, final String value) {
    if (value == null) {
        insnList.add(new InsnNode(Opcodes.ACONST_NULL));
    } else {/*from w  ww .j a v a2 s . c  om*/
        insnList.add(new LdcInsnNode(value));
    }
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void newArray(final InsnList insnList, final Type type) {
    insnList.add(new TypeInsnNode(Opcodes.ANEWARRAY, type.getInternalName()));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void dup(final InsnList insnList) {
    insnList.add(new InsnNode(Opcodes.DUP));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void dup2(final InsnList insnList) {
    insnList.add(new InsnNode(Opcodes.DUP2));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void dupX1(final InsnList insnList) {
    insnList.add(new InsnNode(Opcodes.DUP_X1));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void dupX2(final InsnList insnList) {
    insnList.add(new InsnNode(Opcodes.DUP_X2));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void pop(final InsnList insnList) {
    insnList.add(new InsnNode(Opcodes.POP));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void swap(final InsnList insnList) {
    insnList.add(new InsnNode(Opcodes.SWAP));
}

From source file:com.navercorp.pinpoint.profiler.instrument.ASMMethodVariables.java

License:Apache License

void loadArg(final InsnList instructions, Type[] argumentTypes, int i) {
    final int index = getArgIndex(argumentTypes, i);
    final Type type = argumentTypes[i];
    instructions.add(new VarInsnNode(type.getOpcode(Opcodes.ILOAD), index));
}