當前位置: 首頁>>代碼示例>>C#>>正文


C# Interpreter.InterpretedFrame類代碼示例

本文整理匯總了C#中Microsoft.Scripting.Interpreter.InterpretedFrame的典型用法代碼示例。如果您正苦於以下問題:C# InterpretedFrame類的具體用法?C# InterpretedFrame怎麽用?C# InterpretedFrame使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InterpretedFrame類屬於Microsoft.Scripting.Interpreter命名空間,在下文中一共展示了InterpretedFrame類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Run

 public override int Run(InterpretedFrame frame) {
     object l = frame.Data[frame.StackIndex - 2];
     object r = frame.Data[frame.StackIndex - 1];
     frame.Data[frame.StackIndex - 2] = ScriptingRuntimeHelpers.Int32ToObject(unchecked((Int32)l * (Int32)r));
     frame.StackIndex--;
     return +1;
 }
開發者ID:knocte,項目名稱:mono,代碼行數:7,代碼來源:MulInstruction.cs

示例2: Run

 public override int Run(InterpretedFrame frame) {
     object l = frame.Data[frame.StackIndex - 2];
     object r = frame.Data[frame.StackIndex - 1];
     frame.Data[frame.StackIndex - 2] = (Int64)((Int64)l / (Int64)r);
     frame.StackIndex--;
     return 1;
 }
開發者ID:nlhepler,項目名稱:mono,代碼行數:7,代碼來源:DivInstruction.cs

示例3: Run

 public override int Run(InterpretedFrame frame) {
     var l = (UInt32)frame.Data[frame.StackIndex - 2];
     var r = (UInt32)frame.Data[frame.StackIndex - 1];
     frame.Data[frame.StackIndex - 2] = (UInt32)(l & r);
     frame.StackIndex--;
     return 1;
 }
開發者ID:knocte,項目名稱:mono,代碼行數:7,代碼來源:AndInstruction.cs

示例4: Run

 public override int Run(InterpretedFrame frame) {
     var l = frame.Data[frame.StackIndex - 2];
     var r = frame.Data[frame.StackIndex - 1];
     frame.Data[frame.StackIndex - 2] = (UInt16)((UInt16)l | (UInt16)r);
     frame.StackIndex--;
     return 1;
 }
開發者ID:knocte,項目名稱:mono,代碼行數:7,代碼來源:OrInstruction.cs

示例5: Run

 public override int Run(InterpretedFrame frame) {
     object l = frame.Data[frame.StackIndex - 2];
     object r = frame.Data[frame.StackIndex - 1];
     frame.Data[frame.StackIndex - 2] = (Int32)((UInt16)l >> (Int32)r);
     frame.StackIndex--;
     return 1;
 }
開發者ID:knocte,項目名稱:mono,代碼行數:7,代碼來源:ShrInstruction.cs

示例6: Run

 public override int Run(InterpretedFrame frame) {
     object l = frame.Data[frame.StackIndex - 2];
     object r = frame.Data[frame.StackIndex - 1];
     frame.Data[frame.StackIndex - 2] = Calculate (l, r);
     frame.StackIndex--;
     return +1;
 }
開發者ID:pmq20,項目名稱:mono_forked,代碼行數:7,代碼來源:AritmeticInstruction.cs

示例7: Run

        public override int Run(InterpretedFrame frame) {
            int first = frame.StackIndex - _argumentCount;
            object ret = _site.Target(_site, new ArgumentArray(frame.Data, first, _argumentCount));
            frame.Data[first] = ret;
            frame.StackIndex = first + 1;

            return 1;
        }
開發者ID:rudimk,項目名稱:dlr-dotnet,代碼行數:8,代碼來源:DynamicSplatInstruction.cs

示例8: Run

        public override int Run(InterpretedFrame frame) {
            Debug.Assert(_offset != Unknown);

            if (!(bool)frame.Pop()) {
                return _offset;
            }

            return +1;
        }
開發者ID:nlhepler,項目名稱:mono,代碼行數:9,代碼來源:ControlFlowInstructions.cs

示例9: Run

        public override int Run(InterpretedFrame frame) {
            DebugInfo info = DebugInfo.GetMatchingDebugInfo(_debugInfos, frame.FaultingInstruction);
            if (info != null && !info.IsClear) {
                frame.Push(info.StartLine);
            }else{
                frame.Push(-1);
            }

            return +1;
        }
開發者ID:BenHall,項目名稱:ironruby,代碼行數:10,代碼來源:LastFaultingLineExpression.cs

