Banish boolkeys
authorFather Chrysostomos <sprout@cpan.org>
Sun, 26 Aug 2012 01:48:46 +0000 (18:48 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 26 Aug 2012 06:02:06 +0000 (23:02 -0700)
commitc8fe3bdf72b0df1c0b68f180001f0a3dde206992
treee7b45c4208072ce5f7f584998768df0f720d4623
parent721670045d5263bd28b147533785fbbf36671316
Banish boolkeys

Since 6ea72b3a1, rv2hv and padhv have had the ability to return boo-
leans in scalar context, instead of bucket stats, if flagged the right
way.  sub { %hash || ... } is optimised to take advantage of this.  If
the || is in unknown context at compile time, the %hash is flagged as
being maybe a true boolean.  When flagged that way, it returns a bool-
ean if block_gimme() returns G_VOID.

If rv2hv and padhv can already do this, then we don’t need the
boolkeys op any more.  We can just flag the rv2hv to return a boolean.
In all the cases where boolkeys was used, we know at compile time that
it is true boolean context, so we add a new flag for that.
12 files changed:
dump.c
embed.fnc
embed.h
ext/B/B/Concise.pm
op.c
op.h
opcode.h
pp.c
pp_hot.c
pp_proto.h
proto.h
regen/opcode.pl