/** * Updates the offset of the given label. * * @param indexes current positions of the instructions to be resized. Each * instruction must be designated by the index of its <i>last</i> * byte, plus one (or, in other words, by the index of the <i>first</i> * byte of the <i>next</i> instruction). * @param sizes the number of bytes to be <i>added</i> to the above * instructions. More precisely, for each i < <tt>len</tt>, * <tt>sizes</tt>[i] bytes will be added at the end of the * instruction designated by <tt>indexes</tt>[i] or, if * <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>| * bytes of the instruction will be removed (the instruction size * <i>must not</i> become negative or null). * @param label the label whose offset must be updated. */ static void getNewOffset( final int[] indexes, final int[] sizes, final Label label) { if ((label.status & Label.RESIZED) == 0) { label.position = getNewOffset(indexes, sizes, 0, label.position); label.status |= Label.RESIZED; } } }
newOffset = getNewOffset(allIndexes, allSizes, u, label); if (newOffset < Short.MIN_VALUE || newOffset > Short.MAX_VALUE) { newOffset = getNewOffset(allIndexes, allSizes, 0, u); insert = -(newOffset & 3); newOffset = getNewOffset(allIndexes, allSizes, 0, u); insert = -(newOffset & 3); newOffset = getNewOffset(allIndexes, allSizes, u, label); if (resize[u]) { case ClassWriter.LABELW_INSN: label = u + readInt(b, u + 1); newOffset = getNewOffset(allIndexes, allSizes, u, label); newCode.putByte(opcode); newCode.putInt(newOffset); label = v + readInt(b, u); u += 4; newOffset = getNewOffset(allIndexes, allSizes, v, label); newCode.putInt(newOffset); j = readInt(b, u); label = v + readInt(b, u); u += 4; newOffset = getNewOffset(allIndexes, allSizes, v, label); newCode.putInt(newOffset);