At 6:59 PM +0000 2/10/02, Nicholas Clark wrote: >On Sun, Feb 10, 2002 at 12:08:27PM -0500, Dan Sugalski wrote: >> The one downside to having continuations is it makes optimizing away >> variables, even temp ones, a little tough--on switch to any code that >> might create a continuation we need to flush out from registers to a >> holding area, and on return from code we need to reload from the >> holding area. I think we can cope, though. :) > >Or maybe we flush out, and have a flag returned (for internal use only) about >whether this is the first or subsequent time we've returned. And only re-load >registers on the subsequent times. > >But I have this inkling that even if we never use a single continuation, the >housekeeping involved may be greater than the time saved in reloading >registers.
Yeah, that's my feeling too. There are a lot of maybes, but the general case is probably we don't trigger any of them, so it seems imprudent to twiddle with things. The one other advantage to a general flush & return scheme with stack chunk marking is it makes spawning new threads in the same space potentially faster--we can treat a new thread as a sort of continuation and when control flow backs up and goes forward we can fork the stack at that point. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk