equal
deleted
inserted
replaced
27 import com.sun.org.apache.bcel.internal.util.ByteSequence; |
27 import com.sun.org.apache.bcel.internal.util.ByteSequence; |
28 |
28 |
29 /** |
29 /** |
30 * IINC - Increment local variable by constant |
30 * IINC - Increment local variable by constant |
31 * |
31 * |
32 * @version $Id: IINC.java 1747278 2016-06-07 17:28:43Z britter $ |
32 * @version $Id$ |
33 */ |
33 */ |
34 public class IINC extends LocalVariableInstruction { |
34 public class IINC extends LocalVariableInstruction { |
35 |
35 |
36 private boolean wide; |
36 private boolean wide; |
37 private int c; |
37 private int c; |
38 |
38 |
39 |
39 |
40 /** |
40 /** |
41 * Empty constructor needed for the Class.newInstance() statement in |
41 * Empty constructor needed for Instruction.readInstruction. |
42 * Instruction.readInstruction(). Not to be used otherwise. |
42 * Not to be used otherwise. |
43 */ |
43 */ |
44 IINC() { |
44 IINC() { |
45 } |
45 } |
46 |
46 |
47 |
47 |
77 } |
77 } |
78 } |
78 } |
79 |
79 |
80 |
80 |
81 private void setWide() { |
81 private void setWide() { |
82 wide = (super.getIndex() > com.sun.org.apache.bcel.internal.Const.MAX_BYTE) || (Math.abs(c) > Byte.MAX_VALUE); |
82 wide = super.getIndex() > com.sun.org.apache.bcel.internal.Const.MAX_BYTE; |
|
83 if (c > 0) { |
|
84 wide = wide || (c > Byte.MAX_VALUE); |
|
85 } else { |
|
86 wide = wide || (c < Byte.MIN_VALUE); |
|
87 } |
83 if (wide) { |
88 if (wide) { |
84 super.setLength(6); // wide byte included |
89 super.setLength(6); // wide byte included |
85 } else { |
90 } else { |
86 super.setLength(3); |
91 super.setLength(3); |
87 } |
92 } |