public override int Run(InterpretedFrame frame) { var l = (Int32)frame.Data[frame.StackIndex - 2]; var r = (Int32)frame.Data[frame.StackIndex - 1]; frame.Data[frame.StackIndex - 2] = ScriptingRuntimeHelpers.Int32ToObject(l & r); frame.StackIndex--; return 1; }
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; }
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; }
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; }
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; }
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; }
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; }
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] = (UInt32)unchecked((UInt32)l * (UInt32)r); frame.StackIndex--; return +1; }
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; }
public override int Run(InterpretedFrame frame) { Debug.Assert(_offset != Unknown); if (!(bool)frame.Pop()) { return _offset; } return +1; }
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; }
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; }
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; }
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; }
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; } } } } }
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; }
public override int Run(InterpretedFrame frame) { var v = frame.Data[frame.StackIndex - 1]; frame.Data[frame.StackIndex - 1] = ScriptingRuntimeHelpers.Int32ToObject(unchecked(-(Int32)v)); return 1; }
public override int Run(InterpretedFrame frame) { frame.Data[frame.StackIndex++] = frame.Data[_index]; //frame.Push(frame.Data[_index]); return +1; }
public override int Run(InterpretedFrame frame) { var box = frame.Closure[_index]; frame.Data[frame.StackIndex++] = box.Value; return +1; }
public override int Run(InterpretedFrame frame) { frame.Data[_index] = frame.Data[--frame.StackIndex]; //frame.Data[_index] = frame.Pop(); return(+1); }
public override int Run(InterpretedFrame frame) { frame.Data[_index] = frame.Peek(); return(+1); }
public override int Run(InterpretedFrame frame) { frame.Data[_index] = _defaultValue; return(1); }
public override int Run(InterpretedFrame frame) { frame.Data[_index] = null; return(1); }
public override int Run(InterpretedFrame frame) { return(_compiledLoop(frame.Data, frame.Closure, frame)); }
public override int Run(InterpretedFrame frame) { frame.Push(((UInt16)frame.Pop()) == ((UInt16)frame.Pop())); return(+1); }
public override int Run(InterpretedFrame frame) { // CLR rethrows ThreadAbortException when leaving catch handler if abort is requested on the current thread. Interpreter.AbortThreadIfRequested(frame, _labelIndex); return(GetLabel(frame).Index - frame.InstructionIndex); }
public override int Run(InterpretedFrame frame) { int target; return(_cases.TryGetValue((int)frame.Pop(), out target) ? target : 1); }
public override int Run(InterpretedFrame frame) { // nop (the exception value is pushed by the interpreter in HandleCatch) return(1); }
public override int Run(InterpretedFrame frame) { frame.PushPendingContinuation(); frame.RemoveContinuation(); return(1); }
public override int Run(InterpretedFrame frame) { // Push finally. frame.PushContinuation(_labelIndex); return(1); }
public RuntimeLabel GetLabel(InterpretedFrame frame) { return(frame.Interpreter._labels[_labelIndex]); }
public override int Run(InterpretedFrame frame) { frame.Push(Convert(frame.Pop())); return(+1); }
public override int Run(InterpretedFrame frame) { frame.Data[frame.StackIndex++] = frame.Data[_index]; //frame.Push(frame.Data[_index]); return(+1); }
public abstract int Run(InterpretedFrame frame);
public override int Run(InterpretedFrame frame) { frame.Push(_field.GetValue(frame.Pop())); return(+1); }
public override int Run(InterpretedFrame frame) { frame.Push((bool)frame.Pop() ? ScriptingRuntimeHelpers.False : ScriptingRuntimeHelpers.True); return(+1); }
public override int Run(InterpretedFrame frame) { // unfortunately Type.IsInstanceOfType() is 35-times slower than "is T" so we use generic code: frame.Push(ScriptingRuntimeHelpers.BooleanToObject(frame.Pop() is T)); return(+1); }
internal ThreadLocal<InterpretedFrame>.StorageInfo Enter() { var currentFrame = InterpretedFrame.CurrentFrame.GetStorageInfo(); _parent = currentFrame.Value; currentFrame.Value = this; if (Interpreter._boxedLocals != null) { BoxLocals(); } return currentFrame; }
public override int Run(InterpretedFrame frame) { frame.Push(default(T)); return(+1); }
internal RubyMethodScope(MutableTuple locals, SymbolId[]/*!*/ variableNames, RubyScope/*!*/ parent, RubyModule/*!*/ declaringModule, string/*!*/ definitionName, object selfObject, Proc blockParameter, InterpretedFrame interpretedFrame) { Assert.NotNull(parent, declaringModule, definitionName); // RuntimeFlowControl: _activeFlowControlScope = this; // RubyScope: _parent = parent; _top = parent.Top; _selfObject = selfObject; _methodAttributes = RubyMethodAttributes.PublicInstance; _locals = locals; _variableNames = variableNames; InterpretedFrame = interpretedFrame; // RubyMethodScope: _declaringModule = declaringModule; _definitionName = definitionName; _blockParameter = blockParameter; InitializeRfc(blockParameter); SetDebugName("method " + definitionName + ((blockParameter != null) ? "&" : null)); }
public override int Run(InterpretedFrame frame) { var ret = new IStrongBox[_count]; for (int i = ret.Length - 1; i >= 0; i--) { ret[i] = (IStrongBox)frame.Pop(); } frame.Push(RuntimeVariables.Create(ret)); return +1; }
public override int Run(InterpretedFrame frame) { frame.Push(Convert(frame.Pop())); return +1; }
public override int Run(InterpretedFrame frame) { var box = (StrongBox<object>)frame.Data[_index]; frame.Data[frame.StackIndex++] = box.Value; return +1; }
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] = checked((Int16)((Int16)l * (Int16)r)); frame.StackIndex--; return +1; }
public override int Run(InterpretedFrame frame) { var v = (UInt32)frame.Data[frame.StackIndex - 1]; frame.Data[frame.StackIndex - 1] = checked((UInt32)(-v)); return 1; }
public override int Run(InterpretedFrame frame) { _target(); frame.StackIndex -= 0; return(1); }
public override int Run(InterpretedFrame frame) { var v = (Double)frame.Data[frame.StackIndex - 1]; frame.Data[frame.StackIndex - 1] = (Double)unchecked(-v); return 1; }
public override int Run(InterpretedFrame frame) { Debug.Assert(_offset != Unknown); return(_offset); }
internal RubyBlockScope(MutableTuple locals, SymbolId[]/*!*/ variableNames, BlockParam/*!*/ blockFlowControl, object selfObject, InterpretedFrame interpretedFrame) { var parent = blockFlowControl.Proc.LocalScope; // RuntimeFlowControl: _activeFlowControlScope = parent.FlowControlScope; // RubyScope: _parent = parent; _top = parent.Top; _selfObject = selfObject; _methodAttributes = RubyMethodAttributes.PublicInstance; _locals = locals; _variableNames = variableNames; InterpretedFrame = interpretedFrame; // RubyBlockScope: _blockFlowControl = blockFlowControl; }
public override int Run(InterpretedFrame frame) { frame.Push(((Byte)frame.Pop()) != ((Byte)frame.Pop())); return(+1); }
public override int Run(InterpretedFrame frame) { frame.Data[frame.StackIndex - 0] = _target(); frame.StackIndex -= -1; return(1); }
public override int Run(InterpretedFrame frame) { // nop return(1); }
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] = (Double)l * (Double)r; frame.StackIndex--; return +1; }
public override int Run(InterpretedFrame frame) { frame.Data[_index] = new StrongBox <object>(frame.Data[_index]); return(1); }
public override int Run(InterpretedFrame frame) { frame.Data[frame.StackIndex++] = _value; return(+1); }
public override int Run(InterpretedFrame frame) { frame.Data[_index] = new StrongBox <object>(Activator.CreateInstance(_type)); return(1); }
public override int Run(InterpretedFrame frame) { frame.Data[frame.StackIndex++] = frame.Interpreter._objects[_index]; return(+1); }
public override int Run(InterpretedFrame frame) { frame.Pop(_n); return(+1); }
public override int Run(InterpretedFrame frame) { frame.Push(PythonOps.GetGlobalContext((CodeContext)frame.Pop())); return +1; }
internal static void AbortThreadIfRequested(InterpretedFrame frame, int targetLabelIndex) { // nop }