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

  1. Path: sparky!uunet!usc!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!jwil1
  2. Newsgroups: comp.sys.acorn.tech
  3. Subject: Re: New Language/Compiler (ideas wanted)
  4. Message-ID: <1992Aug16.212711.934@cs.aukuni.ac.nz>
  5. From: jwil1@cs.aukuni.ac.nz (TMOTA)
  6. Date: Sun, 16 Aug 1992 21:27:11 GMT
  7. Sender: jwil1@cs.aukuni.ac.nz (TMOTA)
  8. References: <1195@grun.is> <1992Aug13.130618.18871@odin.diku.dk> 
  9.  <1992Aug13.205528.15434@cs.aukuni.ac.nz> <KERS.92Aug14085518@cdollin.hpl.hp.com>
  10. Organization: Computer Science Dept. University of Auckland
  11. Lines: 26
  12.  
  13. kers@hplb.hpl.hp.com (Chris Dollin) writes:
  14. >   And remember that Acorn's C compiler (the ARM proc. call std.?) is clever
  15. >   enough to notice when you call a function that does not call another (a
  16. >   leaf function), and does not bother with most of the context-storing
  17. >   operations involved in normal function calls.
  18.  
  19. >I'm not sure you said what you meant. There's no cleverness involved in calling
  20. >a leaf function (after all, who's to know that it *is* a leaf function?), it's
  21.                  ^^^^^^^^^^^^^ Mr. Compiler knows.
  22.  
  23. >just that leaf functions don't need to carry all the baggage of a full function
  24. >call -- it's the code of the leaf that ``does not bother with most of the
  25. >context-storing operations''. [They don't carry the baggage because there's
  26. >very little that can go wrong inside them, so they don't need to record who
  27. >they are in case something does.]
  28.  
  29. Actually, I thought that they didn't bother stacking anything because the
  30. compiler *knows* they are leaf-functions. Leaf functions being defined as
  31. functions which do not call any other functions; this means that you *know*
  32. the function doesn't call anyone else, so you *know* that you don't need to
  33. bother with stacking stuff that you would otherwise need to restore context
  34. on return from a called function.
  35. -- 
  36. _________________  "I'd like to answer this question in two ways:
  37.   /____ _ _/_ __       First in my normal voice, and then
  38.  // / //_//_ /_/       in a silly, high-pitched whine." (Monty Python)
  39.