Puts a reference to this label in the bytecode of a method. If the bytecode offset of the label is known, the relative bytecode offset between the label and the instruction referencing it is computed and written directly. Otherwise, a null relative offset is written and a new forward reference is de
(
final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference)
| 381 | * @param wideReference whether the reference must be stored in 4 bytes (instead of 2 bytes). |
| 382 | */ |
| 383 | final void put( |
| 384 | final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference) { |
| 385 | if ((flags & FLAG_RESOLVED) == 0) { |
| 386 | if (wideReference) { |
| 387 | addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_WIDE, code.length); |
| 388 | code.putInt(-1); |
| 389 | } else { |
| 390 | addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_SHORT, code.length); |
| 391 | code.putShort(-1); |
| 392 | } |
| 393 | } else { |
| 394 | if (wideReference) { |
| 395 | code.putInt(bytecodeOffset - sourceInsnBytecodeOffset); |
| 396 | } else { |
| 397 | code.putShort(bytecodeOffset - sourceInsnBytecodeOffset); |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Adds a forward reference to this label. This method must be called only for a true forward |
no test coverage detected