Related articles |
---|
setjmp/longjmp implementations hbaker@netcom.com (1994-02-16) |
Re: Summary of setjmp/longjmp responses pardo@cs.washington.edu (1994-02-18) |
Re: Summary of setjmp/longjmp responses [SPARC] markt@harlequin.co.uk (1994-02-22) |
Newsgroups: | comp.compilers |
From: | markt@harlequin.co.uk (Mark Tillotson) |
Keywords: | C, sparc, performance |
Organization: | Harlequin Limited, Cambridge, England |
References: | 94-02-097 94-02-134 |
Date: | Tue, 22 Feb 1994 13:18:03 GMT |
pardo@cs.washington.edu (David Keppel) wrote:
> The third `longjmp' implementation choice is to use both of the above
> techniques: during a `longjmp', iterate through, say, 3 stack frames (the
> right number depends on the processor implemtnation, on how the OS spills
> and restores on window overflow and underflow traps, and on the
> application's calll/return behavior) and if after 3 frames you still
> haven't gotten to the desired frame, then trap and flush the register
> windows. You can arrange that this is always a win for n=1 (you can
> actually examine your caller's sp without trapping) but may be a loss for
> n>1.
You could use the amount of stack between the jumping and target
frames to decide which strategy to adopt---a rough heuristic but one
that should work well for long long jumps, assuming that the OS does a
good job of flush_windows. If there is a wide variety in stack frame
sizes it won't be too smart, of course.
--
M. Tillotson Harlequin Ltd.
markt@uk.co.harlqn Barrington Hall,
44 223 872522 Barrington, Cambridge CB2 5RG
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.