lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Argument Management


From: Sandro Magi
Subject: Re: [Lightning] Argument Management
Date: Wed, 20 Feb 2008 14:52:02 -0500

On Wed, Feb 20, 2008 at 12:19 PM, Paolo Bonzini <address@hidden> wrote:
>
>  > The switch will likely be #ifdef'd, but that's the idea. I don't see
>  > how jit_leaf helps me here. It' sufficient to define:
>
>  If jit_leaf worked, you could have used
>
>    jit_leaf (0);
>
>  instead.

I think I see. You're suggesting that all functions be compiled as
leaf functions, after which I can handle the arguments however I like.

>  >>  Do you have so many function calls?
>
>  ... so many as to make the slowdown from indirect function calls sensible?

All CPS calls suffer the same penalty independent of the number of
functions. There is also additional argument pressure, since every
function now takes an additional continuation parameter. Finally, CPS
has storage disadvantages, as objects with efficient stack-scoped
lifetimes are treated as if they had unrestricted lifetime. From what
I've read, I'd reckon the amortized cost from executing CPS'd code is
on the order of 20%, and memory use is also 20% higher. Concurrency is
dead simple in CPS form though.

CPS is good as an intermediate compiler representation for
control-flow analysis, but not that great in final executable form.

Sandro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]