This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Implementation of exceptions
- From: Halldór Ísak Gylfasson <halldorisak at ru dot is>
- To: <gcc at gcc dot gnu dot org>
- Date: Mon, 17 Jan 2005 12:25:43 -0000
- Subject: Implementation of exceptions
Hello
A while ago, I implemented a complete C++ runtime support for the Linux kernel, which essentially involved porting the gcc C++ ABI implementation to the kernel. As part of that work I measured the implementation of exceptions, and performed several optimizations to that implementation which reduced the cost of throwing an exception considerably. Information on this can all be accessed on http://netlab.ru.is/exception/LinuxCXX.shtml .
I am interested in contributing these optimizations to the gcc source (of course provided you guys are interested in receiving them!). There are, however, number of issues that arise which would require correspondence with the implementors/maintainers of the ABI. This concerns the fact that the gcc implementation is platform/language specific, while what I was doing was specific to C/C++, that is I was only supporting C++ in the linux kernel, but not ADA, etc.
As an example, one of the things I did was to always unwind the stack in one phase, since debugging in the kernel is anyway difficult. In user space this should in my opinion be configurable (by setting a switch, or something). The problem however is that we are dealing with the ABI library, but not generated code, so the ABI library would have to "know" if a special switch was used during the compilation. One possible implementation would be to set some "hidden variable", and let the ABI test for this variable to see whether to use the one-phase or two-phase unwinding. Unfortunately, this requires changing the language specific function (personality function) -- I only changed the C++ one, but would require assistance with changing the functions for the other languages.
Best Regards
Halldor Isak Gylfason