[TUHS] Early Unix function calls: expensive?
Tony Finch
dot at dotat.at
Mon Jan 4 21:35:44 AEST 2016
scj at yaccman.com <scj at yaccman.com> wrote:
>
> As part of the PCC work, I wrote a technical report on how to design a C
> calling sequence, but that was before the VAX. Early calling sequences
> had both a stack pointer and a frame pointer, but for most machines it
> was possible to get by with just one, so calling sequences got better as
> time went on. Also, RISC machines with many more registers than the
> PDP-11 also led to more efficient calls by putting some arguments in
> registers. Later standardizations like varargs were painful on some
> architectures (especially those which had different registers for pointers
> and integers).
I had a look for your technical report online but my searches failed me.
Do you have a link to a copy?
Doesn't alloca() get interesting if you have a stack pointer but no frame
pointer? :-)
http://minnie.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/src/libc/sys/alloca.s
Nowadays it's usually implemented as a builtin, and given that the
compiler ought to be able to cope in most cases, but if you alloca() a
variable amount things soon get too difficult...
Tony.
--
f.anthony.n.finch <dot at dotat.at> http://dotat.at/
Northeast Viking, North Utsire: Southeasterly 5 to 7, occasionally gale 8 in
south. Rough or very rough, occasionally moderate later. Fair. Good.
More information about the TUHS
mailing list