本文整理汇总了C#中Mosa.Runtime.CompilerFramework.Context.GetOperand方法的典型用法代码示例。如果您正苦于以下问题:C# Context.GetOperand方法的具体用法?C# Context.GetOperand怎么用?C# Context.GetOperand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mosa.Runtime.CompilerFramework.Context
的用法示例。
在下文中一共展示了Context.GetOperand方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignOperandsFromCILStack
/// <summary>
/// Assigns the operands from CIL stack.
/// </summary>
/// <param name="ctx">The context.</param>
/// <param name="currentStack">The current stack.</param>
private void AssignOperandsFromCILStack(Context ctx, Stack<Operand> currentStack)
{
for (int index = ctx.OperandCount - 1; index >= 0; --index)
{
if (ctx.GetOperand(index) != null)
continue;
ctx.SetOperand(index, currentStack.Pop());
}
}
示例2: PopOperands
/// <summary>
/// Pops the operands of an instruction From the evaluation stack.
/// </summary>
/// <param name="ctx">The context.</param>
/// <returns>The number of operands popped.</returns>
private int PopOperands(Context ctx)
{
for (int i = ctx.OperandCount - 1; i > -1; i--)
{
Operand op = ctx.GetOperand (i);
Operand evalOp = evaluationStack.Pop ();
Debug.Assert (ReferenceEquals (evalOp, op), "Operand's are not equal?");
}
return ctx.OperandCount;
}
示例3: AssignOperandsFromCILStack
/// <summary>
/// Assigns the operands from CIL stack.
/// </summary>
/// <param name="ctx">The context.</param>
/// <param name="currentStack">The current stack.</param>
private static void AssignOperandsFromCILStack(Context ctx, IList<Operand> currentStack)
{
for (int index = ctx.OperandCount - 1; index >= 0; --index)
{
if (ctx.GetOperand (index) == null)
{
Operand operand = currentStack[currentStack.Count - 1];
currentStack.RemoveAt (currentStack.Count - 1);
ctx.SetOperand (index, operand);
}
}
}
示例4: ToString
/// <summary>
/// Returns a <see cref="System.String"/> that represents this instance.
/// </summary>
/// <param name="context">The context.</param>
/// <returns>
/// A <see cref="System.String"/> that represents this instance.
/// </returns>
public virtual string ToString(Context context)
{
string s = ToString();
if (context.Other is IR.ConditionCode)
s = s + " [" + GetConditionString(context.ConditionCode) + "]";
string mod = GetModifier(context);
if (mod != null)
s = s + " [" + mod + "]";
if (context.ResultCount == 1)
s = s + " " + context.Result;
else if (context.ResultCount == 2)
s = s + " " + context.Result + ", " + context.Result2;
if (context.ResultCount > 0 && context.OperandCount > 0)
s = s + " <-";
for (int i = 0; (i < 3) && (i < context.OperandCount); i++)
s = s + " " + context.GetOperand(i) + ",";
if (context.OperandCount > 3)
s = s + " [more]";
else
s = s.TrimEnd(',');
if (context.Branch != null) {
for (int i = 0; (i < 2) && (i < context.Branch.Targets.Length); i++)
s = s + String.Format(@" L_{0:X4},", context.Branch.Targets[i]);
if (context.Branch.Targets.Length > 2)
s = s + " [more]";
else
s = s.TrimEnd(',');
}
if (context.InvokeTarget != null)
s = s + " " + context.InvokeTarget.ToString();
if (context.RuntimeField != null)
s = s + " " + context.RuntimeField.ToString();
return s;
}
示例5:
/// <summary>
/// Visitation function for <see cref="ICILVisitor.Calli"/>.
/// </summary>
/// <param name="ctx">The context.</param>
void ICILVisitor.Calli(Context ctx)
{
Operand destinationOperand = ctx.GetOperand(ctx.OperandCount - 1);
ctx.OperandCount -= 1;
this.ProcessInvokeInstruction(ctx, destinationOperand, ctx.Result, new List<Operand>(ctx.Operands));
}
示例6: ProcessInvokeInstruction
/// <summary>
/// Visitation function for Calli instruction.
/// </summary>
/// <param name="context">The context.</param>
void CIL.ICILVisitor.Calli(Context context)
{
Operand destinationOperand = context.GetOperand(context.OperandCount - 1);
context.OperandCount -= 1;
ProcessInvokeInstruction(context, destinationOperand, context.Result, new List<Operand>(context.Operands));
}