Microsoft.Scripting.Interpreter.InterpretedFrame.YieldToPendingContinuation C# (CSharp) Méthode

YieldToPendingContinuation() public méthode

public YieldToPendingContinuation ( ) : int
Résultat int
        public int YieldToPendingContinuation() {
            Debug.Assert(_pendingContinuation >= 0);

            RuntimeLabel pendingTarget = Interpreter._labels[_pendingContinuation];

            // the current continuation might have higher priority (continuationIndex is the depth of the current continuation):
            if (pendingTarget.ContinuationStackDepth < _continuationIndex) {
                RuntimeLabel currentTarget = Interpreter._labels[_continuations[_continuationIndex - 1]];
                SetStackDepth(currentTarget.StackDepth);
                return currentTarget.Index - InstructionIndex;
            }

            SetStackDepth(pendingTarget.StackDepth);
            if (_pendingValue != Interpreter.NoValue) {
                Data[StackIndex - 1] = _pendingValue;
            }
            return pendingTarget.Index - InstructionIndex;
        }

Usage Example

Exemple #1
0
        public override int Run(InterpretedFrame frame)
        {
            frame.PopPendingContinuation();

            // jump to goto target or to the next finally:
            return(frame.YieldToPendingContinuation());
        }
All Usage Examples Of Microsoft.Scripting.Interpreter.InterpretedFrame::YieldToPendingContinuation