> At 4:28 PM -0600 6/12/03, Luke Palmer wrote:
> >  > Okay, at the moment I'm working on getting an implementation of
> >>  classes and objects working. I'm also taking a look at calling speed,
> >>  as I'd really like to not suck with our call times. :)
> >>
> >>  First off, the core stuff looks good. I'd not really looked at it
> >>  until now, but now that I have, well... good job folks. I put in a
> >>  minor tweak that may or may not speed things up (basically checking
> >>  for the COW flag on stack chunks and bailing on the walk up if
> >>  they're already marked) depending on what's resident in the L1/L2
> >>  cache. We'll see.
> >>
> >>  Second, I see that the registers themselves are in the context
> >>  structure. I think this may be a good part of our speed problem with
> >>  taking continuations. Now, continuations should *not* restore the
> >>  registers, so this strikes me as an incorrect thing to do, but before
> >>  I twiddle the context structure some and remove them, I want to check
> >>  and make sure that there's not a good reason to have them in.
> >
> >Well, aren't the registers really part of the context?
> 
> Nope. If they were, there would be no way to return data from a 
> function. The return values go in the registers, remember, and we 
> return to the caller by invoking the continuation it passed into us.

But they really are, honest.  We just don't restore all of the
context, so we can get back return values.

When something calls a sub, and does a C<saveall> before it, it's
saving its context so it can restore it after the sub returns.  It
just doesn't restore over the parts that have useful information.  

Of course I don't mean restore all the registers on continuation
invocation, lest there wouldn't be a way to return values.  Restore
half of them... or none of them perhaps, and have some set of ops that
resore from that context... or something.

I guess I'm just getting scared having an implicit control stack and
an explicit register stack.  It seems like if you do anything
"tricky", things could get messed up real quick.  Are the register
stacks saved with the continuation?  If so, I'm not so worried.  I've
basically been saying to give the register stacks a depth of one, but
a greater depth wouldn't be a problem... except for efficiency issues,
maybe.

Would someone (presumably Dan, being the one who decided and all)
explain why we're using CPS?  Maybe we (I) can get a better idea of
how things should work, then.

Luke

Reply via email to