On Fri, 2 Aug 2002, Jerome Vouillon wrote: > On Tue, Jul 30, 2002 at 09:07:11PM -0700, Sean O'Rourke wrote: > > - take a look at "new" in core.ops. Creating a new continuation captures > > context, but the register holding that continuation is part of the > > context. Unfortunately, it doesn't know what register it's in until after > > it captures the context, so it has to go back and fill that in afterwards. > > "new" should probably take a PMC as argument and fill it, instead of > allocating a PMC and returning it. This would solve this problem and > also avoid numerous allocations of temporary PMCs.
I agree -- we should separate new from init at some level. I think the "new" opcode should still both allocate and initialize, while the normal sequence for getting a PMC should become x = pmc_new(...); x->vtable->init(interp, x); This would solve the continuation problem without breaking existing pasm code. It would involve tweaking a lot of existing C, but such is life. Any objections? /s