/** * Awaits the lock on {@code monitor}, and acquires it. */ public void monitorEnter(Local<?> monitor) { addInstruction(new ThrowingInsn(Rops.MONITOR_ENTER, sourcePosition, RegisterSpecList.make(monitor.spec()), catches)); }
/** {@inheritDoc} */ @Override public Insn withRegisterOffset(int delta) { return new ThrowingInsn(getOpcode(), getPosition(), getSources().withOffset(delta), catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingInsn(getOpcode(), getPosition(), sources, catches); } }
/** {@inheritDoc} */ public void visitThrowingInsn(ThrowingInsn insn) { SourcePosition pos = insn.getPosition(); Dop opcode = RopToDop.dopFor(insn); Rop rop = insn.getOpcode(); RegisterSpec realResult; if (rop.getBranchingness() != Rop.BRANCH_THROW) { throw new RuntimeException("shouldn't happen"); } realResult = getNextMoveResultPseudo(); if (opcode.hasResult() != (realResult != null)) { throw new RuntimeException( "Insn with result/move-result-pseudo mismatch" + insn); } addOutput(lastAddress); DalvInsn di = new SimpleInsn(opcode, pos, getRegs(insn, realResult)); addOutput(di); }
/** {@inheritDoc} */ @Override public String getInlineString() { return toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withAddedCatch(Type type) { return new ThrowingInsn(getOpcode(), getPosition(), getSources(), catches.withAddedType(type)); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingInsn(getOpcode(), getPosition(), sources, catches); } }
/** {@inheritDoc} */ public void visitThrowingInsn(ThrowingInsn insn) { SourcePosition pos = insn.getPosition(); Dop opcode = RopToDop.dopFor(insn); Rop rop = insn.getOpcode(); RegisterSpec realResult; if (rop.getBranchingness() != Rop.BRANCH_THROW) { throw new RuntimeException("shouldn't happen"); } realResult = getNextMoveResultPseudo(); if (opcode.hasResult() != (realResult != null)) { throw new RuntimeException( "Insn with result/move-result-pseudo mismatch" + insn); } addOutput(lastAddress); DalvInsn di = new SimpleInsn(opcode, pos, getRegs(insn, realResult)); addOutput(di); }
/** {@inheritDoc} */ @Override public String getInlineString() { return toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withRegisterOffset(int delta) { return new ThrowingInsn(getOpcode(), getPosition(), getSources().withOffset(delta), catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingInsn(getOpcode(), getPosition(), sources, catches); } }
/** * Releases the held lock on {@code monitor}. */ public void monitorExit(Local<?> monitor) { addInstruction(new ThrowingInsn(Rops.MONITOR_EXIT, sourcePosition, RegisterSpecList.make(monitor.spec()), catches)); }
/** {@inheritDoc} */ public void visitThrowingInsn(ThrowingInsn insn) { SourcePosition pos = insn.getPosition(); Dop opcode = RopToDop.dopFor(insn); Rop rop = insn.getOpcode(); RegisterSpec realResult; if (rop.getBranchingness() != Rop.BRANCH_THROW) { throw new RuntimeException("shouldn't happen"); } realResult = getNextMoveResultPseudo(); if (opcode.hasResult() != (realResult != null)) { throw new RuntimeException( "Insn with result/move-result-pseudo mismatch" + insn); } addOutput(lastAddress); DalvInsn di = new SimpleInsn(opcode, pos, getRegs(insn, realResult)); addOutput(di); }
/** {@inheritDoc} */ @Override public String getInlineString() { return toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withRegisterOffset(int delta) { return new ThrowingInsn(getOpcode(), getPosition(), getSources().withOffset(delta), catches); }
/** {@inheritDoc} */ @Override public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources) { return new ThrowingInsn(getOpcode(), getPosition(), sources, catches); } }
/** * Throws the throwable in {@code toThrow}. */ public void throwValue(Local<? extends Throwable> toThrow) { addInstruction(new ThrowingInsn(Rops.THROW, sourcePosition, RegisterSpecList.make(toThrow.spec()), catches)); }
/** {@inheritDoc} */ public void visitThrowingInsn(ThrowingInsn insn) { SourcePosition pos = insn.getPosition(); Dop opcode = RopToDop.dopFor(insn); Rop rop = insn.getOpcode(); RegisterSpec realResult; if (rop.getBranchingness() != Rop.BRANCH_THROW) { throw new RuntimeException("shouldn't happen"); } realResult = getNextMoveResultPseudo(); if (opcode.hasResult() != (realResult != null)) { throw new RuntimeException( "Insn with result/move-result-pseudo mismatch" + insn); } addOutput(lastAddress); DalvInsn di = new SimpleInsn(opcode, pos, getRegs(insn, realResult)); addOutput(di); }
/** {@inheritDoc} */ @Override public String getInlineString() { return toCatchString(catches); }
/** {@inheritDoc} */ @Override public Insn withAddedCatch(Type type) { return new ThrowingInsn(getOpcode(), getPosition(), getSources(), catches.withAddedType(type)); }