This list is for discussion of the design and implementation of field-programmable gate array based processors and integrated systems. It is also for discussion and community support of the XSOC Project (see http://www.fpgacpu.org/xsoc).
|
Can anyone give me a good reference (URL) to information on hardware support for exception handling as used in a language like Java or C++. Thanks, Rob |
|
|
|
What an interesting concept. I have not seen anything on hardware support for expection handling in C++ but I am sure someone on this list will know. I have never even though about doing it in hardware but I would imagine it would need a register per level (if you want to support nesting) that holds a stack address to mark the TRY. Quite what you would do for CATCH I am not sure. Looking forward to hearing about this one. -- Veronica Merryfield, somewhere in Cambridgeshire, UK "The best things in life aren't things" www.sheyagreyhoundrescue.com www.dunrunnin.co.uk ----- Original Message ----- From: "Rob Finch" <> To: <> Sent: Tuesday, March 11, 2003 12:32 AM Subject: [fpga-cpu] Hardware for exception handling > Can anyone give me a good reference (URL) to information on hardware > support for exception handling as used in a language like Java or C++. > > Thanks, > Rob > > To post a message, send it to: > To unsubscribe, send a blank message to: |
|
|
|
On Tue, 11 Mar 2003 16:22:55 -0000, you wrote: >What an interesting concept. I have not seen anything on hardware support >for expection handling in C++ but I am sure someone on this list will know. >I have never even though about doing it in hardware but I would imagine it >would need a register per level (if you want to support nesting) that holds >a stack address to mark the TRY. Quite what you would do for CATCH I am not >sure. > >Looking forward to hearing about this one. I'm not sure how helpful these two references might be (they are both circa 1995/1996, and may not cover exception handling as well as anyone might like.) But they *do* cover some of the details needed for understanding exception handling in C++: "Inside the Object Model: The Sensible Use of C+" by David M. Papurt "Inside the C++ Object Model" by Stanley B. Lippman I've read the second one, thoroughly, and have had email conversations with the author. I don't even have the first one of those two, so I cannot be certain about it -- yet, the description appears right. Anyway, that's my suggestion for Rob. Jon |
|
|
|
> >Looking forward to hearing about this one.
> "Inside the Object Model: The Sensible Use of C+" > by David M. Papurt > > "Inside the C++ Object Model" > by Stanley B. Lippman Do these books give details of how exception handling is implemented from the compiler writer's point of veiw ? Rob |
|
|
|
On Thu, 13 Mar 2003 03:28:23 -0000, you wrote: >> >Looking forward to hearing about this one. >> >> "Inside the Object Model: The Sensible Use of C+" >> by David M. Papurt >> >> "Inside the C++ Object Model" >> by Stanley B. Lippman > >Do these books give details of how exception handling is implemented >from the compiler writer's point of veiw ? I've got the second one and it does, but not well. That was the reason, in fact, that I started writing to Lippman. He told me then that he was working on a newer version which will include that information in more detail, but it doesn't appear to be out there, as yet. But maybe I screwed up looking, so double check me on that point. Anyway, it does provide a great deal of information overall and much of that information informs you about limitations circumscribing how exceptions *must* be handled in C++. Also, he does talk about it, as well. I'm just not willing to call it satisfactory. I haven't read Papurt's book, nor do I have it. It was written before Lippman's, but the book description specifically says that it addresses exception handling, so perhaps it will be good in that respect. If you find out that it is, I'll be buying the book. ;) Jon |
|
|
|
You might find this article interesting -- C++: Under the Hood: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvc/ html/jangrayhood.asp. This article is also near the mark: http://groups.google.com/groups?selm=hM2R2.2498%24b73.139198%40paloalto- snr1 and this one on Win32 Structured Exception Handling by Matt Pietrek is instructive. (You've got to admire an article with a section heading "Into the Inferno"): http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/exception/e xception.htm For C++, efficient implementation of exception handling is fiendishly complex. I doubt a hardware approach is helpful, beyond management of stack frame linkages (which might include exception frame linkages). An implementation must do sufficient bookkeeping (lots) such that whenever and wherever a software exception is thrown it can walk up n stack frames to: 1. determine which try block will handle the exception, a matter of scanning the stack frame's nested try blocks in order, attempting to match (under C++'s baroque type conversion rules) the thrown object type with each successive catch clause type; and 2. during stack unwind (across the intervening function's stack frames), determine which extant objects with destructors must be destroyed. This is typically accomplished by consulting read-only tables that map instruction pointer ranges to a table of objects to destroy, or else by having a per-function local state variable that is updated as each object is constructed/destructed. Jan Gray, Gray Research LLC (Not speaking for anyone else) |