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

Re: optimisations you just can't do (was Re: Interesting self contained task)

From:
David Nicol
Date:
February 25, 2008 12:47
Subject:
Re: optimisations you just can't do (was Re: Interesting self contained task)
Message ID:
934f64a20802251247q2148e749k3a41a796b8b0dff3@mail.gmail.com
On Mon, Feb 25, 2008 at 5:59 AM, Nicholas Clark <nick@ccl4.org> wrote:
>  So attempting to do a late optimisation of unpack (or anything else) in
>  Perl_scalar(), won't cause the resulting constant to be propagated outwards
>  into any surrounding constant expression.
>
>  I guess the "right" time to do this (if at all) would be another
>  post-everything optimisation phase, which either:
>
>  a: Knows that it can't use the op_next pointers, and forcibly re-links once
>    at the end if anything changed.
>  b: Pessimistically re-links each time any individual optimisation triggers.

a "smart compilation" or "smart lexing" pass?  What if pack/unpack were flagged
as something that required special attention at lexing time, so a constant would
get re-expressed as such sufficiently early? (call it "weak macros")



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