Re: The C Stack in interpreters - why?

nmm1@cus.cam.ac.uk (Nick Maclaren)
15 May 2005 17:26:09 -0400

          From comp.compilers

Related articles
[6 earlier articles]
Re: The C Stack in interpreters - why? haberg@math.su.se (2005-05-14)
Re: The C Stack in interpreters - why? nmm1@cus.cam.ac.uk (2005-05-14)
Re: The C Stack in interpreters - why? Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (2005-05-14)
Re: The C Stack in interpreters - why? marcov@stack.nl (Marco van de Voort) (2005-05-14)
Re: The C Stack in interpreters - why? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-05-15)
Re: The C Stack in interpreters - why? gene@abhost.us (Gene Wirchenko) (2005-05-15)
Re: The C Stack in interpreters - why? nmm1@cus.cam.ac.uk (2005-05-15)
Re: The C Stack in interpreters - why? gneuner2@comcast.net (George Neuner) (2005-05-16)
Re: The C Stack in interpreters - why? nmm1@cus.cam.ac.uk (2005-05-16)
Re: The C Stack in interpreters - why? scooter.phd@gmail.com (scooter.phd@gmail.com) (2005-05-18)
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 15 May 2005 17:26:09 -0400
Organization: University of Cambridge, England
References: 05-05-072 05-05-073 05-05-084 05-05-112
Keywords: C, architecture

glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:
>
>> [Are there really systems with a hardware stack that C doesn't use?
>> I've never seen one. -John]
>
>How about ESA/390, with the PC and BAKR instructions?
>
>All the compilers I know of use BALR, BASR, or BASSM, and if
>they didn't they wouldn't be able to call languages that did.
>
>(For those who don't know ESA/390, the standard OS/390 linkage is a
>linked list, logically but not physically a stack.)
>
>[Sheesh. The ESA/390 stack is a hack intended for programs in
>different protection domains to call each other in a way that's
>lighter weight than a full operating system run-program call. All
>normal languages still use BASR or, on zSeries BRAS or BRASL. Having
>squinted at a bunch of on-line manuals, it appears that you can tell
>the C and C++ compilers to do hardware stack calls with a #pragma or
>in C++ extern "OS" { int foo(); }. So there. -John]


We can now have a happy time arguing over what the One True Linkage
(and One True Stack) in that system is. I vote for LINK, but the
moderator will probably rule that I am obsolete and should be put
down.


Few of the Cambridge compilers used standard linkage (this was back in
the BAL/BALR days), on the grounds of unsuitability and cost, though
they almost all used BAL/BALR. I did some testing, and found some
advantages in not even using them (i.e. using LA and BC), as was done
by some specialist assemblers, but never saw a genuine compiler use
that method.


I was working in Santa Teresa at the time the double linkage was
dropped, and argued that it should be left as an option, but didn't
win. It was one of the most useful software engineering techniques
that I know of, because it vastly increased the chances of locating a
bug that had trashed the stack.


Regards,
Nick Maclaren.
[Gee, I always liked ATTACH because then you could have race
conditions. So, speaking of obsolete, let me take a look, on a /30
BALR took 18us, BR took 9, LA took 17, so BALR won there. On a /67,
BALR was 1.2us, BASR was 1.43us, BR 1.1us, LA 0.9us. BALR and BASR
still won. -John]



Post a followup to this message

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