本文整理汇总了C#中CodeGenContext.bne方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGenContext.bne方法的具体用法?C# CodeGenContext.bne怎么用?C# CodeGenContext.bne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGenContext
的用法示例。
在下文中一共展示了CodeGenContext.bne方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CatchBreakException
private void CatchBreakException(CodeGenContext context, int result, PERWAPI.CILLabel endLabel)
{
// catch (Exception exception)
int exception = context.StoreInTemp("exception", Runtime.BreakExceptionRef, location);
PERWAPI.CILLabel reThrowLabel = context.NewLabel();
// if (exception.scope != current_frame) goto reThrowLabel;
context.ldloc(0);
context.ldloc(exception);
context.ldfld(Runtime.BreakException.scope);
context.bne( reThrowLabel);
// result = exception.return_value;
context.ldloc(exception);
context.ldfld(Runtime.BreakException.return_value);
context.stloc(result);
// goto endLabel;
context.Goto(endLabel);
// reThrowLabel:
context.CodeLabel(reThrowLabel);
// throw exception;
context.ldloc(exception);
context.throwOp();
context.ReleaseLocal(exception, true);
}
示例2: CatchReturnException
internal void CatchReturnException(CodeGenContext context, PERWAPI.TryBlock tryBlock)
{
// catch (Ruby.ReturnException exception) { ... }
context.StartBlock(Clause.Catch);
{
PERWAPI.CILLabel falseLabel = context.NewLabel();
int exception = context.StoreInTemp("exception", Runtime.ReturnExceptionRef, location);
// if (exception.scope == thisframe)
context.ldloc(exception);
context.ldfld(Runtime.ReturnException.scope);
context.ldloc(0);
context.bne(falseLabel);
// returnTemp = exception.return_value;
context.ldloc(exception);
context.ldfld(Runtime.ReturnException.return_value);
context.stloc(returnTemp);
context.Goto(context.labels.Return);
// falseLabel:
context.CodeLabel(falseLabel);
// throw exception
context.rethrow();
context.ReleaseLocal(exception, true);
}
context.EndCatchBlock(Runtime.ReturnExceptionRef, tryBlock);
}
示例3: CatchRetryException
private void CatchRetryException(CodeGenContext context, PERWAPI.CILLabel retryLabel)
{
// catch (Exception exception)
int exception = context.StoreInTemp("exception", Runtime.RetryExceptionRef, location);
PERWAPI.CILLabel reThrowLabel = context.NewLabel();
// if (exception.scope != current_frame) goto reThrowLabel;
context.ldloc(0);
context.ldloc(exception);
context.ldfld(Runtime.RetryException.scope);
context.bne( reThrowLabel);
// goto retryLabel
context.Goto(retryLabel);
// reThrowLabel:
context.CodeLabel(reThrowLabel);
// throw exception;
context.ldloc(exception);
context.throwOp();
context.ReleaseLocal(exception, true);
}