home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / acorn / tech / 53 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  2.7 KB

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