Implement basic support for managed exception handling.
authorSergiy Kuryata <sergeyk@microsoft.com>
Fri, 27 Feb 2015 19:50:16 +0000 (11:50 -0800)
committerSergiy Kuryata <sergeyk@microsoft.com>
Fri, 27 Feb 2015 19:56:27 +0000 (11:56 -0800)
commitec08192bfea5fb25dd60c9fdfd813951ab865ebf
treed3d8a75b91ae861880982b51042f2c38373f8e61
parent63976a08fbe6ece34a2936ebccdf735ea32044a2
Implement basic support for managed exception handling.

Implementation of the managed exception handling in this change is by far not yet complete but it is a good starting point that we can build on top of it. Basically this code allows managed exceptions to be thrown and caught. The finally blocks and nested try/catch works too. But re-throwing an exception from a catch block and many other corner cases do not work yet.

In addition, RtlRestoreContext needs to be properly implemented. This change introduces a very simply implementation that works only in those cases where XMM registers are not used in the code that handles the exception so they don’t need to be restored. I have created a separate issue to track it (https://github.com/dotnet/coreclr/issues/360).

This change also fixes an issue in JIT where JIT was incorrectly passing arguments in the RCX and RDX registers to the finally and catch funclets.
src/jit/codegencommon.cpp
src/jit/codegenxarch.cpp
src/jit/target.h
src/pal/src/arch/i386/context.cpp
src/pal/src/debug/debug.cpp
src/vm/exceptionhandling.cpp
src/vm/exceptmacros.h
src/vm/stackwalk.cpp