private void insertGoto(CodeIterator iterator, int subr, int pos) throws BadBytecode { iterator.setMark(subr); // the gap length might be a multiple of 4. iterator.writeByte(Opcode.NOP, pos); boolean wide = subr + 2 - pos > Short.MAX_VALUE; int len = wide ? 4 : 2; CodeIterator.Gap gap = iterator.insertGapAt(pos, len, false); pos = gap.position + gap.length - len; int offset = iterator.getMark() - pos; if (wide) { iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(offset, pos + 1); } else if (offset <= Short.MAX_VALUE) { iterator.writeByte(Opcode.GOTO, pos); iterator.write16bit(offset, pos + 1); } else { if (gap.length < 4) { CodeIterator.Gap gap2 = iterator.insertGapAt(gap.position, 2, false); pos = gap2.position + gap2.length + gap.length - 4; } iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(iterator.getMark() - pos, pos + 1); } }
private void insertGoto(CodeIterator iterator, int subr, int pos) throws BadBytecode { iterator.setMark(subr); // the gap length might be a multiple of 4. iterator.writeByte(Opcode.NOP, pos); boolean wide = subr + 2 - pos > Short.MAX_VALUE; int len = wide ? 4 : 2; CodeIterator.Gap gap = iterator.insertGapAt(pos, len, false); pos = gap.position + gap.length - len; int offset = iterator.getMark() - pos; if (wide) { iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(offset, pos + 1); } else if (offset <= Short.MAX_VALUE) { iterator.writeByte(Opcode.GOTO, pos); iterator.write16bit(offset, pos + 1); } else { if (gap.length < 4) { CodeIterator.Gap gap2 = iterator.insertGapAt(gap.position, 2, false); pos = gap2.position + gap2.length + gap.length - 4; } iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(iterator.getMark() - pos, pos + 1); } }
protected int match2(int pos, CodeIterator iterator) throws BadBytecode { iterator.move(pos); iterator.insert(saveCode); iterator.insert(loadCode); int p = iterator.insertGap(3); iterator.setMark(p); iterator.insert(loadCode); pos = iterator.next(); p = iterator.getMark(); iterator.writeByte(iterator.byteAt(pos), p); iterator.write16bit(iterator.u16bitAt(pos + 1), p + 1); iterator.writeByte(INVOKESTATIC, pos); iterator.write16bit(newIndex, pos + 1); iterator.move(p); return iterator.next(); } }
@Override protected int match2(int pos, CodeIterator iterator) throws BadBytecode { iterator.move(pos); iterator.insert(saveCode); iterator.insert(loadCode); int p = iterator.insertGap(3); iterator.setMark(p); iterator.insert(loadCode); pos = iterator.next(); p = iterator.getMark(); iterator.writeByte(iterator.byteAt(pos), p); iterator.write16bit(iterator.u16bitAt(pos + 1), p + 1); iterator.writeByte(INVOKESTATIC, pos); iterator.write16bit(newIndex, pos + 1); iterator.move(p); return iterator.next(); } }
private void insertGoto(CodeIterator iterator, int subr, int pos) throws BadBytecode { iterator.setMark(subr); // the gap length might be a multiple of 4. iterator.writeByte(Opcode.NOP, pos); boolean wide = subr + 2 - pos > Short.MAX_VALUE; pos = iterator.insertGapAt(pos, wide ? 4 : 2, false).position; int offset = iterator.getMark() - pos; if (wide) { iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(offset, pos + 1); } else if (offset <= Short.MAX_VALUE) { iterator.writeByte(Opcode.GOTO, pos); iterator.write16bit(offset, pos + 1); } else { pos = iterator.insertGapAt(pos, 2, false).position; iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(iterator.getMark() - pos, pos + 1); } }
private void insertGoto(CodeIterator iterator, int subr, int pos) throws BadBytecode { iterator.setMark(subr); // the gap length might be a multiple of 4. iterator.writeByte(Opcode.NOP, pos); boolean wide = subr + 2 - pos > Short.MAX_VALUE; pos = iterator.insertGapAt(pos, wide ? 4 : 2, false).position; int offset = iterator.getMark() - pos; if (wide) { iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(offset, pos + 1); } else if (offset <= Short.MAX_VALUE) { iterator.writeByte(Opcode.GOTO, pos); iterator.write16bit(offset, pos + 1); } else { pos = iterator.insertGapAt(pos, 2, false).position; iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(iterator.getMark() - pos, pos + 1); } }
private void insertGoto(CodeIterator iterator, int subr, int pos) throws BadBytecode { iterator.setMark(subr); // the gap length might be a multiple of 4. iterator.writeByte(Opcode.NOP, pos); boolean wide = subr + 2 - pos > Short.MAX_VALUE; pos = iterator.insertGapAt(pos, wide ? 4 : 2, false).position; int offset = iterator.getMark() - pos; if (wide) { iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(offset, pos + 1); } else if (offset <= Short.MAX_VALUE) { iterator.writeByte(Opcode.GOTO, pos); iterator.write16bit(offset, pos + 1); } else { pos = iterator.insertGapAt(pos, 2, false).position; iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(iterator.getMark() - pos, pos + 1); } }
private void insertGoto(CodeIterator iterator, int subr, int pos) throws BadBytecode { iterator.setMark(subr); // the gap length might be a multiple of 4. iterator.writeByte(Opcode.NOP, pos); boolean wide = subr + 2 - pos > Short.MAX_VALUE; pos = iterator.insertGapAt(pos, wide ? 4 : 2, false).position; int offset = iterator.getMark() - pos; if (wide) { iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(offset, pos + 1); } else if (offset <= Short.MAX_VALUE) { iterator.writeByte(Opcode.GOTO, pos); iterator.write16bit(offset, pos + 1); } else { pos = iterator.insertGapAt(pos, 2, false).position; iterator.writeByte(Opcode.GOTO_W, pos); iterator.write32bit(iterator.getMark() - pos, pos + 1); } }
protected int match2(int pos, CodeIterator iterator) throws BadBytecode { iterator.move(pos); iterator.insert(saveCode); iterator.insert(loadCode); int p = iterator.insertGap(3); iterator.setMark(p); iterator.insert(loadCode); pos = iterator.next(); p = iterator.getMark(); iterator.writeByte(iterator.byteAt(pos), p); iterator.write16bit(iterator.u16bitAt(pos + 1), p + 1); iterator.writeByte(INVOKESTATIC, pos); iterator.write16bit(newIndex, pos + 1); iterator.move(p); return iterator.next(); } }
protected int match2(int pos, CodeIterator iterator) throws BadBytecode { iterator.move(pos); iterator.insert(saveCode); iterator.insert(loadCode); int p = iterator.insertGap(3); iterator.setMark(p); iterator.insert(loadCode); pos = iterator.next(); p = iterator.getMark(); iterator.writeByte(iterator.byteAt(pos), p); iterator.write16bit(iterator.u16bitAt(pos + 1), p + 1); iterator.writeByte(INVOKESTATIC, pos); iterator.write16bit(newIndex, pos + 1); iterator.move(p); return iterator.next(); } }
protected int match2(int pos, CodeIterator iterator) throws BadBytecode { iterator.move(pos); iterator.insert(saveCode); iterator.insert(loadCode); int p = iterator.insertGap(3); iterator.setMark(p); iterator.insert(loadCode); pos = iterator.next(); p = iterator.getMark(); iterator.writeByte(iterator.byteAt(pos), p); iterator.write16bit(iterator.u16bitAt(pos + 1), p + 1); iterator.writeByte(INVOKESTATIC, pos); iterator.write16bit(newIndex, pos + 1); iterator.move(p); return iterator.next(); } }
protected int match2(int pos, CodeIterator iterator) throws BadBytecode { iterator.move(pos); iterator.insert(saveCode); iterator.insert(loadCode); int p = iterator.insertGap(3); iterator.setMark(p); iterator.insert(loadCode); pos = iterator.next(); p = iterator.getMark(); iterator.writeByte(iterator.byteAt(pos), p); iterator.write16bit(iterator.u16bitAt(pos + 1), p + 1); iterator.writeByte(INVOKESTATIC, pos); iterator.write16bit(newIndex, pos + 1); iterator.move(p); return iterator.next(); } }