本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: Run
public override int Run(InterpretedFrame frame) {
Debug.Assert(_offset != Unknown);
if (!(bool)frame.Pop()) {
return _offset;
}
return +1;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
}
示例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;
}
示例15: Run
public override int Run(InterpretedFrame frame) {
frame.Push(Convert(frame.Pop()));
return +1;
}