This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
OP_EMPTYAVHV: create ops in newANONHASH/newANONLIST rather than rpeep
The current implementation of the OP_EMPTYAVHV optimization does not
optimize instances of empty anonymous hashes/lists on the RHS of LOGOP
conditions, such as in `my $x = $y || {}`.
This commit addresses this by removing the peephole optimization in
favour of having EMPTYAVHV OPs produced directly whenever a call is
made to `newANONHASH` or `newANONLIST` with an empty child OP `o`.
The standard TARGMY optimization in `S_maybe_targlex` has been
slightly adapted to also optimize the `LVINTRO` case for this OP.
This commit also addresses some feedback nits from the last dev
cycle: EMPTYAVHV is no longer a LISTOP, now just a BASEOP, and it
does not use the OPf_SPECIAL flag. (Both were unnecessary carryovers
from the ANONHASH and ANONLIST OPs.)