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

            return +1;
        }
Ejemplo n.º 2
0
        public override int Run(StackFrame 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;
        }
Ejemplo n.º 3
0
        private bool HandleCatch(StackFrame frame, Exception exception) {
            UpdateStackTrace(frame);

            Type exceptionType = exception.GetType();
            var handler = GetBestHandler(frame, exceptionType);
            if (handler == null) return false;

            frame.StackIndex = _numberOfLocals;
            if (handler.IsFault) {
                frame.InstructionIndex = handler.JumpToIndex;

                //var savedFrames = ExceptionHelpers.DynamicStackFrames;
                //ExceptionHelpers.DynamicStackFrames = null;

                RunFaultHandlerWithCatch(frame, handler.EndHandlerIndex);
                if (frame.InstructionIndex == handler.EndHandlerIndex) {
                    //ExceptionHelpers.DynamicStackFrames = savedFrames;
                    frame.InstructionIndex -= 1; // push back into the right range

                    return HandleCatch(frame, exception);
                } else {
                    return true;
                }
            } else {
                if (handler.PushException) {
                    frame.Push(exception);
                }
                frame.InstructionIndex = handler.JumpToIndex;
                return true;
            }
        }
 public override int Run(StackFrame frame) {
     if (_isLocal) {
         frame.Push(PythonOps.GetLocal((Scope)frame.Pop(), _name));
     } else {
         frame.Push(PythonOps.GetGlobal((Scope)frame.Pop(), _name));
     }
     return +1;
 }
 public override int Run(StackFrame frame) {
     frame.Push(_global.CurrentValue);
     return +1;
 }