X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=docs%2Fexceptions;h=d5ecaeead43a634984b2701a5c5bd5acaa8ff019;hb=8bd20198baba20aac184b89876a9aedc7445c40e;hp=e98202cf07b228750482d63e7df968d3cd6a4f2f;hpb=b6bb40164b894fc5a3cc6ee2aaa29a8ed925cb59;p=mono.git diff --git a/docs/exceptions b/docs/exceptions index e98202cf07b..d5ecaeead43 100644 --- a/docs/exceptions +++ b/docs/exceptions @@ -1,5 +1,6 @@ -Author: Dietmar Maurer (dietmar@ximian.com) -(C) 2001 Ximian, Inc. + Exception Implementation in the Mono Runtime + Dietmar Maurer (dietmar@ximian.com) + (C) 2001 Ximian, Inc. Exception implementation (jit): =============================== @@ -56,19 +57,20 @@ leave: is simply translated into a branch to the target. If the leave instruction is inside a finally block (but not inside another handler) we call the finally handler before we branch to the target. -finally/endfinally: is translated into subroutine ending with a "return" -statement. The subroutine does not save EBP/ESP, because we need access to the -local variables of the enclosing method. We have to use a "call" -instruction to execute such finally handlers. This makes it possible to -execute them inside the stack unwinding code. +finally/endfinally, filter/endfilter: is translated into subroutine ending with +a "return" statement. The subroutine does not save EBP, because we need access +to the local variables of the enclosing method. Its is possible that +instructions inside those handlers modify the stack pointer, thus we save the +stack pointer at the start of the handler, and restore it at the end. We have +to use a "call" instruction to execute such finally handlers. This makes it +also possible to execute them inside the stack unwinding code. The exception +object for filters is passed in a local variable (cfg->exvar). -throw: we first save all regs into a sigcontext struct (we pass the -exception object in register ECX), and then call the stack unwinding -code. - -catch handler: receives the exception object in ECX. They store that -object into a local variable, so that rethrow can access the object. +throw: we first save all regs into a sigcontext struct and then call the stack +unwinding code. +catch handler: catch hanlders are always called from the stack unwinding +code. The exception object is passed in a local variable (cfg->exvar). gcc support for Exceptions ==========================