110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali/***
210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * ASM: a very small and fast Java bytecode manipulation framework
310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * Copyright (c) 2000-2005 INRIA, France Telecom
410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * All rights reserved.
510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *
610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * Redistribution and use in source and binary forms, with or without
710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * modification, are permitted provided that the following conditions
810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * are met:
910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * 1. Redistributions of source code must retain the above copyright
1010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *    notice, this list of conditions and the following disclaimer.
1110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * 2. Redistributions in binary form must reproduce the above copyright
1210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *    notice, this list of conditions and the following disclaimer in the
1310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *    documentation and/or other materials provided with the distribution.
1410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * 3. Neither the name of the copyright holders nor the names of its
1510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *    contributors may be used to endorse or promote products derived from
1610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *    this software without specific prior written permission.
1710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *
1810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * THE POSSIBILITY OF SUCH DAMAGE.
2910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali */
3010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Alipackage org.objectweb.asm.tree;
3110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
3210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Aliimport org.objectweb.asm.MethodVisitor;
3310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Aliimport org.objectweb.asm.Opcodes;
3410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
3510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali/**
3610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * A node that represents an IINC instruction.
3710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali *
3810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali * @author Eric Bruneton
3910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali */
4010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Alipublic class IincInsnNode extends AbstractInsnNode {
4110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
4210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    /**
4310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     * Index of the local variable to be incremented.
4410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     */
4510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    public int var;
4610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
4710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    /**
4810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     * Amount to increment the local variable by.
4910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     */
5010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    public int incr;
5110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
5210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    /**
5310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     * Constructs a new {@link IincInsnNode}.
5410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     *
5510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     * @param var index of the local variable to be incremented.
5610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     * @param incr increment amount to increment the local variable by.
5710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali     */
5810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    public IincInsnNode(final int var, final int incr) {
5910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali        super(Opcodes.IINC);
6010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali        this.var = var;
6110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali        this.incr = incr;
6210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    }
6310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
6410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    public void accept(final MethodVisitor mv) {
6510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali        mv.visitIincInsn(var, incr);
6610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    }
6710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali
6810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    public int getType() {
6910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali        return IINC_INSN;
7010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali    }
7110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali}