Re: Using memory above TOS

jeremy@floyd.sw.oz.au (Jeremy Fitzhardinge)
21 May 1996 16:21:37 -0400

          From comp.compilers

Related articles
Re: Using memory above TOS bart@time.cirl.uoregon.edu (1996-05-19)
Using memory above TOS fjh@cs.mu.OZ.AU (Fergus Henderson) (1996-05-21)
Re: Using memory above TOS jeremy@floyd.sw.oz.au (1996-05-21)
SPARC register windows (was: Re: Using memory above TOS) Peter.Damron@Eng.Sun.COM (1996-05-24)
Re: Using memory above TOS markt@harlequin.co.uk (1996-05-29)
Re: Using memory above TOS markt@harlequin.co.uk (1996-05-29)
| List of all articles for this month |
From: jeremy@floyd.sw.oz.au (Jeremy Fitzhardinge)
Newsgroups: comp.compilers
Date: 21 May 1996 16:21:37 -0400
Organization: Softway Pty Ltd
References: 96-05-132
Keywords: architecture

bart@time.cirl.uoregon.edu (Barton C. Massey) writes:
>For a language like Mercury, in which there's an explicit
>runtime system and signal handlers are not directly implemented
>by the user, optimizations which use memory above TOS may be
>acceptable.


Trying to use memory below the stack on a SPARC completely
fails, because the stack is generally not used directly, but
kept cached in register windows. The kernel takes the liberty
of not saving register windows "below" the SP on context
switches. In other words, you can't really defer the
use of a "save" instruction if you need to store things
on the stack.


>P.S. -- Actually, now that I think about it, the main reason I
>avoided memory above TOS is that I wasn't sure that UNIX
>promised to keep pages above TOS backed up in VM;


More seriously, it might not exist at all. Unicies generally
allocate stack for your process automatically on stack growth,
but define "stack growth" as a memory access between the last
stack position and the current SP. If you generate a fault
just below the SP, you get a SIGSEGV.
--


Post a followup to this message

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