On Sun, 10 Aug 2003, Leopold Toetsch wrote: > Piers Cawley <[EMAIL PROTECTED]> wrote: > > Leopold Toetsch <[EMAIL PROTECTED]> writes: > >> As calling conventions clearly state, that the caller has to save > >> everything, its probably up to imcc/pcc.c to insert above > >> statements, if another sub gets called from a sub. I'll fix that in > >> a minute ;-) > > > If and only if that's not a tail call of course. > > Good point. But I can imagine, that's by far more simple to detect tail > calls at the AST level then inside the flattened code parrot sees. So > the HL can emit (a TBD) flag like "tailcall" appended to the .pcc_call > sequence. > Then the call can be optimized to a C<jump> opcode. The construction of > the subroutine object (which is outside of the call sequence) will lead > to an used once LHS, which the optimizer already can get rid of.
Well, if you write it, I'll have pirate inspect the AST and try it out for you. :) Sincerely, Michal J Wallace Sabren Enterprises, Inc. ------------------------------------- contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http://www.withoutane.com/ --------------------------------------