当前位置: 首页>>代码示例>>C#>>正文


C# StackFrame.getProgramCounter方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:26,代码来源:ByteCode_if_acmp.cs

示例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));
            }
        }
开发者ID:jdewald,项目名称:toyvm,代码行数:47,代码来源:ByteCode_if.cs

示例3: execute

 public override void execute(StackFrame frame)
 {
     int pc = frame.getProgramCounter();
     frame.pushOperand(pc + size);
     frame.setProgramCounter(pc + branch - size);
 }
开发者ID:jdewald,项目名称:toyvm,代码行数:6,代码来源:ByteCode_jsr.cs

示例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);
 }
开发者ID:jdewald,项目名称:toyvm,代码行数:6,代码来源:ByteCode_goto.cs


注:本文中的StackFrame.getProgramCounter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。