Front page | perl.perl5.porters |
Postings from March 2015
From: Paul "LeoNerd" Evans
March 4, 2015 14:52
Message ID: firstname.lastname@example.org
On Wed, 4 Mar 2015 13:35:57 +0000
"Paul \"LeoNerd\" Evans" <email@example.com> wrote:
> If instead we can find a way to decompose the "signature" behaviour
> into a few smaller, simpler ops, can we not find a way to implement
> them just as efficiently, but now with greater flexibility to be able
> to reuse those ops elsewhere, or in new combinations?
E.g. a random thought: I notice that the OP_SIGNATURE has a generic way
to say the default value of an arg is some IV stored in the optree, and
also two specific cases for the (presumably common) cases of zero and
one, possibly to cut down on the extra pointer reference overhead in
fetching the IV. All well and good.
But maybe instead we want an OP_ZERO operator, that sets its TARG to be
a zero IV? That could be used in its place in whatever new optree shape
we make the signature-parsing code; but *also* the peephole optimiser
can now use that where-ever it finds an OP_SASSIGN(OP_CONST zero)
combination. Now any occurance of
$foo = 0
becomes more optimised, not just those ones appearing in signatures.
This is one example of the kind of thing I'm thinking here - this
OP_SIGNATURE has far too much special-casing of things like this, that
could help in other places that currently it can't reach.
Paul "LeoNerd" Evans
http://www.leonerd.org.uk/ | https://metacpan.org/author/PEVANS