Leopold Toetsch writes:
> Melvin Smith wrote:
>
> >At 07:53 AM 1/6/2004 -0700, Luke Palmer wrote:
> >
> >>Aren't continuations supposed to close over the register stacks? In
> >>this code:
> >
> >Currently the Copy-On-Write bit isn't being honored on the register pad
> >stacks,
>
> No. Register backing stacks are no more in the interpreter context and
> neither stored nor restored by the continuation.
>
> [ COWed stacks ]
>
>
> >someone had during my absence. (How is that for passing the blame? :) )
>
> Good. Pass it over to me :) COW copy of stacks and of other buffer-based
> items is still broken. These need distinct headers so that they work
> like COWed strings.
Alright, I've got a pretty big incomplete patch here (see, when one has
a deadline on a compiler written with the assumption of working
continuations, one can be pretty determined :-).
It makes each chunk into a subclass of Buffer like so:
struct RegisterChunkBuf {
size_t used;
PObj* next;
};
And then, for example:
struct PRegChunkBuf {
struct RegisterChunkBuf buf;
struct PRegFrame PRegFrame[FRAMES_PER_CHUNK];
};
I want these things to be garbage collected, but DOD doesn't trace the
buffer. I can't seem to find a way to mark the frames without making
the chunks into PMCs (yuck). Is there a way to do this?
Thanks,
Luke