Article View: comp.sys.acorn.tech
Article #139Re: New Language/Compiler (ideas wanted)
From: TMOTA
Date: Sun, 16 Aug 1992 21:27
Date: Sun, 16 Aug 1992 21:27
26 lines
2065 bytes
2065 bytes
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 function?), it's ^^^^^^^^^^^^^ Mr. Compiler knows. >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. -- _________________ "I'd like to answer this question in two ways: /____ _ _/_ __ First in my normal voice, and then // / //_//_ /_/ in a silly, high-pitched whine." (Monty Python)
Technical Details
Message-ID:
<1992Aug16.212711.934@cs.aukuni.ac.nz>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!jwil1References:
<1195@grun.is> <1992Aug13.130618.18871@odin.diku.dk> <1992Aug13.205528.15434@cs.aukuni.ac.nz> <KERS.92Aug14085518@cdollin.hpl.hp.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!wupost!waikato.ac.nz!aukuni.ac.nz!cs18.cs.aukuni.ac.nz!jwil1 Newsgroups: comp.sys.acorn.tech Subject: Re: New Language/Compiler (ideas wanted) Message-ID: <1992Aug16.212711.934@cs.aukuni.ac.nz> From: jwil1@cs.aukuni.ac.nz (TMOTA) Date: Sun, 16 Aug 1992 21:27:11 GMT Sender: jwil1@cs.aukuni.ac.nz (TMOTA) References: <1195@grun.is> <1992Aug13.130618.18871@odin.diku.dk> <1992Aug13.205528.15434@cs.aukuni.ac.nz> <KERS.92Aug14085518@cdollin.hpl.hp.com> Organization: Computer Science Dept. University of Auckland Lines: 26