From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac55ec18f7b0a53c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-08 16:56:27 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!newsfeed.fast.net!uunet!dca.uu.net!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: Ada and embedded applications Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Fri, 8 Jun 2001 23:55:36 GMT References: <3b1c8cb0$1@pull.gecm.com> <3B1CEBA2.E868929D@brighton.ac.uk> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: archiver1.google.com comp.lang.ada:8467 Date: 2001-06-08T23:55:36+00:00 List-Id: 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. - Bob