home *** CD-ROM | disk | FTP | other *** search
- From: kers@hplb.hpl.hp.com (Chris Dollin)
- Date: Mon, 17 Aug 1992 07:08:27 GMT
- Subject: Re: New Language/Compiler (ideas wanted)
- Message-ID: <KERS.92Aug17080827@cdollin.hpl.hp.com>
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- Path: sparky!uunet!wupost!sdd.hp.com!hpscdc!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
- Newsgroups: comp.sys.acorn.tech
- References: <1195@grun.is> <1992Aug13.130618.18871@odin.diku.dk> <1992Aug13.205528.15434@cs.aukuni.ac.nz> <KERS.92Aug14085518@cdollin.hpl.h
- Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
- Lines: 40
- In-Reply-To: jwil1@cs.aukuni.ac.nz's message of Sun, 16 Aug 1992 21:27:11 GMT
- Nntp-Posting-Host: cdollin.hpl.hp.com
-
- In article ... jwil1@cs.aukuni.ac.nz (TMOTA) writes:
-
- kers@hplb.hpl.hp.com (Chris Dollin) writes:
- > And remember that Acorn's C compiler (the ARM proc. call std.?) is clever
- > enough to notice when you call a function that does not call another (a
- > leaf function), and does not bother with most of the context-storing
- > operations involved in normal function calls.
-
- >I'm not sure you said what you meant. There's no cleverness involved in
- >calling a leaf function (after all, who's to know that it *is* a leaf
- ^^^^^^^^^^^^^ Mr. Compiler knows.
- >function?), it's just that leaf functions don't need to carry all the
- > baggage of a full function
- >call -- it's the code of the leaf that ``does not bother with most of the
- >context-storing operations''. [They don't carry the baggage because there's
- >very little that can go wrong inside them, so they don't need to record who
- >they are in case something does.]
-
- Actually, I thought that they didn't bother stacking anything because the
- compiler *knows* they are leaf-functions. Leaf functions being defined as
- functions which do not call any other functions; this means that you *know*
- the function doesn't call anyone else, so you *know* that you don't need to
- bother with stacking stuff that you would otherwise need to restore context
- on return from a called function.
-
- The compiler knows that a function is a leaf function when it *compiles* it,
- not when it compiles a *call* to it (your original remark - at the top - said
- ``is clever enough to notice when you call [note this] a function that does not
- call another'').
-
- That is, what you *said* suggests that the compiler compiles *calls* to leaf
- functions in a special way, and what I think you *meant* is that *leaf
- functions* were compiled in a special way.
-
- Otherwise I think we're in furious agreement.
-
- --
-
- Regards, | "Layered protocols give the software implementor a chance to
- Kers. | ruin his performance in each layer." - Don Gillies
-