develooper Front page | perl.perl5.porters | Postings from January 2016

Re: reworked context stack system

Thread Previous | Thread Next
From:
perl
Date:
January 4, 2016 18:25
Subject:
Re: reworked context stack system
Message ID:
568AB910.6040901@profvince.com


Le 04/01/2016 17:50, Dave Mitchell a écrit :
> The just-pushed branch smoke-me/davem/contextsB4 contains about 200 commits
> that heavily rework the scope / context stack system (all that PUSHBLOCK,
> POPSUB etc stuff). If it smokes ok, and if there aren't any objections,
> I intend to merge it in a few days' time.

Great work, thanks.

However, I am afraid this might break much more than just what is 
"likely" according to grep.cpan.me. In particular, if I understand your 
description correctly, this :

> In dounwind(), the current savestack frame is processed before each context
> is popped for every context type; formerly this was only done for sub-like
> context frames. This action has been removed from POPSUB/cx_popsub and
> placed into its own macro, CX_LEAVE_SCOPE(cx), which must be called before
> cx_popsub etc.
>
> dounwind() Now also does a cx_popblock() on the last popped frame (formerly
> it only did the cx_popsub() etc actions on each frame).
>
> The temps stack is now freed on scope exit; previously, temps created
> during the last statement of a block wouldn't be freed until the next
> nextstate following the block (apart from an existing hack that did this
> for recursive subs in scalar context); and in something like f(g()),
> the temps created by the last statement in g() would formerly not be
> freed until the statement following the return from f().

has a potential of breaking a lot of things, since destruction timing 
might change.

That's why I would like to see your branch smoked against CPAN before 
being merged in blead. I believe Andreas has the infrastructure ready 
for this.

Concerning Scope::Upper, it might be impossible to fix after your 
changes. I don't really care since I don't use it personally and the 
performance gains are nice, but I won't hide that it would make me feel 
like having written it for the community (it was a request) was a 
complete waste of my time.


Vincent

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About