currentHandlerState
and nextHandlerState
cannot both be null.
On exit, if currentHandlerState
is null, handler
handles no exceptions,
and if nextHandlerState
is null, handler
handles all the exceptions in
the initial exception set of currentHandlerState
.
The following conventions apply for each Visit* method:
By default, each Visit* method calls the abstract method
Description:
This is the point where the currently thrown exception leaves the method.
Description:
Branch to target block if condition is true.
Description:
if
Description:
Return the value in var from the method.
Description:
Only appears within handlers. Its semantics is to rethrow the exception that the handler
is currently processing.
Description:
Starts an exception handler and acts as the test whether the handler applies to the caught
exception given the type. If the exception does not apply, then control goes to the handler
of the current block. Otherwise, control goes to the next instruction.
Description:
Semantics: assigns the exception being filtered to the
Description:
tests the code at the end of the filter section of a filter handler. If code is 0, handler
does not apply, and the next handler should be tried. If 1, hander applies and the next instruction
is executed.
In our encoding, if the instruction falls through, it must push the implicit exception being
handled onto the stack, since the next instruction is a catch of the actual handler.
Description:
if type of source is a subtype of
Description:
If type of source is a subtype of T, assign source to dest; otherwise assign
Description:
If boxable (T is a value type or type parameter), boxes the source value int a fresh object and assigns
result to dest. If T is an object type, it acts as a no-op.
Description:
The instruction first checks that source is not null, otherwise throws NullReferenceException. Then it checks
that the boxed value actually contains a value of type T, otherwise InvalidCastException is thrown.
Finally, it copies a pointer of type T& (reference to value type) into dest that points at the box
contents.
Description:
Description
This instruction covers the cases of instance AND static field read instructions. If source is null, the field
is static, otherwise it is an instance field.
In the case where the field is a member of a value type T, then source is of type T& (reference to T).
Description:
This instruction covers the cases of instance AND static field store instructions. If dest is null, the field
is static, otherwise it is an instance field.
In the case where the field is a member of a value type T, then dest is of type T& (reference to T).
Description:
The instruction covers both instance and static fields. For static fields, source is null.
For fields of reference type T, source is of type T& (reference to T).
Description:
Takes the address of the array element indexed and stores it into dest.
MSIL instructions: ldind.T, ldobj
MSIL instructions: stind.T, stobj
Description:
loads the address where a method code starts. This instruction covers both
ldftn and ldvirtftn: for ldvirtftn, the dynamic dispatch algorithm is used to find
the appropriate method.
For static functions, source is null.
Description:
dest is managed or unmanaged pointer to T. If T is a value type, this instruction initializes each field of T
to its default value or zero for primitive types.
If T is an object type, this instruction has the same effect as
Description:
Throws
Description:
Throws
Description:
Starts an exception handler and acts as the test whether the handler applies to the caught
exception given the type. If the exception does not apply, then control goes to the handler
of the current block. Otherwise, control goes to the next instruction.
For pairwise matching, use
The
The
THE UNDERLYING CCI REPRESENTATION IS MUTATED *A LOT* BY THE "FINALLY" BLOCK DUPLICATION AND THE STACK REMOVAL TRANSFORMATION. YOU SHOULD MANUALLY CLONE IT BEFORE CONSTRUCTING THE CFG IF YOU NEED IT; E.G, IF YOU NEED TO WRITE THE CODE BACK TO DISK. CFG IS USED FOR PROGRAM ANALYSIS ONLY, NOT FOR CODE GENERATION.
A Control Flow Graph is basically an oriented graph whose nodes are the basic blocks from the method body; the edges reflect the normal and the exceptional flow of control (the exceptional flow is the flow that occurs when an exception is raised). In addition to the basic blocks of the original method, three more blocks are added:
If you are given a block and want to know if it's the [normal/excp] exit of its method, all you have to do is use the appropriate "is" test (e.g. "block is CFG.NormalExitBlock"). If you have the CFG, and want to know its [normal/excp] exit, you just have to query the appropriate method.
NOTE: If an analysis is interested in the result for the normal flow, then it can retrieve the result of the dataflow equations for the normal exit point. Similarly, if an analysis is interested in the result for the exceptional flow, then it can retrieve the result of the dataflow equations for the exceptional exit point. Finally, if the distinction between normal/exceptional flow is not important, the "unified" exit point can be used instead.
Returns the list of "leave" instructions whose processing created a specific block.
Returns an empty