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

Re: more process_optree

Thread Previous | Thread Next
Jim Cromie
February 15, 2017 16:20
Re: more process_optree
Message ID:
On Wed, Feb 15, 2017 at 4:51 AM, Dave Mitchell <> wrote:
> On Tue, Feb 14, 2017 at 05:11:55PM -0700, Jim Cromie wrote:
>> hi all,
>> Id like to clarify & revise these patches, 2 new ones attached.
>> it wasnt ready for prime-time, hence no RT submission.
>> Now it passes make test, for 1 config.
>> Im trying others now...
> This is very annoying. You sent 2 patches to the list with a "stream of
> conciousness" collection of random comments which are hard to understand
> and waste everyone's time.

my apologies.

>> to clarify, whats actually new here is that finalize_optree is called
>> where it wasnt previously.
>> IOW, finalize_optree does not achieve full coverage of all OPs run.
>> IMO this is a latent bug, present since the function was added.
>> Specifically, S_fold_constants, gen_constant_list, and perhaps others,
>> do not finalize their optrees.
> No, these patches are completely wrong. S_fold_constants() is called on on
> a *partial* subreee to possibly collapse that subtree into a single
> constant.  Later on when the *whole* optree has been parsed,
> S_process_optree() does all the stuff associated with processing a
> complete optree, like optimising it and attaching it to a CV.
> Partial optrees like those in S_fold_constants() should *not* be passed
> to S_process_optree().

OK.  Begging your forbearance, heres what Im trying to do:

usage of op-sibling and op-ppaddr are almost mutually exclusive,
and they can be unionized.
opsibling is set early, and used heavily in optimization,
but rarely afterwards.
ppaddr is set early too, but can be deferred until after optimization,
and initialized in finalize_op, IFF every op gets finalized.
At finalization, opsibling can be saved to an HV,
so its available at runtime for the occasional need.

Ive got the above mostly fleshed out,
but the sticking point so far has been the subtrees
produced by fold-constants and gen-const-list;
theyre not getting visited by finalize_op,
(despite being attached to the larger tree?)
so their ppaddr is null in runtime, causing segvs.

If this is all crazytalk, I'll delete the branch and shut up.

thanks for your time/consideration/insight.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About