|Implementation of C++ exceptions ? email@example.com (1994-04-05)|
|Re: Implementation of C++ exceptions ? firstname.lastname@example.org (Steve Vinoski) (1994-04-05)|
|Re: Implementation of C++ exceptions ? email@example.com (1994-04-05)|
|Re: Implementation of C++ exceptions ? chase@Think.COM (1994-04-05)|
|Re: Implementation of C++ exceptions ? schmidt@tango.ICS.UCI.EDU (Douglas C. Schmidt) (1994-04-06)|
|Re: Implementation of C++ exceptions ? firstname.lastname@example.org (1994-04-07)|
|Implementation of C++ exceptions ? email@example.com (1994-04-08)|
|Re: Implementation of C++ exceptions ? firstname.lastname@example.org (1994-04-11)|
|Re: Implementation of C++ exceptions ? chase@Think.COM (1994-04-11)|
|Re: Implementation of C++ exceptions ? sean@PICARD.TAMU.EDU (1994-04-12)|
|From:||email@example.com (Steve Simmons)|
|Organization:||CONVEX News Network, Engineering (cnn.eng), Richardson, Tx USA|
|Date:||Fri, 8 Apr 1994 13:14:57 GMT|
> Unfortunately I have not yet had the pleasure of trying SunPro C++ 4.0,
> but in IBM PC C++ compilers as Borland C++ and Watcom exceptions means a
> lot of overhead including calls of init_except_block / exit_except_black
> functions for each C++ function compiled with exceptions enabled etc.
> This clearly does not compute with statements from Bjarne S. and others
> that exceptions should introduce no/very little overhead in a normal
> running program (as long as no exceptions are thrown)!
OK... I am going to take a couple of WAGs. First, exception handlers are
defined to be active over a region of code (like PC=100 to PC=200). When
an exception is raised within that region or code called within that
region, the exception handler must be invoked....
In order to do this, a global runtime exception handler must exist do this
resolution. When an exception is raised, this handler gets called with
the PC of the exception. The runtime exception handler must then see what
regions contain this PC and execute the respective exception handler for
that region. It must also walk the stack backwards and find all of the
return addresses and perform a similar arbitration. That is why you had
the PC-exception handling table as David Chase described. It looks kinda
Address of Exception Handler to execute.
>From what you are saying, it appears that those compilers do not use a PC.
It may be that they define their regions with a runtime call marking the
beginning and the end of the respective region. If this is so, Bjarne
Stroustrop would cringe because this is a very expensive implementation of
exceptions. However, they may be exception handling restrictions within
MS-DOS that force these restrictions like an undefined call frame
definition or an poor OS exception handling mechanism.
The only real bad costs for exception handling is that you cannot do many
global/loop/interprocedural optimizations across the boundary of an
exception region. Usually, that is not a big loss...
Return to the
Search the comp.compilers archives again.