本文整理汇总了C#中StackFrame.getProgramCounter方法的典型用法代码示例。如果您正苦于以下问题:C# StackFrame.getProgramCounter方法的具体用法?C# StackFrame.getProgramCounter怎么用?C# StackFrame.getProgramCounter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackFrame
的用法示例。
在下文中一共展示了StackFrame.getProgramCounter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: execute
public override void execute(StackFrame frame)
{
Object val2 = frame.popOperand();
Object val1 = frame.popOperand();
//Heap.HeapReference val2 = (Heap.HeapReference) frame.popOperand();
//Heap.HeapReference val1 = (Heap.HeapReference) frame.popOperand();
bool eval = false;
switch (opval){
case OP_EQ:{
eval = (val1 == val2);
break;
}
case OP_NE:{
eval = (val1 != val2);
break;
}
default: throw new ToyVMException("Not handling " + opval,frame);
}
if (eval){
int pc = frame.getProgramCounter();
frame.setProgramCounter(pc + branch - size);
}
}
示例2: execute
public override void execute(StackFrame frame)
{
Object oper = frame.popOperand();
if (log.IsDebugEnabled) log.DebugFormat("Oper is {0}",oper);
int pc = frame.getProgramCounter();
bool eval = false;
switch (opval){
case OP_NULL:{
eval = (oper is NullValue);
break;
}
case OP_GE:{
eval = ((int) oper >= 0);
break;
}
case OP_G: {
eval = ((int) oper > 0);
break;
}
case OP_NE: {
eval = ((int) oper != 0);
break;
}
case OP_NOTNULL: {
eval = ! (oper is NullValue);
break;
}
case OP_EQUALS: {
eval = ((int)oper == 0);
break;
}
case OP_LT: {
eval = ((int) oper == -1);
break;
}
case OP_LE: {
eval = ((int) oper <= 0);
break;
}
default:throw new ToyVMException("Don't know how to handle",frame);
}
if (eval){
frame.setProgramCounter(pc + branch - size);
if (log.IsDebugEnabled) log.DebugFormat("Jumping to " + (frame.getProgramCounter() + size));
}
}
示例3: execute
public override void execute(StackFrame frame)
{
int pc = frame.getProgramCounter();
frame.pushOperand(pc + size);
frame.setProgramCounter(pc + branch - size);
}
示例4: execute
public override void execute(StackFrame frame)
{
int pc = frame.getProgramCounter();
frame.setProgramCounter(pc + branch - size);
if (log.IsDebugEnabled) log.DebugFormat("Going to {0}",frame.getProgramCounter() + size);
}