"Robert A Duff" wrote in message news:wccvgm6bk7b.fsf@world.std.com... > John English writes: > > > Hmm, the "obvious" way to handle exceptions involves one extra word > > in the stack frame (a pointer to the start of the exception handling > > code) which costs (typically) 4 bytes per handled block and 1 extra > > word to pop on exit, which may or may not cost nothing, but is certainly > > pretty cheap. > > But the more desirable implementation is to save the small cost of > setting that pointer, and spend perhaps 10,000 instructions searching a > table of code addresses when an exception is raised. If exceptions > being raised are rare, but blocks protected by exception handlers are > more common, that's a win. > > > Does anyone have any references to alternative ways of implementing > > exception handling? > > One variant of the code-table technique was decribed in the Ada 83 > rationale. The implementation you described above is essentially > equivalent to the VAX/VMS standard method. I don't have other > references at hand, but surely a lot of this stuff is common lore, and > documented somewhere. T. P. Baker and G. A. Riccardi, �Implementing Ada Exceptions,� IEEE Software, vol. 3, no. 5, pp. 42-51, 1986.