Add CVf_LEXICAL flag

Lexical subs will use this instead of CvNAMED to indicate that the
name should not include the package.
Turn on CVf_LEXICAL for lexical subs

This flag will signify that lexical subs should not have package names
associated with them in error messages, etc.
cv_name

An API function for getting the name of a CV.  Docs to follow.
sv_cathek

This macro, intended for internal use, simplifies the code in
a couple of places.
pad.c: Document cv_name
Test cv_name
Increase $XS::APItest::VERSION to 0.64
For lexical subs, reify CvGV from CvSTASH and CvNAME_HEK

From now on, the presence of a name hek implies a GV.  Any access to
CvGV will cause that implicit GV to be reified.
Remove bogus gv-handling code from toke.c

This code was added by 211a4342c, which was actually restoring some
code that f74617600 removed.

Its purpose was to expand a proxy to a real GV after we found out that
we really are going to compile a sub call op.

This code is actually unreachable at present (sub call lookup via
rv2cv ops expands stub declarations, but not references to constants;
references to constants are not compiled to sub calls), which is a
good thing, because (1) it does not take UTF8 names into account and
(2) it does not work with rv2cv hooks or our subs, because it assumes
that the value of PL_tokenbuf is normative and can be used to
reify a glob.
Avoid creating GVs when subs are declared

This patch changes ‘sub foo {...}’ declarations to store subroutine
references in the stash, to save memory.

Typeglobs still notionally exist.  Accessing CvGV(cv) will reify them.
Hence, currently the savings are lost when a sub call is compiled.

$ ./miniperl -e 'sub foo{} BEGIN { warn $::{foo} } foo(); BEGIN { warn $::{foo} }'
CODE(0x7f8ef082ad98) at -e line 1.
*main::foo at -e line 1.

This optimisation is skipped if the subroutine declaration contains a
package separator.

Concerning the changes in caller.t, this code:

    sub foo { print +(caller(0))[3],"\n" }
    my $fooref = delete $::{foo};
    $fooref -> ();

used to crash in 5.7.3 or thereabouts.  It was fixed by 16658 (aka
07b8c804e8) to produce ‘(unknown)’ instead.  Then in 5.13.3 it was
changed (by 803f274) to produce ‘main::__ANON__’ instead.  So the
tests are really checking that we don’t get a crash.  I think it is
acceptable that it has now changed to ‘main::foo’.
sv.h: Expand comment about potential SVf_UTF8 conflict
Fix-ups for Attribute::Handlers

It was making unreliable assumptions about the contents of stashes.
Tweak Peek.t

beab08741 introduced XSUB constants, but the code it added to
newATTRSUB does not set CvSTASH if there is already a CV stub.  It
does set it if there is no sub there at all (because it goes through
newCONSTSUB).

Recent changes have made constant declarations like ‘sub foo(){}’
put just a constant reference in the stash if possible, the way con-
stant.pm does.  When this gets upgraded to a typeglob, the CV is rei-
fied via newCONSTSUB, so it gets a CvSTASH pointer.

CvSTASH on a constant sub really makes no difference in practice.
It’s mostly cosmetic.

This exercises the two code paths with the oldest perl installa-
tion I have:

$ /opt/bin/perl5.8.8 -MDevel::Peek -e 'BEGIN{\&foo} sub foo(){3} Dump \&foo'
SV = RV(0x9baa18) at 0x98d580
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x9b7398
  SV = PVCV(0x9b4810) at 0x9b7398
    REFCNT = 2
    FLAGS = (POK,pPOK,CONST)
    IV = 0
    NV = 0
    PROTOTYPE = ""
    COMP_STASH = 0x98d4a8	"main"		<----------
    ROOT = 0x0
    XSUB = 0x5bb44
    XSUBANY = 10018864
    GVGV::GV = 0x98df7c	"main" :: "foo"
    FILE = "-e"
    DEPTH = 0
    FLAGS = 0x200
    OUTSIDE_SEQ = 96
    PADLIST = 0x98e228
    PADNAME = 0x98e24c(0x0) PAD = 0x98e264(0x22d560)
    OUTSIDE = 0x98df34 (UNIQUE)
$ /opt/bin/perl5.8.8 -MDevel::Peek -e 'sub foo(){3} Dump \&foo'
SV = RV(0xc11018) at 0xbe3b80
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0xbe4570
  SV = PVCV(0xc0ae10) at 0xbe4570
    REFCNT = 2
    FLAGS = (POK,pPOK,CONST)
    IV = 0
    NV = 0
    PROTOTYPE = ""
    COMP_STASH = 0x0		<--------------------------
    ROOT = 0x0
    XSUB = 0x5bb44
    XSUBANY = 12469628
    GVGV::GV = 0xbe3c40	"main" :: "foo"
    FILE = "-e"
    DEPTH = 0
    FLAGS = 0x200
    OUTSIDE_SEQ = 0
    PADLIST = 0x0
    OUTSIDE = 0x0 (null)
Increase $Attribute::Handlers::VERSION to 0.97
op.c: ck_rvconst: Inline the noexpand var

It is only used once now, and its name is about to become confusing,
as GV_NOEXPAND will be used for all CVs.
Avoid reifying GVs in rv2cv

\&foo no longer reifies GVs in the stash:

$ ./miniperl -e 'sub foo{} warn $::{foo}; \&foo; warn $::{foo}'
CODE(0x7fab6282ad98) at -e line 1.
CODE(0x7fab6282ad98) at -e line 1.

Sub calls still reify them though, because of the way ck_subr cur-
rently works.

Constant proxies are still upgraded to full GVs for now, just to mini-
mise the churn per patch.

This makes it possible for OP_GVs to point to things other than GVs,
and these things are stored in the pad under threads.  Hence, pad_tidy
could turn on PADTMP, and then IS_PADGV becomes true when it is
upgraded to a glob, so refgen will fail assertions.  There is actually
no need to turn on PADTMP in pad_tidy, since it will already be on for
op targets.  (We need to get rid of IS_PADGV one of these days.  It
doesn’t actually do anything.)
pad.c:cv_name: Reword docs for future extensibility
pad.c: Avoid struct name followed by colon

Some old clang++ versions have trouble with this.  See ticket #112786.
Add cv_set_call_checker_flags

This is like cv_set_call_checker, except that it allows the caller to
decide whether the call checker needs a GV.

Currently the GV flag is recorded, but ck_subr does not do anything
with it yet.
Use cv_name in pp_hot.c:sub_crush_depth

The next commit will allow lexical subs with GVs to reach this code
path, so use cv_name, since it knows how to handle those.