/** * writes a goto instruction. * <p/> * TODO: implemented goto_w */ public BranchEnd gotoInstruction() { writeByte(Opcode.GOTO); writeShort(0); currentOffset += 3; BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); currentFrame = null; return ret; }
/** * marks the end of a branch. The current stack frame is checked for compatibility with the stack frame at the branch start */ public void branchEnd(BranchEnd end) { mergeStackFrames(end.getStackFrame()); final int jump = currentOffset - end.getOffsetLocation(); if (end.isJump32Bit()) { jumpLocations32.put(end.getBranchLocation(), jump); } else { if (jump > Short.MAX_VALUE) { throw new RuntimeException(jump + " is to big to be written as a 16 bit value"); } jumpLocations.put(end.getBranchLocation(), jump); } }
/** * marks the end of a branch. The current stack frame is checked for compatibility with the stack frame at the branch start */ public void branchEnd(BranchEnd end) { mergeStackFrames(end.getStackFrame()); final int jump = currentOffset - end.getOffsetLocation(); if (end.isJump32Bit()) { jumpLocations32.put(end.getBranchLocation(), jump); } else { if (jump > Short.MAX_VALUE) { throw new RuntimeException(jump + " is to big to be written as a 16 bit value"); } jumpLocations.put(end.getBranchLocation(), jump); } }
/** * writes a goto instruction. * <p/> * TODO: implemented goto_w */ public BranchEnd gotoInstruction() { writeByte(Opcode.GOTO); writeShort(0); currentOffset += 3; BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); currentFrame = null; return ret; }
/** * marks the end of a branch. The current stack frame is checked for compatibility with the stack frame at the branch start */ public void branchEnd(BranchEnd end) { mergeStackFrames(end.getStackFrame()); final int jump = currentOffset - end.getOffsetLocation(); if (end.isJump32Bit()) { jumpLocations32.put(end.getBranchLocation(), jump); } else { if(jump > Short.MAX_VALUE) { throw new RuntimeException(jump + " is to big to be written as a 16 bit value"); } jumpLocations.put(end.getBranchLocation(), jump); } }
/** * writes a goto instruction. * <p/> * TODO: implemented goto_w */ public BranchEnd gotoInstruction() { writeByte(Opcode.GOTO); writeShort(0); currentOffset += 3; BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); currentFrame = null; return ret; }
/** * marks the end of a branch. The current stack frame is checked for compatibility with the stack frame at the branch start */ public void branchEnd(BranchEnd end) { mergeStackFrames(end.getStackFrame()); final int jump = currentOffset - end.getOffsetLocation(); if (end.isJump32Bit()) { jumpLocations32.put(end.getBranchLocation(), jump); } else { if (jump > Short.MAX_VALUE) { throw new RuntimeException(jump + " is to big to be written as a 16 bit value"); } jumpLocations.put(end.getBranchLocation(), jump); } }
/** * writes a goto instruction. * <p/> * TODO: implemented goto_w */ public BranchEnd gotoInstruction() { writeByte(Opcode.GOTO); writeShort(0); currentOffset += 3; BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); currentFrame = null; return ret; }
/** * marks the end of a branch. The current stack frame is checked for compatibility with the stack frame at the branch start */ public void branchEnd(BranchEnd end) { mergeStackFrames(end.getStackFrame()); final int jump = currentOffset - end.getOffsetLocation(); if (end.isJump32Bit()) { jumpLocations32.put(end.getBranchLocation(), jump); } else { if (jump > Short.MAX_VALUE) { throw new RuntimeException(jump + " is to big to be written as a 16 bit value"); } jumpLocations.put(end.getBranchLocation(), jump); } }
/** * writes a goto instruction. * <p/> * TODO: implemented goto_w */ public BranchEnd gotoInstruction() { writeByte(Opcode.GOTO); writeShort(0); currentOffset += 3; BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); currentFrame = null; return ret; }
private BranchEnd addIf(int opcode, String name) { assertTypeOnStack(StackEntryType.INT, name + " requires int on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addNullComparison(int opcode, String name) { assertTypeOnStack(StackEntryType.OBJECT, name + " requires reference type on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addNullComparison(int opcode, String name) { assertTypeOnStack(StackEntryType.OBJECT, name + " requires reference type on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addIf(int opcode, String name) { assertTypeOnStack(StackEntryType.INT, name + " requires int on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addIf(int opcode, String name) { assertTypeOnStack(StackEntryType.INT, name + " requires int on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addIf(int opcode, String name) { assertTypeOnStack(StackEntryType.INT, name + " requires int on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); return ret; }
private BranchEnd addNullComparison(int opcode, String name) { assertTypeOnStack(StackEntryType.OBJECT, name + " requires reference type on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); BranchEnd ret = new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); return ret; }
private BranchEnd addNullComparison(int opcode, String name) { assertTypeOnStack(StackEntryType.OBJECT, name + " requires reference type on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addNullComparison(int opcode, String name) { assertTypeOnStack(StackEntryType.OBJECT, name + " requires reference type on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }
private BranchEnd addIf(int opcode, String name) { assertTypeOnStack(StackEntryType.INT, name + " requires int on stack"); writeByte(opcode); writeShort(0); currentOffset += 3; advanceFrame(currentFrame.pop()); return new BranchEnd(currentOffset - 2, currentFrame, currentOffset - 3); }