In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/428744c7579851ddf8435ff354febb87c4100545?hp=c3eee33ff6b20f87b354c5300d7cede17cef4e32>
- Log ----------------------------------------------------------------- commit 428744c7579851ddf8435ff354febb87c4100545 Author: Father Chrysostomos <[email protected]> Date: Fri Jul 12 23:33:06 2013 -0700 Revert "[perl #118525] Return B::HEK for B::CV::GV of lexical subs" This reverts commit 8748370e90a24f3901d476f43ed77f1ac3d861f4. There appears to be a typemap problem. I accidentally pushed the patch too soon. Sorry for the noise. ----------------------------------------------------------------------- Summary of changes: ext/B/B.pm | 25 ------------------------- ext/B/B.xs | 42 +----------------------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/ext/B/B.pm b/ext/B/B.pm index 85c0bfe..8b13dea 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -1244,8 +1244,6 @@ Since perl 5.17.1 Perl 5.18 introduces a new class, B::PADLIST, returned by B::CV's C<PADLIST> method. -Perl 5.18.1 and 5.19 introduce a new class, B::HEK, returned by B::CV's -C<GV> method for lexical subs. =head2 B::PADLIST Methods @@ -1267,29 +1265,6 @@ rather than a list of all of them. =back -=head2 B::HEK Methods - -A B::HEK is returned by B::CV->GV for a lexical sub, defining its name. -Using the dereferenced scalar value of the object returns the string value, -which is usually enough; the other methods are rarely needed. - - use B; - use feature 'lexical_subs'; - my sub p {1}; - $cv = B::svref_2object(\&p); - $hek = $cv->GV; - print $$hek, "==", $hek->KEY; - -=over 4 - -=item KEY - -=item LEN - -=item FLAGS - -=back - =head2 $B::overlay Although the optree is read-only, there is an overlay facility that allows diff --git a/ext/B/B.xs b/ext/B/B.xs index 444d2fe..fbe6be6 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -296,17 +296,6 @@ make_sv_object(pTHX_ SV *sv) } static SV * -make_hek_object(pTHX_ HEK *hek) -{ - SV *ret = sv_setref_pvn(sv_newmortal(), "B::HEK", HEK_KEY(hek), HEK_LEN(hek)); - SV *rv = SvRV(ret); - SvIOKp_on(rv); - SvIV_set(rv, PTR2IV(hek)); - SvREADONLY_on(rv); - return ret; -} - -static SV * make_temp_object(pTHX_ SV *temp) { SV *target; @@ -613,7 +602,6 @@ typedef IO *B__IO; typedef MAGIC *B__MAGIC; typedef HE *B__HE; -typedef HEK *B__HEK; typedef struct refcounted_he *B__RHE; #ifdef PadlistARRAY typedef PADLIST *B__PADLIST; @@ -1402,10 +1390,7 @@ IVX(sv) ptr = (ix & 0xFFFF) + (char *)SvANY(sv); switch ((U8)(ix >> 16)) { case (U8)(sv_SVp >> 16): - if ((ix == (PVCV_gv_ix)) && CvNAMED(sv)) - ret = make_hek_object(aTHX_ CvNAME_HEK((CV*)sv)); - else - ret = make_sv_object(aTHX_ *((SV **)ptr)); + ret = make_sv_object(aTHX_ *((SV **)ptr)); break; case (U8)(sv_IVp >> 16): ret = sv_2mortal(newSViv(*((IV *)ptr))); @@ -1603,31 +1588,6 @@ PV(sv) } ST(0) = newSVpvn_flags(p, len, SVs_TEMP | utf8); -MODULE = B PACKAGE = B::HEK - -void -KEY(hek) - B::HEK hek - ALIAS: - LEN = 1 - FLAGS = 2 - PPCODE: - SV *pv; - switch (ix) { - case 0: - pv = newSVpvn(HEK_KEY(hek), HEK_LEN(hek)); - if (HEK_UTF8(hek)) SvUTF8_on(pv); - SvREADONLY_on(pv); - PUSHs(pv); - break; - case 1: - mPUSHu(HEK_LEN(hek)); - break; - case 2: - mPUSHu(HEK_FLAGS(hek)); - break; - } - MODULE = B PACKAGE = B::PVMG void -- Perl5 Master Repository
