Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Mon, 24 Nov 2003 09:48:08 -0500 (EST)
Local: Mon, Nov 24 2003 9:48 am
Subject: Re: Freezing and thawing
On Fri, 21 Nov 2003, Leopold Toetsch wrote: If we want to add a flag, or a call as part of the freeze API that lets a > Dan Sugalski <d...@sidhe.org> wrote: > > 5) The vtable API > [ ... ] > > thawfinish() > This is very probably necessary to perform some final state adjustemnt, PMC note that it needs post-processing, that's fine. The default vtable entry should just do nothing. > > 6) The freeze/thaw library needs to consist of the following calls (some A list is just a series of values in this context -- the sort of thing > > of which we already have) > [ ... ] > > startlist(name) > Do you have some more info about above functions and what they are you'd use to dump out an array or a struct. If you had a PMC that represented this: struct foo { the calls the PMC freeze would make would look like startlist("foo") start/end pairs does the same thing, only what gets frozen is a series of > > addpmctolist(pmc *) Sure it does. This puts a PMC on the list of PMCs being frozen, assuming > Doesn't fit into the scheme. that PMC isn't already on the list. The freeze list drives everything that gets frozen. > The latter tells the engine, to put a PMC Its not necessarily overridable, true, but it's conceptually one of the > on the todo_list. That ought to be part of the context (info) structure. > All the other library functions are serializer-specific. core freeze routines. That's the imprtant part here. > > The freezepmc routine here, it should be noted, acts as a mark routine of Well, there's the problem. the ->mark vtable entry is really "mark your > > sorts, which is why we don't need one on the PMC itself for this. > That doesn't play with other usage of vtable->visit like destruction children" rather than "mark yourself", which means that the freeze entry for a PMC corresponds to the mark entry for DOD. When ->freeze is called for a PMC all the children should be frozen. (Or all the children it ultmately cares about) This is separate from the mark routine Parrot's API provides, which is a "put this PMC on the list of PMCs to be visited, if its not already on the list" routine. It would've been better if the vtable entry was "mark_children" and the > > Leo's idea of passing in a struct as part of the freeze is a good one, as I'm picturing some interesting recursive definition issues there. At the > > one of the things hanging off it can be a vtable with all these calls in > > it, so we can have multiple freeze methods active at once. (Arguments as > > to why that's a good thing are separate and I don't want to go there :) > Actually, I'm (longterm) thinking of making a PMC out of PackFile_<xxx> moment I'm thinking we'd be better off keeping the freeze format separate from the bytecode format. Some of the limits on bytecode (like mmappability) may conflict with how we'd prefer to do serialization by default. We can look to unify them later, but for now lets keep things separate. Dan --------------------------------------"it's like this"------------------- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||