At 02:06 PM 9/17/2001 +0100, Dave Mitchell wrote:
> > Assuming there's one general stack to save "stuff" on, where stuff is:
> >
> > * Scope entries
> > * Return addresses for JSRs
> > * Saved individual registers
> > * Local() calls
>
>Dave's Wild+Whacky+Unworkable Suggestion #42:
>
>If we have one generic stack with all sorts of things on it, why not
>treat it as a stack of objects, with each object "knowing" what to do
>with itself when popped? Or more prosaically, for each "thing" pushed
>onto the stack (register set etc), we also push a pointer to a function
>that gets called when the thing is popped. ie like the Perl 5
>savestack, but we push a fn pointer rather than a SAVEt_* constant.
>This gives us flexibility + extensibility, but may slow us down.
That's neither wild nor wacky. Certainly not unworkable. It is, in fact,
close to the plan.
I'm currently working on the assumpution that each thing pushed gets a type
attached to it, and that type will be dealt with appropriately when things
are popped. I wasn't thinking of going as far as putting a function pointer
in there, but that's not an unreasonable thing. Dunno whether it'll be
faster or not, but it'll certainly be interesting.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk