Revert "[perl #79908] Stop sub inlining from breaking closures"
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Wed, 7 May 2014 12:09:40 +0000 (12:09 +0000)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 May 2014 15:02:11 +0000 (11:02 -0400)
commitd3f8a934ef964c0f488e9c692275435d8ea2e291
treeed55053aa6f348e9bafa9b16832cacfd99e55f1a
parentfe39f0d59b87549f2e6cb1df1dfeaa25215b19ab
Revert "[perl #79908] Stop sub inlining from breaking closures"

This reverts commit 137da2b05b4b7628115049f343163bdaf2c30dbb. See the
"How about having a recommended way to add constant subs dynamically?"
thread on perl5-porters, specifically while it sucks that we have this
bug, it's been documented to work this way since 5.003 in "Constant
Functions" in perlsub:

    If the result after optimization and constant folding is either a
    constant or a lexically-scoped scalar which has no other references,
    then it will be used in place of function calls made without C<&>

    -- http://perldoc.perl.org/perlsub.html#Constant-Functions

Since we've had this documented bug for a long time we should introduce
this fix in a deprecation cycle rather than silently slowing down code
that assumes it's going to be optimized by constant folding.

I didn't revert the tests it t/op/sub.t, but turned them into TODO tests
instead.

Conflicts:
t/op/sub.t
embed.fnc
embed.h
op.c
pad.c
proto.h
t/op/sub.t