jdk.internal.org.objectweb.asm.tree.VarInsnNode Java Examples

The following examples show how to use jdk.internal.org.objectweb.asm.tree.VarInsnNode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TinyInstrumentor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Shifts all local variable slot references by a specified amount.
 */
private static void shiftLocalSlots(InsnList instructions, int offset) {
    for (AbstractInsnNode insn : selectAll(instructions)) {
        if (insn instanceof VarInsnNode) {
            VarInsnNode varInsn = (VarInsnNode) insn;
            varInsn.var += offset;

        } else if (insn instanceof IincInsnNode) {
            IincInsnNode iincInsn = (IincInsnNode) insn;
            iincInsn.var += offset;
        }
    }
}