C# Класс Microsoft.Scripting.Interpreter.GotoInstruction

This instruction implements a goto expression that can jump out of any expression. It pops values (arguments) from the evaluation stack that the expression tree nodes in between the goto expression and the target label node pushed and not consumed yet. A goto expression can jump into a node that evaluates arguments only if it carries a value and jumps right after the first argument (the carried value will be used as the first argument). Goto can jump into an arbitrary child of a BlockExpression since the block doesn’t accumulate values on evaluation stack as its child expressions are being evaluated. Goto needs to execute any finally blocks on the way to the target label. { f(1, 2, try { g(3, 4, try { goto L } finally { ... }, 6) } finally { ... }, 7, 8) L: ... } The goto expression here jumps to label L while having 4 items on evaluation stack (1, 2, 3 and 4). The jump needs to execute both finally blocks, the first one on stack level 4 the second one on stack level 2. So, it needs to jump the first finally block, pop 2 items from the stack, run second finally block and pop another 2 items from the stack and set instruction pointer to label L. Goto also needs to rethrow ThreadAbortException iff it jumps out of a catch handler and the current thread is in "abort requested" state.
Наследование: IndexedBranchInstruction
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Run ( InterpretedFrame frame ) : int

Приватные методы

Метод Описание
Create ( int labelIndex, bool hasResult, bool hasValue ) : GotoInstruction
GotoInstruction ( int targetIndex, bool hasResult, bool hasValue ) : System.Linq.Expressions

Описание методов

Run() публичный Метод

public Run ( InterpretedFrame frame ) : int
frame InterpretedFrame
Результат int