示例10: Run

            public override int Run(InterpretedFrame frame) {
                object l = frame.Data[frame.StackIndex - 2];
                object r = frame.Data[frame.StackIndex - 1];
                if (l == null || r == null)
                    frame.Data[frame.StackIndex - 2] = LiftedToNull ? (object) null : (object) false;
                else
                    frame.Data[frame.StackIndex - 2] = (Char)l < (Char)r;

                frame.StackIndex--;
                return +1;
            }
開發者ID:knocte,項目名稱:mono,代碼行數:11,代碼來源:LessThanInstruction.cs

示例11: Run

        public override int Run(InterpretedFrame frame) {
            var targetDelegate = _targetField.GetValue(_site);

            object[] args = new object[_argCount];
            
            for (int i = _argCount - 1; i >= 1; i--) {
                args[i] = frame.Pop();
            }
            args[0] = _site;

            object ret = _target.InvokeInstance(targetDelegate, args);
            if (!_isVoid) frame.Push(ret);
            return +1;
        }
開發者ID:andreakn,項目名稱:ironruby,代碼行數:14,代碼來源:DynamicInstructions.cs

示例12: Run

        public override int Run(InterpretedFrame frame) {
            int first = frame.StackIndex - _argumentCount;
            object[] args = new object[1 + _argumentCount];
            args[0] = _site;
            for (int i = 0; i < _argumentCount; i++) {
                args[1 + i] = frame.Data[first + i];
            }

            object ret = _target.InvokeInstance(_targetDelegate, args);
            if (_isVoid) {
                frame.StackIndex = first;
            } else {
                frame.Data[first] = ret;
                frame.StackIndex = first + 1;
            }

            return 1;
        }
開發者ID:jschementi,項目名稱:iron,代碼行數:18,代碼來源:DynamicInstructionN.cs

示例13: Run

        public void Run(InterpretedFrame frame) {
            if (_onlyFaultHandlers) {
                bool fault = true;
                try {
                    RunInstructions(frame);
                    fault = false;
                    return;
                } finally {
                    if (fault) {
                        frame.FaultingInstruction = frame.InstructionIndex;
                        HandleFault(frame);
                    }
                }
            } else {
                while (true) {
                    try {
                        RunInstructions(frame);
                        return;
                    } catch (Exception exc) {
                        frame.FaultingInstruction = frame.InstructionIndex;
                        ExceptionHandler handler = HandleCatch(frame, exc);

                        if (handler == null) {
                            throw;
                        }

                        // stay in the current catch so that ThreadAbortException is not rethrown by CLR:
                        var abort = exc as ThreadAbortException;
                        if (abort != null) {
                            _anyAbortException = abort;
                            frame.CurrentAbortHandler = handler;
                            Run(frame);
                            return;
                        } 
                    }
                }
            }
        }
開發者ID:mstram,項目名稱:ironruby,代碼行數:38,代碼來源:Interpreter.cs

示例14: CreateBacktrace

        private RubyArray CreateBacktrace(RubyContext/*!*/ context, InterpretedFrame handlerFrame, StackTrace catchSiteTrace) {
            Assert.NotNull(context);

            bool hasFileAccessPermissions = DetectFileAccessPermissions();

            var result = new RubyArray();
            
            // Compiled trace: contains frames starting with the throw site up to the first filter/catch that the exception was caught by:
            StackTrace throwSiteTrace = DebugInfoAvailable ? new StackTrace(_exception, true) : new StackTrace(_exception);

            var interpretedFrame = handlerFrame ?? CurrentInterpretedFrame.Value;
            AddBacktrace(result, throwSiteTrace.GetFrames(), ref interpretedFrame, handlerFrame, hasFileAccessPermissions, 0, context.Options.ExceptionDetail);

            // Compiled trace: contains frames above and including the first Ruby filter/catch site that the exception was caught by:
            if (catchSiteTrace != null) {
                // skip one frame - the catch-site frame is already included
                AddBacktrace(result, catchSiteTrace.GetFrames(), ref interpretedFrame, handlerFrame, hasFileAccessPermissions,
                    handlerFrame != null ? 0 : 1, false
                );
            }

            return result;            
        }
開發者ID:bclubb,項目名稱:ironruby,代碼行數:23,代碼來源:RubyExceptionData.cs

示例15: Run

 public override int Run(InterpretedFrame frame) {
     frame.Push(Convert(frame.Pop()));
     return +1;
 }
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:4,代碼來源:NumericConvertInstruction.cs


注:本文中的Microsoft.Scripting.Interpreter.InterpretedFrame類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。