develooper Front page | perl.perl5.porters | Postings from December 2017

Re: Request For Context - about the 5.22->5.24 context stack rework

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
December 12, 2017 11:58
Subject:
Re: Request For Context - about the 5.22->5.24 context stack rework
Message ID:
20171212125732.015087e0@pc09.procura.nl
On Tue, 12 Dec 2017 11:48:03 +0000, "Paul \"LeoNerd\" Evans"
<leonerd@leonerd.org.uk> wrote:

> Hi all,
> 
> First off - pardon the pun in the title ;)
> 
> I'm looking to find out some information and specifics about the
> context stack work that happened during the 5.23.x development round,
> which ended up in 5.24.
> 
> The reason being, I have Future::AsyncAwait which works nicely on 5.24
> onwards, but its implementation is very entwined around the context
> stack, which changed quite a lot across these two versions. By just
> reading the relevant .h and .c files and comparing them between 5.22
> and 5.24 I've been able to work out a few changes, enough that I've got
> the start of a back-compat later that passes some of its tests on 5.22
> now. I'm hoping eventually to support it back as far as 5.14, but easy
> steps first - one perl version at a time ;)
> 
> The parts I've solved are:
> 
>  * 5.24's  cx->blk_oldsaveix becomes
>    5.22's  PL_scopestack[cx->blk_oldscopesp-1]
> 
>  * 5.22 lacks CX_CUR()  but that's an easy macro for &cxstack[cxstack_ix]
> 
>  * 5.22 lacks cx_pushblock and cx_pusheval but I wrote my own wrapper
>    functions for those based on 5.22's PUSHEVAL and PUSHBLOCK macros
> 
>  * 5.22 makes use of SAVEt_COMPPAD, SAVEt_FREESV and SAVEt_STRLEN in
>    situations that 5.24 would not have
> 
>  * 5.24 has CXt_LOOP_ARY and CXt_LOOP_LIST, whereas 5.22 has just
>    CXt_LOOP_FOR.

Have all of these been addressed in Devel::PPPort?
If not, would you be willing to do so?

> I feel I still have some work to go though, as the remaining failures
> are not simple compiletime "that field doesn't exist" kind of things,
> but runtime semantics upsets:
> 
> t/11contexts.t ......... 1/? D1
> Can't use string ("1") as a symbol ref while "strict refs" in use at t/11contexts.t line 68.
> # Tests were run but no plan was declared and done_testing() was not seen.
> # Looks like your test exited with 255 just after 4.
> t/11contexts.t ......... Dubious, test returned 255 (wstat 65280, 0xff00)
> All 4 subtests passed 
> 
> ^-- that one is a failure on a line containing
> 
>   print STDERR "D2\n";
> 
> t/20context-block.t .... 1/? Bizarre copy of ARRAY in return at /home/leo/perl5/perlbrew/perls/perl-5.22.2/lib/site_perl/5.22.2/Future.pm line 461.
> # Tests were run but no plan was declared and done_testing() was not seen.
> # Looks like your test exited with 255 just after 2.
> t/20context-block.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
> All 2 subtests passed 
> 
> ^-- No idea about this.
> 
> t/21context-while.t .... Future=HASH(0x1f94138) is already done and cannot be ->done at t/21context-while.t line 29.
> t/21context-while.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
> No subtests run 
> 
> ^-- Ditto.
> 
> t/22context-foreach.t .. TODO: Unsure how to handle savestack entry of 49 at t/22context-foreach.t line 19.
> t/22context-foreach.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
> No subtests run 
> 
> ^-- Something about SAVEt_PADSV_AND_MORTALIZE which might be simple.
> 
> 
> At this stage, I wonder if there are more subtle and interesting
> changes going on that I may have missed, or that aren't simply
> detectable at compiletime. Maybe someone more familiar with what
> internal changes happened around that time could suggest something I
> might have missed?
> 
> Additionally, I wonder if some of these failures might be related to
> something I've overlooked in my wrapping functions of cx_pushblock and
> cx_pusheval using the older macros. Some of the arguments are of
> different types now, and I'm not overly confident yet that I have a
> proper back-compat emulation, so maybe those might be of interest.
> I've attached the two files that implement them in case that shows up
> something of interest.
> 
> Any assistance appreciated :)
> 


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.27   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

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