src/share/classes/com/sun/tools/classfile/Instruction.java

changeset 1428
d9fe1f80515d
parent 1358
fc123bdeddb8
child 2413
fe033d997ddf
equal deleted inserted replaced
1422:d898d9ee352f 1428:d9fe1f80515d
69 LOCAL_BYTE(3), 69 LOCAL_BYTE(3),
70 /** Opcode is followed by a signed short value. */ 70 /** Opcode is followed by a signed short value. */
71 SHORT(3), 71 SHORT(3),
72 /** Wide opcode is not followed by any operands. */ 72 /** Wide opcode is not followed by any operands. */
73 WIDE_NO_OPERANDS(2), 73 WIDE_NO_OPERANDS(2),
74 /** Wide opcode is followed by a 2-byte index into the local variables array. */
75 WIDE_LOCAL(4),
74 /** Wide opcode is followed by a 2-byte index into the constant pool. */ 76 /** Wide opcode is followed by a 2-byte index into the constant pool. */
75 WIDE_CPREF_W(4), 77 WIDE_CPREF_W(4),
76 /** Wide opcode is followed by a 2-byte index into the constant pool, 78 /** Wide opcode is followed by a 2-byte index into the constant pool,
77 * and a signed short value. */ 79 * and a signed short value. */
78 WIDE_CPREF_W_SHORT(6), 80 WIDE_CPREF_W_SHORT(6),
81 /** Wide opcode is followed by a 2-byte reference to a local variable,
82 * and a signed short value. */
83 WIDE_LOCAL_SHORT(6),
79 /** Opcode was not recognized. */ 84 /** Opcode was not recognized. */
80 UNKNOWN(1); 85 UNKNOWN(1);
81 86
82 Kind(int length) { 87 Kind(int length) {
83 this.length = length; 88 this.length = length;
99 R visitBranch(Instruction instr, int offset, P p); 104 R visitBranch(Instruction instr, int offset, P p);
100 /** See {@link Kind#CPREF}, {@link Kind#CPREF_W}, {@link Kind#WIDE_CPREF_W}. */ 105 /** See {@link Kind#CPREF}, {@link Kind#CPREF_W}, {@link Kind#WIDE_CPREF_W}. */
101 R visitConstantPoolRef(Instruction instr, int index, P p); 106 R visitConstantPoolRef(Instruction instr, int index, P p);
102 /** See {@link Kind#CPREF_W_UBYTE}, {@link Kind#CPREF_W_UBYTE_ZERO}, {@link Kind#WIDE_CPREF_W_SHORT}. */ 107 /** See {@link Kind#CPREF_W_UBYTE}, {@link Kind#CPREF_W_UBYTE_ZERO}, {@link Kind#WIDE_CPREF_W_SHORT}. */
103 R visitConstantPoolRefAndValue(Instruction instr, int index, int value, P p); 108 R visitConstantPoolRefAndValue(Instruction instr, int index, int value, P p);
104 /** See {@link Kind#LOCAL}. */ 109 /** See {@link Kind#LOCAL}, {@link Kind#WIDE_LOCAL}. */
105 R visitLocal(Instruction instr, int index, P p); 110 R visitLocal(Instruction instr, int index, P p);
106 /** See {@link Kind#LOCAL_BYTE}. */ 111 /** See {@link Kind#LOCAL_BYTE}. */
107 R visitLocalAndValue(Instruction instr, int index, int value, P p); 112 R visitLocalAndValue(Instruction instr, int index, int value, P p);
108 /** See {@link Kind#DYNAMIC}. */ 113 /** See {@link Kind#DYNAMIC}. */
109 R visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, P p); 114 R visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, P p);
313 return visitor.visitValue(this, getShort(1), p); 318 return visitor.visitValue(this, getShort(1), p);
314 319
315 case WIDE_NO_OPERANDS: 320 case WIDE_NO_OPERANDS:
316 return visitor.visitNoOperands(this, p); 321 return visitor.visitNoOperands(this, p);
317 322
323 case WIDE_LOCAL:
324 return visitor.visitLocal(this, getUnsignedShort(2), p);
325
318 case WIDE_CPREF_W: 326 case WIDE_CPREF_W:
319 return visitor.visitConstantPoolRef(this, getUnsignedShort(2), p); 327 return visitor.visitConstantPoolRef(this, getUnsignedShort(2), p);
320 328
321 case WIDE_CPREF_W_SHORT: 329 case WIDE_CPREF_W_SHORT:
322 return visitor.visitConstantPoolRefAndValue( 330 return visitor.visitConstantPoolRefAndValue(
323 this, getUnsignedShort(2), getUnsignedByte(4), p); 331 this, getUnsignedShort(2), getUnsignedByte(4), p);
324 332
333 case WIDE_LOCAL_SHORT:
334 return visitor.visitLocalAndValue(
335 this, getUnsignedShort(2), getShort(4), p);
336
325 case UNKNOWN: 337 case UNKNOWN:
326 return visitor.visitUnknown(this, p); 338 return visitor.visitUnknown(this, p);
327 339
328 default: 340 default:
329 throw new IllegalStateException(); 341 throw new IllegalStateException();

mercurial