Implementation and Optimization of exceptions ( static analysis possible? )

"Steven D. Majewski" <sdm7g@elvis.med.virginia.edu>
Fri, 21 Jul 1995 14:07:36 GMT

          From comp.compilers

Related articles
Implementation and Optimization of exceptions ( static analysis possi sdm7g@elvis.med.virginia.edu (Steven D. Majewski) (1995-07-21)
Re: Implementation and Optimization of exceptions ( static analysis p bobduff@world.std.com (1995-07-26)
Re: Implementation and Optimization of exceptions ( static analysis p macrakis@osf.org (1995-07-28)
Re: Implementation and Optimization of exceptions ( static analysis p chase@centerline.com (1995-07-28)
Re: exceptions ( static analysis possible? ) simmons@bnr.ca (steve (s.s.) simmons) (1995-07-31)
Re: exceptions ( static analysis possible? ) bill@amber.ssd.hcsc.com (1995-08-02)
Re: Implementation and Optimization of exceptions ( static analysis p pardo@cs.washington.edu (1995-08-03)
[3 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: "Steven D. Majewski" <sdm7g@elvis.med.virginia.edu>
Keywords: errors, optimize, question
Organization: University of Virginia
Date: Fri, 21 Jul 1995 14:07:36 GMT

    The exception processing model I'm most familiar with ( from long
years on a VAX, and from similar implementations for various
languages ) is the stack based one, where every procedure or
protected block of code has some stack based structure that indicates
how ( and maybe what ) exceptions are handled. ( This is also the
only language independent way I can think of to implement exception
handling - although stack based doesn't have to imply the return
stack - it could mean separate stacks for handlers for various
signals. )


    A continuation model - whether visible in the language (as in
Scheme) or hidden in the implementation is the other common model I
know of. ( Any others? )


    Do any language implementations do static analysis and optimization
of exceptions within a procedure - in effect, translating them into
goto's and avoiding the overhead of handlers ?




    As exceptions are designed to handle dynamic or unpredictable
errors, clearly static analysis cannot always be done, but this
question was inspired by the recent assertion ( again ) in another
newsgroup that 'goto's are unnecessary' - I think they are certainly
*undesirable*, but unnecessary ? - I think Knuth is still the last
word on this. I often use exceptions as a way to break out of an
inner loop - in effect, as a "structured goto". Is this necessarily
less effecient, or are there cases where a compiler could produce the
equivalent code? I would think such cases would be a subset that
would be tractable to static analysis.




( I'ld like to add a special section on exception handling and some
    other more implementation oriented topics to my Programming Language
    Critiques Page at: <http://minsky.med.virginia.edu/sdm7g/LangCrit>,
    so if you've got any good tips, URL-links, or papers, please pass
    then on to me.)




---| Steven D. Majewski (804-982-0831) <sdm7g@Virginia.EDU> |---
---| Computer Systems Engineer University of Virginia |---
---| Department of Molecular Physiology and Biological Physics |---
---| Box 449 Health Science Center Charlottesville,VA 22908 |---
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.