On Feb 3, 2006, at 15:49, Nicholas Clark wrote:
On Tue, Jan 31, 2006 at 02:01:42PM +0100, Leopold Toetsch wrote:
Limiting the callframe range, where the continuation can go. Currently
creating a continuation is rather expensive, as all RetContinuations
up
the call chain are converted into full continuations. This is
necessary
because there is no further information about the usage of the
continuation. It could be passed to 'main' and then 'jump' back. Thus
all the intermediate frames have to be kept alive, because normal
function return goes through these frames.
Could this be done lazily? Presumably the ret continuations only need
to be
converted to full continuations just before they're returned through,
The 'rather' expensive thing is basically:
while (cont)
cont->vtable = Parrot_base_vtables[enum_class_Continuation]
cont = cont->caller
i.e. placing a new vtable into the whole call chain. Setting some flag
or whatever wouldn't be simpler. The only problem with above is that
it's O(n) in call depth. Therefore the idea of creating 'limited
continuations' that are only allowed to 'jump' between defined places
in the call chain.
No - I don't think that this can be done lazily.
Nicholas Clark
leo