本文整理汇总了C#中CodeGenContext.newStartPoint方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGenContext.newStartPoint方法的具体用法?C# CodeGenContext.newStartPoint怎么用?C# CodeGenContext.newStartPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGenContext
的用法示例。
在下文中一共展示了CodeGenContext.newStartPoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenCode0
internal override void GenCode0(CodeGenContext context)
{
PERWAPI.CILLabel elseLabel = context.NewLabel();
PERWAPI.CILLabel endLabel = context.NewLabel();
// if (Eval.Test(cond))
context.newLine(cond.location);
cond.GenCode(context);
context.call(Runtime.Eval.Test);
context.brfalse(elseLabel);
if (body != null)
{
context.newStartPoint(body.location);
body.GenCode(context);
}
else
context.ldnull();
if (context.Reachable())
context.br(endLabel);
context.CodeLabel(elseLabel);
if (_else != null)
{
context.newStartPoint(_else.location);
_else.GenCode(context);
}
else
context.ldnull();
context.CodeLabel(endLabel);
context.newEndPoint(location);
}
示例2: GenCode0
internal override void GenCode0(CodeGenContext context)
{
int receiverLocal = 0;
// singleton_class(caller, receiver).define_method(...);
context.newStartPoint(location);
if (!(receiver is AST.CALL))
{
context.ldloc(0);
receiver.GenCode(context);
}
else
{
receiver.GenCode(context);
receiverLocal = context.CreateLocal("receiverLocal", PrimitiveType.Object);
context.stloc(receiverLocal);
context.ldloc(0);
context.ldloc(receiverLocal);
}
context.call(Runtime.Class.singleton_class);
DefineMethod(context);
if (receiver is AST.CALL)
context.ReleaseLocal(receiverLocal, true);
}
示例3: GenCode
internal void GenCode(CodeGenContext context, PERWAPI.CILLabel endLabel)
{
PERWAPI.CILLabel elseLabel = context.NewLabel();
context.newLine(comparison.location);
// if (comparision.ToRubyArray().includes(true, caller))
bool created;
ISimple list = comparison.GenArgList(context, out created);
list.GenSimple(context);
context.ReleaseLocal(list, created);
context.callvirt(Runtime.ArgList.ToRubyArray);
new TRUE(comparison.location).GenCode(context);
context.ldloc(0);
context.callvirt(Runtime.Array.includes);
context.brfalse(elseLabel);
if (body != null)
{
context.newStartPoint(body.location);
body.GenCode(context);
}
else
context.ldnull();
context.br(endLabel);
context.CodeLabel(elseLabel);
}