Branch: refs/heads/davem/rc5 Home: https://github.com/Perl/perl5 Commit: 877112385c9ef69497937fc9969f9040732df61b https://github.com/Perl/perl5/commit/877112385c9ef69497937fc9969f9040732df61b Author: David Mitchell <da...@iabyn.com> Date: 2023-12-05 (Tue, 05 Dec 2023)
Changed paths: M pp.c Log Message: ----------- make RC-stack-aware: unwrap pp_index() Remove the temporary wrapper from pp_index() Commit: 3b66035813f06f9fbfec11787ff431237478e2db https://github.com/Perl/perl5/commit/3b66035813f06f9fbfec11787ff431237478e2db Author: David Mitchell <da...@iabyn.com> Date: 2023-12-05 (Tue, 05 Dec 2023) Changed paths: M dist/IO/IO.xs Log Message: ----------- IO::getline(): use CALLRUNOPS This XS function calls Perl_pp_readline() directly. Instead, invoke the op via CALLRUNOPS(): the run loop (that will just run a single op) can handle the case of the caller having a non-reference-counted stack, but when the ops it calls are expecting a reference-counted stack. Perl_pp_readline() will (in a few commits' time) indeed be expecting a reference-counted stack. Commit: ebb1b1fd72233a35d8315fef16ab317ccd8a16de https://github.com/Perl/perl5/commit/ebb1b1fd72233a35d8315fef16ab317ccd8a16de Author: David Mitchell <da...@iabyn.com> Date: 2023-12-05 (Tue, 05 Dec 2023) Changed paths: M dist/IO/IO.xs Log Message: ----------- IO::getline() handle OPf_STACKED better When calling Perl_pp_readline(), only set OPf_STACKED, and only create a dummy stacked target, when in scalar context. getline() had been sort of getting away with always setting it, but the next commit but one will make pp_readline() more strict about its flag handling (basically adding lots of asserts and only processing the target when OPf_STACKED is set). This change has been wrapped in a version #ifdef, as on older perls pp_readline() will unconditionally try to retrieve the targ from the pad if OPf_STACKED isn't set, and probably crash. Note that until the next commit but one, this commit will probably fail t/io_getline.t. Commit: eb7b2708f8cd2c8ea73b42ef0bb98489bef6d17a https://github.com/Perl/perl5/commit/eb7b2708f8cd2c8ea73b42ef0bb98489bef6d17a Author: David Mitchell <da...@iabyn.com> Date: 2023-12-05 (Tue, 05 Dec 2023) Changed paths: M pp.h M pp_hot.c M pp_sys.c Log Message: ----------- expand tryAMAGICunTARGETlist() macro This long macro is only used in two places (pp_readline and pp_glob). Expand the contents of this macro directly in those two functions. This will make it easier to individually unwrap (i.e. remove PP_wrapped()) those two functions. Shouldn't be any functional change. Commit: ccf9d66e8acd5f1ef2651959670dcb707b51dca6 https://github.com/Perl/perl5/commit/ccf9d66e8acd5f1ef2651959670dcb707b51dca6 Author: David Mitchell <da...@iabyn.com> Date: 2023-12-05 (Tue, 05 Dec 2023) Changed paths: M gv.c M pp.c M pp_hot.c M pp_sys.c Log Message: ----------- make RC-stack-aware: pp_readline(), pp_glob() etc Remove the temporary wrappers from: pp_readline() pp_rcatline() pp_glob() pp_rv2gv() and dependent functions. This started out as an attempt to unwrap the simple pp_rv2gv() function. But pp_readline() calls pp_rv2gv() too, so that had to be unwrapped too. Then the bulk of pp_readline()'s implementation is done by do_readline(), so that had to be updated too. But pp_rcatline() and pp_glob() also call out to do_readline(), so they had to be fixed too. And pp_glob() outsources most of its work to the XS module File::Glob, so calling that had to be wrapped to handle a non-refcounted stack in the XS code. Then it turns out that code in IO.xs calls pp_readline() directly and needed tweaking. So now its a large commit that updates nearly everything in one big go. While fixing up everything, I took the opportunity to add many code comments and asserts to better document what these various functions do, and what args they expect on the stack under what flag conditions. The op_flag processing is now more strict, so potentially other code which directly fakes up an op with sloppy flag settings and calls one of these pp functions directly might now trigger an assert failure. (See the fix-up to IO.xs a couple of commits ago for an example.) Commit: 408102c3f022dd757533fafcd9e5c170d89f6542 https://github.com/Perl/perl5/commit/408102c3f022dd757533fafcd9e5c170d89f6542 Author: David Mitchell <da...@iabyn.com> Date: 2023-12-05 (Tue, 05 Dec 2023) Changed paths: M pp.h Log Message: ----------- remove unused tryAMAGICunTARGETlist macro This macro was originally only used in two places in core (pp_readline and pp_glob), and nowhere on CPAN. The last few commits inlined those only two usages, then modified the functions using that code to be PERL_RC_STACK-aware. Since the macro is now unused, and is the old obsolete non-PERL_RC_STACK code, this commit just deletes it. Compare: https://github.com/Perl/perl5/compare/877112385c9e%5E...408102c3f022