This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate AMGf_set flag
authorDavid Mitchell <davem@iabyn.com>
Mon, 4 Feb 2019 15:07:11 +0000 (15:07 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 5 Feb 2019 14:03:05 +0000 (14:03 +0000)
commit0872de45fff4b1f6c17e1d5bec82d3d5095801a2
treedf3784390ce43b1f7a0b401f97bde5136fe7f408
parent9b2983ca78e5369d17559ca0aa5af58e9da3724a
Eliminate AMGf_set flag

I added this flag a few years ago when I revamped the overload macros
tryAMAGICbin() etc. It allowed two different classes of macros to
share the same functions (Perl_try_amagic_un/Perl_try_amagic_bin)
by indicating what type of action is required.

However, the last few commits have made those two functions able to
robustly always determine whether its an assign-type action
($x op= $y or  $lex = $x op $x) or a plain set-result-on-stack operation
($x op $y).

So eliminate this flag.

Note that this makes the ops which have the AMGf_set flag hard-coded
infinitesimally slower, since Perl_try_amagic_bin no longer skips the
checks for assign-ness. But compared with the overhead of having
already called the overload method, this is is trivial.

On the plus side, it makes the code smaller and easier to understand.
gv.c
pp.c
pp.h
pp_hot.c