diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-11-02 22:24:32 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-13 04:49:41 -0800 |
commit | 73c13e16ff95b775e0d9b3a78dc422b3c96aa086 (patch) | |
tree | 8c12bfcf26dedac3ed37ebfa2dfc0e644827ebd4 /proto.h | |
parent | 7a3e5b7e7f731d44ac601c08cb38bb6c5bc900c4 (diff) | |
download | perl-73c13e16ff95b775e0d9b3a78dc422b3c96aa086.tar.gz |
Make sub () { 0; 3 } inlinable once more
It probably stopped being inlinable in commit beab0874143b.
Following op_next pointers to see whether a sub’s execution chain con-
sists of a constant followed by sub exit does not make sense if the
op_next pointers have not been set up yet.
So call LINKLIST earlier, so that we can merge the two calls to
op_const_sv in newATTRSUB (no need to search for constants twice).
That will allow sub () { 0; 3 } to be inlined once more, as it was in
perl 5.005 (I checked) and probably in 5.6, too (I didn’t check).
This also allows us to remove initial the OP_LINESEQ check, which
was added to help this function into the block when we have no
op_next pointers.
op_const_sv is now called only before the peephole optimiser and
finalize_op, which removes the need for the special explicit return
check (it hasn’t been optimised out of the execution chain yet) and
the need to account for constants that have been relocated to the pad
by finalize_op.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3196,11 +3196,12 @@ PERL_CALLCONV void Perl_op_clear(pTHX_ OP* o) #define PERL_ARGS_ASSERT_OP_CLEAR \ assert(o) -PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ const OP* o, CV* cv, CV *outside) +PERL_CALLCONV SV* Perl_op_const_sv(pTHX_ const OP* o, CV* cv, CV *outside, bool allow_lex) __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_1); + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_OP_CONST_SV \ - assert(o) + assert(o); assert(cv) PERL_CALLCONV OP* Perl_op_contextualize(pTHX_ OP* o, I32 context) __attribute__nonnull__(pTHX_1); |