cvs commit: ponie/perl/pod perlintern.pod
[email protected] (Nicholas Clark) 23 Apr 2005 16:52:42 -0000
| Newsgroups | perl.ponie.changes |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 05/04/23 09:52:42
Modified: perl embed.fnc embed.h global.sym proto.h sv.c sv.h
perl/ext/ByteLoader byterun.c
perl/pod perlintern.pod
Log:
Move sv_upgrade into the PMC.
Need to make some static functions relating to memory allocation visible for
a while.
Revision Changes Path
1.35 +28 -27 ponie/perl/embed.fnc
Index: embed.fnc
===================================================================
RCS file: /cvs/public/ponie/perl/embed.fnc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- embed.fnc 4 Apr 2005 17:46:11 -0000 1.34
+++ embed.fnc 23 Apr 2005 16:52:41 -0000 1.35
@@ -1243,6 +1243,34 @@
s |SV* |save_scalar_at |SV **sptr
#endif
+Ap |XPV* |new_xpv
+Ap |XPVIV* |new_xpviv
+Ap |XPVNV* |new_xpvnv
+Ap |XPVCV* |new_xpvcv
+Ap |XPVAV* |new_xpvav
+Ap |XPVHV* |new_xpvhv
+Ap |XPVIO* |new_xpvio
+Ap |XPVFM* |new_xpvfm
+Ap |XPVMG* |new_xpvmg
+Ap |XPVLV* |new_xpvlv
+Ap |XPVBM* |new_xpvbm
+Ap |XPVGV* |new_xpvgv
+Ap |void |del_xpv |XPV* p
+Ap |void |del_xpviv |XPVIV* p
+Ap |void |del_xpvnv |XPVNV* p
+Ap |void |del_xpvcv |XPVCV* p
+Ap |void |del_xpvav |XPVAV* p
+Ap |void |del_xpvhv |XPVHV* p
+Ap |void |del_xpvio |XPVIO* p
+Ap |void |del_xpvfm |XPVFM* p
+Ap |void |del_xpvmg |XPVMG* p
+Ap |void |del_xpvlv |XPVLV* p
+Ap |void |del_xpvbm |XPVBM* p
+Ap |void |del_xpvgv |XPVGV* p
+Ap |void |zero_xpvfm |SV *fm
+Ap |void |zero_xpvcv |SV *cv
+Ap |void |zero_xpvio |SV *io
+
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
s |IV |asIV |SV* sv
s |UV |asUV |SV* sv
@@ -1255,33 +1283,6 @@
s |void |more_xpvmg
s |void |more_xpvlv
s |void |more_xpvbm
-s |XPV* |new_xpv
-s |XPVIV* |new_xpviv
-s |XPVNV* |new_xpvnv
-s |XPVCV* |new_xpvcv
-s |XPVAV* |new_xpvav
-s |XPVHV* |new_xpvhv
-s |XPVIO* |new_xpvio
-s |XPVFM* |new_xpvfm
-s |XPVMG* |new_xpvmg
-s |XPVLV* |new_xpvlv
-s |XPVBM* |new_xpvbm
-s |XPVGV* |new_xpvgv
-s |void |del_xpv |XPV* p
-s |void |del_xpviv |XPVIV* p
-s |void |del_xpvnv |XPVNV* p
-s |void |del_xpvcv |XPVCV* p
-s |void |del_xpvav |XPVAV* p
-s |void |del_xpvhv |XPVHV* p
-s |void |del_xpvio |XPVIO* p
-s |void |del_xpvfm |XPVFM* p
-s |void |del_xpvmg |XPVMG* p
-s |void |del_xpvlv |XPVLV* p
-s |void |del_xpvbm |XPVBM* p
-s |void |del_xpvgv |XPVGV* p
-s |void |zero_xpvfm |SV *fm
-s |void |zero_xpvcv |SV *cv
-s |void |zero_xpvio |SV *io
s |void |sv_unglob |SV* sv
s |void |not_a_number |SV *sv
s |I32 |visit |SVFUNC_t f|U32 flags|U32 mask
1.25 +54 -162 ponie/perl/embed.h
Index: embed.h
===================================================================
RCS file: /cvs/public/ponie/perl/embed.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- embed.h 4 Apr 2005 17:46:11 -0000 1.24
+++ embed.h 23 Apr 2005 16:52:41 -0000 1.25
@@ -1768,6 +1768,33 @@
#define save_scalar_at S_save_scalar_at
#endif
#endif
+#define new_xpv Perl_new_xpv
+#define new_xpviv Perl_new_xpviv
+#define new_xpvnv Perl_new_xpvnv
+#define new_xpvcv Perl_new_xpvcv
+#define new_xpvav Perl_new_xpvav
+#define new_xpvhv Perl_new_xpvhv
+#define new_xpvio Perl_new_xpvio
+#define new_xpvfm Perl_new_xpvfm
+#define new_xpvmg Perl_new_xpvmg
+#define new_xpvlv Perl_new_xpvlv
+#define new_xpvbm Perl_new_xpvbm
+#define new_xpvgv Perl_new_xpvgv
+#define del_xpv Perl_del_xpv
+#define del_xpviv Perl_del_xpviv
+#define del_xpvnv Perl_del_xpvnv
+#define del_xpvcv Perl_del_xpvcv
+#define del_xpvav Perl_del_xpvav
+#define del_xpvhv Perl_del_xpvhv
+#define del_xpvio Perl_del_xpvio
+#define del_xpvfm Perl_del_xpvfm
+#define del_xpvmg Perl_del_xpvmg
+#define del_xpvlv Perl_del_xpvlv
+#define del_xpvbm Perl_del_xpvbm
+#define del_xpvgv Perl_del_xpvgv
+#define zero_xpvfm Perl_zero_xpvfm
+#define zero_xpvcv Perl_zero_xpvcv
+#define zero_xpvio Perl_zero_xpvio
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define asIV S_asIV
@@ -1803,87 +1830,6 @@
#define more_xpvbm S_more_xpvbm
#endif
#ifdef PERL_CORE
-#define new_xpv S_new_xpv
-#endif
-#ifdef PERL_CORE
-#define new_xpviv S_new_xpviv
-#endif
-#ifdef PERL_CORE
-#define new_xpvnv S_new_xpvnv
-#endif
-#ifdef PERL_CORE
-#define new_xpvcv S_new_xpvcv
-#endif
-#ifdef PERL_CORE
-#define new_xpvav S_new_xpvav
-#endif
-#ifdef PERL_CORE
-#define new_xpvhv S_new_xpvhv
-#endif
-#ifdef PERL_CORE
-#define new_xpvio S_new_xpvio
-#endif
-#ifdef PERL_CORE
-#define new_xpvfm S_new_xpvfm
-#endif
-#ifdef PERL_CORE
-#define new_xpvmg S_new_xpvmg
-#endif
-#ifdef PERL_CORE
-#define new_xpvlv S_new_xpvlv
-#endif
-#ifdef PERL_CORE
-#define new_xpvbm S_new_xpvbm
-#endif
-#ifdef PERL_CORE
-#define new_xpvgv S_new_xpvgv
-#endif
-#ifdef PERL_CORE
-#define del_xpv S_del_xpv
-#endif
-#ifdef PERL_CORE
-#define del_xpviv S_del_xpviv
-#endif
-#ifdef PERL_CORE
-#define del_xpvnv S_del_xpvnv
-#endif
-#ifdef PERL_CORE
-#define del_xpvcv S_del_xpvcv
-#endif
-#ifdef PERL_CORE
-#define del_xpvav S_del_xpvav
-#endif
-#ifdef PERL_CORE
-#define del_xpvhv S_del_xpvhv
-#endif
-#ifdef PERL_CORE
-#define del_xpvio S_del_xpvio
-#endif
-#ifdef PERL_CORE
-#define del_xpvfm S_del_xpvfm
-#endif
-#ifdef PERL_CORE
-#define del_xpvmg S_del_xpvmg
-#endif
-#ifdef PERL_CORE
-#define del_xpvlv S_del_xpvlv
-#endif
-#ifdef PERL_CORE
-#define del_xpvbm S_del_xpvbm
-#endif
-#ifdef PERL_CORE
-#define del_xpvgv S_del_xpvgv
-#endif
-#ifdef PERL_CORE
-#define zero_xpvfm S_zero_xpvfm
-#endif
-#ifdef PERL_CORE
-#define zero_xpvcv S_zero_xpvcv
-#endif
-#ifdef PERL_CORE
-#define zero_xpvio S_zero_xpvio
-#endif
-#ifdef PERL_CORE
#define sv_unglob S_sv_unglob
#endif
#ifdef PERL_CORE
@@ -4431,6 +4377,33 @@
#define save_scalar_at(a) S_save_scalar_at(aTHX_ a)
#endif
#endif
+#define new_xpv() Perl_new_xpv(aTHX)
+#define new_xpviv() Perl_new_xpviv(aTHX)
+#define new_xpvnv() Perl_new_xpvnv(aTHX)
+#define new_xpvcv() Perl_new_xpvcv(aTHX)
+#define new_xpvav() Perl_new_xpvav(aTHX)
+#define new_xpvhv() Perl_new_xpvhv(aTHX)
+#define new_xpvio() Perl_new_xpvio(aTHX)
+#define new_xpvfm() Perl_new_xpvfm(aTHX)
+#define new_xpvmg() Perl_new_xpvmg(aTHX)
+#define new_xpvlv() Perl_new_xpvlv(aTHX)
+#define new_xpvbm() Perl_new_xpvbm(aTHX)
+#define new_xpvgv() Perl_new_xpvgv(aTHX)
+#define del_xpv(a) Perl_del_xpv(aTHX_ a)
+#define del_xpviv(a) Perl_del_xpviv(aTHX_ a)
+#define del_xpvnv(a) Perl_del_xpvnv(aTHX_ a)
+#define del_xpvcv(a) Perl_del_xpvcv(aTHX_ a)
+#define del_xpvav(a) Perl_del_xpvav(aTHX_ a)
+#define del_xpvhv(a) Perl_del_xpvhv(aTHX_ a)
+#define del_xpvio(a) Perl_del_xpvio(aTHX_ a)
+#define del_xpvfm(a) Perl_del_xpvfm(aTHX_ a)
+#define del_xpvmg(a) Perl_del_xpvmg(aTHX_ a)
+#define del_xpvlv(a) Perl_del_xpvlv(aTHX_ a)
+#define del_xpvbm(a) Perl_del_xpvbm(aTHX_ a)
+#define del_xpvgv(a) Perl_del_xpvgv(aTHX_ a)
+#define zero_xpvfm(a) Perl_zero_xpvfm(aTHX_ a)
+#define zero_xpvcv(a) Perl_zero_xpvcv(aTHX_ a)
+#define zero_xpvio(a) Perl_zero_xpvio(aTHX_ a)
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define asIV(a) S_asIV(aTHX_ a)
@@ -4466,87 +4439,6 @@
#define more_xpvbm() S_more_xpvbm(aTHX)
#endif
#ifdef PERL_CORE
-#define new_xpv() S_new_xpv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpviv() S_new_xpviv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvnv() S_new_xpvnv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvcv() S_new_xpvcv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvav() S_new_xpvav(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvhv() S_new_xpvhv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvio() S_new_xpvio(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvfm() S_new_xpvfm(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvmg() S_new_xpvmg(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvlv() S_new_xpvlv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvbm() S_new_xpvbm(aTHX)
-#endif
-#ifdef PERL_CORE
-#define new_xpvgv() S_new_xpvgv(aTHX)
-#endif
-#ifdef PERL_CORE
-#define del_xpv(a) S_del_xpv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpviv(a) S_del_xpviv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvnv(a) S_del_xpvnv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvcv(a) S_del_xpvcv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvav(a) S_del_xpvav(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvhv(a) S_del_xpvhv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvio(a) S_del_xpvio(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvfm(a) S_del_xpvfm(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvmg(a) S_del_xpvmg(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvlv(a) S_del_xpvlv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvbm(a) S_del_xpvbm(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define del_xpvgv(a) S_del_xpvgv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define zero_xpvfm(a) S_zero_xpvfm(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define zero_xpvcv(a) S_zero_xpvcv(aTHX_ a)
-#endif
-#ifdef PERL_CORE
-#define zero_xpvio(a) S_zero_xpvio(aTHX_ a)
-#endif
-#ifdef PERL_CORE
#define sv_unglob(a) S_sv_unglob(aTHX_ a)
#endif
#ifdef PERL_CORE
1.19 +27 -0 ponie/perl/global.sym
Index: global.sym
===================================================================
RCS file: /cvs/public/ponie/perl/global.sym,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- global.sym 4 Apr 2005 17:46:11 -0000 1.18
+++ global.sym 23 Apr 2005 16:52:41 -0000 1.19
@@ -706,6 +706,33 @@
Perl_macro_CvOUTSIDE_SEQ
Perl_Slab_Alloc
Perl_Slab_Free
+Perl_new_xpv
+Perl_new_xpviv
+Perl_new_xpvnv
+Perl_new_xpvcv
+Perl_new_xpvav
+Perl_new_xpvhv
+Perl_new_xpvio
+Perl_new_xpvfm
+Perl_new_xpvmg
+Perl_new_xpvlv
+Perl_new_xpvbm
+Perl_new_xpvgv
+Perl_del_xpv
+Perl_del_xpviv
+Perl_del_xpvnv
+Perl_del_xpvcv
+Perl_del_xpvav
+Perl_del_xpvhv
+Perl_del_xpvio
+Perl_del_xpvfm
+Perl_del_xpvmg
+Perl_del_xpvlv
+Perl_del_xpvbm
+Perl_del_xpvgv
+Perl_zero_xpvfm
+Perl_zero_xpvcv
+Perl_zero_xpvio
Perl_sv_setsv_flags
Perl_sv_catpvn_flags
Perl_sv_catsv_flags
1.35 +28 -27 ponie/perl/proto.h
Index: proto.h
===================================================================
RCS file: /cvs/public/ponie/perl/proto.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- proto.h 4 Apr 2005 17:46:12 -0000 1.34
+++ proto.h 23 Apr 2005 16:52:41 -0000 1.35
@@ -1195,6 +1195,34 @@
STATIC SV* S_save_scalar_at(pTHX_ SV **sptr);
#endif
+PERL_CALLCONV XPV* Perl_new_xpv(pTHX);
+PERL_CALLCONV XPVIV* Perl_new_xpviv(pTHX);
+PERL_CALLCONV XPVNV* Perl_new_xpvnv(pTHX);
+PERL_CALLCONV XPVCV* Perl_new_xpvcv(pTHX);
+PERL_CALLCONV XPVAV* Perl_new_xpvav(pTHX);
+PERL_CALLCONV XPVHV* Perl_new_xpvhv(pTHX);
+PERL_CALLCONV XPVIO* Perl_new_xpvio(pTHX);
+PERL_CALLCONV XPVFM* Perl_new_xpvfm(pTHX);
+PERL_CALLCONV XPVMG* Perl_new_xpvmg(pTHX);
+PERL_CALLCONV XPVLV* Perl_new_xpvlv(pTHX);
+PERL_CALLCONV XPVBM* Perl_new_xpvbm(pTHX);
+PERL_CALLCONV XPVGV* Perl_new_xpvgv(pTHX);
+PERL_CALLCONV void Perl_del_xpv(pTHX_ XPV* p);
+PERL_CALLCONV void Perl_del_xpviv(pTHX_ XPVIV* p);
+PERL_CALLCONV void Perl_del_xpvnv(pTHX_ XPVNV* p);
+PERL_CALLCONV void Perl_del_xpvcv(pTHX_ XPVCV* p);
+PERL_CALLCONV void Perl_del_xpvav(pTHX_ XPVAV* p);
+PERL_CALLCONV void Perl_del_xpvhv(pTHX_ XPVHV* p);
+PERL_CALLCONV void Perl_del_xpvio(pTHX_ XPVIO* p);
+PERL_CALLCONV void Perl_del_xpvfm(pTHX_ XPVFM* p);
+PERL_CALLCONV void Perl_del_xpvmg(pTHX_ XPVMG* p);
+PERL_CALLCONV void Perl_del_xpvlv(pTHX_ XPVLV* p);
+PERL_CALLCONV void Perl_del_xpvbm(pTHX_ XPVBM* p);
+PERL_CALLCONV void Perl_del_xpvgv(pTHX_ XPVGV* p);
+PERL_CALLCONV void Perl_zero_xpvfm(pTHX_ SV *fm);
+PERL_CALLCONV void Perl_zero_xpvcv(pTHX_ SV *cv);
+PERL_CALLCONV void Perl_zero_xpvio(pTHX_ SV *io);
+
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
STATIC IV S_asIV(pTHX_ SV* sv);
STATIC UV S_asUV(pTHX_ SV* sv);
@@ -1207,33 +1235,6 @@
STATIC void S_more_xpvmg(pTHX);
STATIC void S_more_xpvlv(pTHX);
STATIC void S_more_xpvbm(pTHX);
-STATIC XPV* S_new_xpv(pTHX);
-STATIC XPVIV* S_new_xpviv(pTHX);
-STATIC XPVNV* S_new_xpvnv(pTHX);
-STATIC XPVCV* S_new_xpvcv(pTHX);
-STATIC XPVAV* S_new_xpvav(pTHX);
-STATIC XPVHV* S_new_xpvhv(pTHX);
-STATIC XPVIO* S_new_xpvio(pTHX);
-STATIC XPVFM* S_new_xpvfm(pTHX);
-STATIC XPVMG* S_new_xpvmg(pTHX);
-STATIC XPVLV* S_new_xpvlv(pTHX);
-STATIC XPVBM* S_new_xpvbm(pTHX);
-STATIC XPVGV* S_new_xpvgv(pTHX);
-STATIC void S_del_xpv(pTHX_ XPV* p);
-STATIC void S_del_xpviv(pTHX_ XPVIV* p);
-STATIC void S_del_xpvnv(pTHX_ XPVNV* p);
-STATIC void S_del_xpvcv(pTHX_ XPVCV* p);
-STATIC void S_del_xpvav(pTHX_ XPVAV* p);
-STATIC void S_del_xpvhv(pTHX_ XPVHV* p);
-STATIC void S_del_xpvio(pTHX_ XPVIO* p);
-STATIC void S_del_xpvfm(pTHX_ XPVFM* p);
-STATIC void S_del_xpvmg(pTHX_ XPVMG* p);
-STATIC void S_del_xpvlv(pTHX_ XPVLV* p);
-STATIC void S_del_xpvbm(pTHX_ XPVBM* p);
-STATIC void S_del_xpvgv(pTHX_ XPVGV* p);
-STATIC void S_zero_xpvfm(pTHX_ SV *fm);
-STATIC void S_zero_xpvcv(pTHX_ SV *cv);
-STATIC void S_zero_xpvio(pTHX_ SV *io);
STATIC void S_sv_unglob(pTHX_ SV* sv);
STATIC void S_not_a_number(pTHX_ SV *sv);
STATIC I32 S_visit(pTHX_ SVFUNC_t f, U32 flags, U32 mask);
1.64 +53 -416 ponie/perl/sv.c
Index: sv.c
===================================================================
RCS file: /cvs/public/ponie/perl/sv.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- sv.c 23 Apr 2005 13:40:45 -0000 1.63
+++ sv.c 23 Apr 2005 16:52:41 -0000 1.64
@@ -1042,8 +1042,8 @@
/* grab a new struct xpv from the free list, allocating more if necessary */
-STATIC XPV*
-S_new_xpv(pTHX)
+XPV*
+Perl_new_xpv(pTHX)
{
XPV* xpv;
LOCK_SV_MUTEX;
@@ -1057,8 +1057,8 @@
/* return a struct xpv to the free list */
-STATIC void
-S_del_xpv(pTHX_ XPV *p)
+void
+Perl_del_xpv(pTHX_ XPV *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpv_root;
@@ -1088,8 +1088,8 @@
/* grab a new struct xpviv from the free list, allocating more if necessary */
-STATIC XPVIV*
-S_new_xpviv(pTHX)
+XPVIV*
+Perl_new_xpviv(pTHX)
{
XPVIV* xpviv;
LOCK_SV_MUTEX;
@@ -1103,8 +1103,8 @@
/* return a struct xpviv to the free list */
-STATIC void
-S_del_xpviv(pTHX_ XPVIV *p)
+void
+Perl_del_xpviv(pTHX_ XPVIV *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpviv_root;
@@ -1134,8 +1134,8 @@
/* grab a new struct xpvnv from the free list, allocating more if necessary */
-STATIC XPVNV*
-S_new_xpvnv(pTHX)
+XPVNV*
+Perl_new_xpvnv(pTHX)
{
XPVNV* xpvnv;
LOCK_SV_MUTEX;
@@ -1149,8 +1149,8 @@
/* return a struct xpvnv to the free list */
-STATIC void
-S_del_xpvnv(pTHX_ XPVNV *p)
+void
+Perl_del_xpvnv(pTHX_ XPVNV *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpvnv_root;
@@ -1180,8 +1180,8 @@
/* grab a new struct xpvcv from the free list, allocating more if necessary */
-STATIC XPVCV*
-S_new_xpvcv(pTHX)
+XPVCV*
+Perl_new_xpvcv(pTHX)
{
XPVCV* xpvcv;
LOCK_SV_MUTEX;
@@ -1195,8 +1195,8 @@
/* return a struct xpvcv to the free list */
-STATIC void
-S_del_xpvcv(pTHX_ XPVCV *p)
+void
+Perl_del_xpvcv(pTHX_ XPVCV *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpvcv_root;
@@ -1226,8 +1226,8 @@
/* grab a new struct xpvav from the free list, allocating more if necessary */
-STATIC XPVAV*
-S_new_xpvav(pTHX)
+XPVAV*
+Perl_new_xpvav(pTHX)
{
XPVAV* xpvav;
LOCK_SV_MUTEX;
@@ -1241,8 +1241,8 @@
/* return a struct xpvav to the free list */
-STATIC void
-S_del_xpvav(pTHX_ XPVAV *p)
+void
+Perl_del_xpvav(pTHX_ XPVAV *p)
{
LOCK_SV_MUTEX;
p->xav_array = (char*)PL_xpvav_root;
@@ -1272,8 +1272,8 @@
/* grab a new struct xpvhv from the free list, allocating more if necessary */
-STATIC XPVHV*
-S_new_xpvhv(pTHX)
+XPVHV*
+Perl_new_xpvhv(pTHX)
{
XPVHV* xpvhv;
LOCK_SV_MUTEX;
@@ -1287,8 +1287,8 @@
/* return a struct xpvhv to the free list */
-STATIC void
-S_del_xpvhv(pTHX_ XPVHV *p)
+void
+Perl_del_xpvhv(pTHX_ XPVHV *p)
{
LOCK_SV_MUTEX;
p->xhv_array = (char*)PL_xpvhv_root;
@@ -1318,8 +1318,8 @@
/* grab a new struct xpvmg from the free list, allocating more if necessary */
-STATIC XPVMG*
-S_new_xpvmg(pTHX)
+XPVMG*
+Perl_new_xpvmg(pTHX)
{
XPVMG* xpvmg;
LOCK_SV_MUTEX;
@@ -1333,8 +1333,8 @@
/* return a struct xpvmg to the free list */
-STATIC void
-S_del_xpvmg(pTHX_ XPVMG *p)
+void
+Perl_del_xpvmg(pTHX_ XPVMG *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpvmg_root;
@@ -1364,8 +1364,8 @@
/* grab a new struct xpvlv from the free list, allocating more if necessary */
-STATIC XPVLV*
-S_new_xpvlv(pTHX)
+XPVLV*
+Perl_new_xpvlv(pTHX)
{
XPVLV* xpvlv;
LOCK_SV_MUTEX;
@@ -1379,8 +1379,8 @@
/* return a struct xpvlv to the free list */
-STATIC void
-S_del_xpvlv(pTHX_ XPVLV *p)
+void
+Perl_del_xpvlv(pTHX_ XPVLV *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpvlv_root;
@@ -1410,8 +1410,8 @@
/* grab a new struct xpvbm from the free list, allocating more if necessary */
-STATIC XPVBM*
-S_new_xpvbm(pTHX)
+XPVBM*
+Perl_new_xpvbm(pTHX)
{
XPVBM* xpvbm;
LOCK_SV_MUTEX;
@@ -1425,8 +1425,8 @@
/* return a struct xpvbm to the free list */
-STATIC void
-S_del_xpvbm(pTHX_ XPVBM *p)
+void
+Perl_del_xpvbm(pTHX_ XPVBM *p)
{
LOCK_SV_MUTEX;
p->xpv_pv = (char*)PL_xpvbm_root;
@@ -1526,35 +1526,35 @@
#define new_XPVIO() (void*)new_xpvio()
#define del_XPVIO(p) del_xpvio((XPVIO *)p)
-STATIC XPVGV *
-S_new_xpvgv(pTHX)
+XPVGV *
+Perl_new_xpvgv(pTHX)
{
return my_safemalloc(sizeof(XPVGV));
}
-STATIC void
-S_del_xpvgv(pTHX_ XPVGV *fm)
+void
+Perl_del_xpvgv(pTHX_ XPVGV *fm)
{
my_safefree(fm);
}
-STATIC XPVFM *
-S_new_xpvfm(pTHX)
+XPVFM *
+Perl_new_xpvfm(pTHX)
{
return my_safemalloc(sizeof(XPVFM));
}
-STATIC void
-S_del_xpvfm(pTHX_ XPVFM *fm)
+void
+Perl_del_xpvfm(pTHX_ XPVFM *fm)
{
my_safefree(fm);
}
-STATIC XPVIO *
-S_new_xpvio(pTHX)
+XPVIO *
+Perl_new_xpvio(pTHX)
{
return my_safemalloc(sizeof(XPVIO));
}
-STATIC void
-S_del_xpvio(pTHX_ XPVIO*io)
+void
+Perl_del_xpvio(pTHX_ XPVIO*io)
{
my_safefree(io);
}
@@ -1771,21 +1771,21 @@
void
-S_zero_xpvfm(pTHX_ SV *fm)
+Perl_zero_xpvfm(pTHX_ SV *fm)
{
assert(SvPMC(fm));
Zero(/**/ SvANY(fm), 1, XPVFM);
}
void
-S_zero_xpvio(pTHX_ SV *io)
+Perl_zero_xpvio(pTHX_ SV *io)
{
assert(SvPMC(io));
Zero(/**/ SvANY(io), 1, XPVIO);
}
void
-S_zero_xpvcv(pTHX_ SV *fm)
+Perl_zero_xpvcv(pTHX_ SV *fm)
{
assert(SvPMC(fm));
Zero(/**/ SvANY(fm), 1, XPVCV);
@@ -1805,371 +1805,8 @@
bool
Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt)
{
- char* pv;
- SV* rv;
- U32 cur;
- U32 len;
- IV iv;
- NV nv;
- MAGIC* magic;
- HV* stash;
- int sv_is_rv;
-
- if (mt != SVt_PV && SvIsCOW(sv)) {
- sv_force_normal_flags(sv, 0);
- }
-
- if (SvTYPE(sv) == mt)
- return TRUE;
-
- sv_is_rv = SvROK(sv);
-
- if (mt < SVt_PVIV)
- (void)SvOOK_off(sv);
-
- pv = NULL;
- rv = NULL;
- cur = 0;
- len = 0;
- iv = 0;
- nv = 0.0;
- magic = NULL;
- stash = Nullhv;
-
- switch (SvTYPE(sv)) {
- case SVt_NULL:
- break;
- case SVt_IV:
- iv = SvIVX(sv);
- assert(SvANY(sv) == 0);
- SvPMC_off(sv);
- if (mt == SVt_NV)
- mt = SVt_PVNV;
- else if (mt < SVt_PVIV)
- mt = SVt_PVIV;
- break;
- case SVt_NV:
- nv = SvNVX(sv);
- magic = 0;
- stash = 0;
- assert(SvANY(sv) == 0);
- SvPMC_off(sv);
- if (mt < SVt_PVNV)
- mt = SVt_PVNV;
- break;
- case SVt_RV:
- rv = SvRV(sv);
- assert(SvANY(sv) == 0);
- SvPMC_off(sv);
- break;
- case SVt_PV:
- if (sv_is_rv) {
- rv = SvRV(sv);
- } else {
- pv = SvPVX(sv);
- }
- cur = SvCUR(sv);
- len = SvLEN(sv);
- del_XPV(SvANY(sv));
- SvPMC_off(sv);
- if (mt <= SVt_IV)
- mt = SVt_PVIV;
- else if (mt == SVt_NV)
- mt = SVt_PVNV;
- break;
- case SVt_PVIV:
- if (sv_is_rv) {
- rv = SvRV(sv);
- } else {
- pv = SvPVX(sv);
- }
- cur = SvCUR(sv);
- len = SvLEN(sv);
- iv = SvIVX(sv);
- del_XPVIV(SvANY(sv));
- SvPMC_off(sv);
- break;
- case SVt_PVNV:
- if (sv_is_rv) {
- rv = SvRV(sv);
- } else {
- pv = SvPVX(sv);
- }
- cur = SvCUR(sv);
- len = SvLEN(sv);
- iv = SvIVX(sv);
- nv = SvNVX(sv);
- del_XPVNV(SvANY(sv));
- SvPMC_off(sv);
- break;
- case SVt_PVMG:
- if (sv_is_rv) {
- rv = SvRV(sv);
- } else {
- pv = SvPVX(sv);
- }
- cur = SvCUR(sv);
- len = SvLEN(sv);
- iv = SvIVX(sv);
- nv = SvNVX(sv);
- magic = SvMAGIC(sv);
- stash = SvSTASH(sv);
- del_XPVMG(SvANY(sv));
- SvPMC_off(sv);
- break;
- default:
- Perl_croak(aTHX_ "Can't upgrade that kind of scalar");
- }
-
- SvFLAGS(sv) &= ~SVTYPEMASK;
- SvFLAGS(sv) |= mt;
-
- switch (mt) {
- case SVt_NULL:
- Perl_croak(aTHX_ "Can't upgrade to undef");
- case SVt_IV:
- SvANY(sv) = 0;
- SvPMC_on(sv);
- SvIV_set(sv, iv);
- break;
- case SVt_NV:
- SvANY(sv) = 0;
- SvPMC_on(sv);
- SvNV_set(sv, nv);
- break;
- case SVt_RV:
- SvANY(sv) = 0;
- SvPMC_on(sv);
- SvRV_set(sv, rv);
- break;
- case SVt_PV:
- SvANY(sv) = new_XPV();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- break;
- case SVt_PVIV:
- SvANY(sv) = new_XPVIV();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- if (SvNIOK(sv))
- (void)SvIOK_on(sv);
- SvNOK_off(sv);
- break;
- case SVt_PVNV:
- SvANY(sv) = new_XPVNV();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- break;
- case SVt_PVMG:
- SvANY(sv) = new_XPVMG();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- break;
- case SVt_PVLV:
- SvANY(sv) = new_XPVLV();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- LvTARGOFF(sv) = 0;
- LvTARGLEN(sv) = 0;
- LvTARG(sv) = 0;
- LvTYPE(sv) = 0;
- GvGP(sv) = 0;
- GvNAME(sv) = 0;
- GvNAMELEN(sv) = 0;
- GvSTASH(sv) = 0;
- GvFLAGS(sv) = 0;
- break;
- case SVt_PVAV:
- SvANY(sv) = new_XPVAV();
- if (pv)
- Safefree(pv);
- if (sv_is_rv) {
- /* XXX need more paranoia here? */
- SvRV_set(sv, 0);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, (char*)0);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- AvMAX(sv) = -1;
- AvFILLp(sv) = -1;
- SvIV_set(sv, 0);
- SvNV_set(sv, 0.0);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- AvALLOC(sv) = 0;
- AvARYLEN(sv) = 0;
- AvFLAGS(sv) = AVf_REAL;
- break;
- case SVt_PVHV:
- SvANY(sv) = new_XPVHV();
- if (pv)
- Safefree(pv);
- if (sv_is_rv) {
- /* XXX need more paranoia here? */
- SvRV_set(sv, 0);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, (char*)0);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- HvFILL(sv) = 0;
- HvMAX(sv) = 0;
- HvTOTALKEYS(sv) = 0;
- HvPLACEHOLDERS(sv) = 0;
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- HvRITER(sv) = 0;
- HvEITER(sv) = 0;
- HvPMROOT(sv) = 0;
- HvNAME(sv) = 0;
- break;
- case SVt_PVCV:
- SvANY(sv) = new_XPVCV();
- SvPMC_on(sv);
- zero_xpvcv(sv);
- assert (!sv_is_rv);
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- break;
- case SVt_PVGV:
- SvANY(sv) = new_XPVGV();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- GvGP(sv) = 0;
- GvNAME(sv) = 0;
- GvNAMELEN(sv) = 0;
- GvSTASH(sv) = 0;
- GvFLAGS(sv) = 0;
- break;
- case SVt_PVBM:
- SvANY(sv) = new_XPVBM();
- SvPMC_on(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- BmRARE(sv) = 0;
- BmUSEFUL(sv) = 0;
- BmPREVIOUS(sv) = 0;
- break;
- case SVt_PVFM:
- SvANY(sv) = new_XPVFM();
- SvPMC_on(sv);
- zero_xpvfm(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- break;
- case SVt_PVIO:
- SvANY(sv) = new_XPVIO();
- SvPMC_on(sv);
- zero_xpvio(sv);
- if (sv_is_rv) {
- SvRV_set(sv, rv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_PVX_0, 0);
- } else {
- SvPV_set(sv, pv);
- Parrot_PMC_set_pointer_intkey(PL_Parrot,MUMBLE(sv), Ponie_P_RVX_0, 0);
- }
- SvCUR_set(sv, cur);
- SvLEN_set(sv, len);
- SvIV_set(sv, iv);
- SvNV_set(sv, nv);
- SvMAGIC_set(sv, magic);
- SvSTASH_set(sv, stash);
- IoPAGE_LEN(sv) = 60;
- break;
- }
- SvTYPE_set(sv, mt);
+ Parrot_PMC_set_intval_intkey(PL_Parrot,MUMBLE(sv), Ponie_I_SV_UPGRADE_func,
+ mt);
return TRUE;
}
1.67 +2 -1 ponie/perl/sv.h
Index: sv.h
===================================================================
RCS file: /cvs/public/ponie/perl/sv.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- sv.h 19 Apr 2005 21:23:13 -0000 1.66
+++ sv.h 23 Apr 2005 16:52:41 -0000 1.67
@@ -244,7 +244,8 @@
typedef enum {
Ponie_I_SV_TYPE,
- Ponie_I_SV_UPGRADE,
+ Ponie_I_SV_UPGRADE, /* Does the macro version with the < type test. */
+ Ponie_I_SV_UPGRADE_func, /* Unconditional - direct call to sv_upgrade */
Ponie_I_SV_ZERO_FLAGS_SET_TYPE,
Ponie_I_SV_FLAGS, /* Read only */
Ponie_I_SVf_BREAK,
1.4 +6 -6 ponie/perl/ext/ByteLoader/byterun.c
Index: byterun.c
===================================================================
RCS file: /cvs/public/ponie/perl/ext/ByteLoader/byterun.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- byterun.c 19 Apr 2005 17:05:45 -0000 1.3
+++ byterun.c 23 Apr 2005 16:52:42 -0000 1.4
@@ -216,7 +216,7 @@
{
svindex arg;
BGET_svindex(arg);
- SvRV_set(bstate->bs_sv, arg);
+ SvRV(bstate->bs_sv) = arg;
break;
}
case INSN_XPV: /* 22 */
@@ -224,32 +224,32 @@
BSET_xpv(bstate->bs_sv);
break;
}
- case INSN_XPV_CUR: /* 23 */
+ case INSN_XPV_CUR: /* 23 */
{
STRLEN arg;
BGET_PADOFFSET(arg);
- SvCUR_set(bstate->bs_sv, arg);
+ SvCUR(bstate->bs_sv) = arg;
break;
}
case INSN_XPV_LEN: /* 24 */
{
STRLEN arg;
BGET_PADOFFSET(arg);
- SvLEN_set(bstate->bs_sv, arg);
+ SvLEN(bstate->bs_sv) = arg;
break;
}
case INSN_XIV: /* 25 */
{
IV arg;
BGET_IV(arg);
- SvIV_set(bstate->bs_sv, arg);
+ SvIVX(bstate->bs_sv) = arg;
break;
}
case INSN_XNV: /* 26 */
{
NV arg;
BGET_NV(arg);
- SvNV_set(bstate->bs_sv, arg);
+ SvNVX(bstate->bs_sv) = arg;
break;
}
case INSN_XLV_TARGOFF: /* 27 */
1.2 +70 -11 ponie/perl/pod/perlintern.pod
Index: perlintern.pod
===================================================================
RCS file: /cvs/public/ponie/perl/pod/perlintern.pod,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- perlintern.pod 9 Sep 2003 11:59:45 -0000 1.1
+++ perlintern.pod 23 Apr 2005 16:52:42 -0000 1.2
@@ -135,6 +135,16 @@
=for hackers
Found in file pad.h
+=item PAD_COMPNAME_GEN_set
+
+Sets the generation number of the name at offset C<po> in the current
+ling pad (lvalue) to C<gen>. Note that C<SvCUR_set> is hijacked for this purpose.
+
+ STRLEN PAD_COMPNAME_GEN_set(PADOFFSET po, int gen)
+
+=for hackers
+Found in file pad.h
+
=item PAD_COMPNAME_OURSTASH
Return the stash associated with an C<our> variable.
@@ -221,6 +231,15 @@
=for hackers
Found in file pad.h
+=item PAD_SET_CUR_NOSAVE
+
+like PAD_SET_CUR, but without the save
+
+ void PAD_SET_CUR_NOSAVE (PADLIST padlist, I32 n)
+
+=for hackers
+Found in file pad.h
+
=item PAD_SV
Get the value at offset C<po> in the current pad
@@ -288,7 +307,7 @@
If db_seqp is non_null, skip CVs that are in the DB package and populate
*db_seqp with the cop sequence number at the point that the DB:: code was
entered. (allows debuggers to eval in the scope of the breakpoint rather
-than in in the scope of the debuger itself).
+than in in the scope of the debugger itself).
CV* find_runcv(U32 *db_seqp)
@@ -391,7 +410,20 @@
C<flags> is not used at present but available for future extension to
allow selecting particular classes of magical variable.
- bool is_gv_magical(char *name, STRLEN len, U32 flags)
+Currently assumes that C<name> is NUL terminated (as well as len being valid).
+This assumption is met by all callers within the perl core, which all pass
+pointers returned by SvPV.
+
+ bool is_gv_magical(const char *name, STRLEN len, U32 flags)
+
+=for hackers
+Found in file gv.c
+
+=item is_gv_magical_sv
+
+Returns C<TRUE> if given the name of a magical GV. Calls is_gv_magical.
+
+ bool is_gv_magical_sv(SV *name, U32 flags)
=for hackers
Found in file gv.c
@@ -492,6 +524,12 @@
Note that formats are treated as anon subs, and are cloned each time
write is called (if necessary).
+The flag SVf_PADSTALE is cleared on lexicals each time the my() is executed,
+and set on scope exit. This allows the 'Variable $x is not available' warning
+to be generated in evals, such as
+
+ { my $x = 1; sub f { eval '$x'} } f();
+
AV * CvPADLIST(CV *cv)
=for hackers
@@ -512,7 +550,7 @@
dump the contents of a CV
- void cv_dump(CV *cv, char *title)
+ void cv_dump(const CV *cv, const char *title)
=for hackers
Found in file pad.c
@@ -555,7 +593,7 @@
If fake, it means we're cloning an existing entry
- PADOFFSET pad_add_name(char *name, HV* typestash, HV* ourstash, bool clone)
+ PADOFFSET pad_add_name(const char *name, HV* typestash, HV* ourstash, bool clone)
=for hackers
Found in file pad.c
@@ -588,7 +626,7 @@
as C<ourstash>
C<is_our> indicates that the name to check is an 'our' declaration
- void pad_check_dup(char* name, bool is_our, HV* ourstash)
+ void pad_check_dup(const char* name, bool is_our, const HV* ourstash)
=for hackers
Found in file pad.c
@@ -612,7 +650,7 @@
because fake namesvs in anon protoypes have to store in NVX the index into
the parent pad.
- PADOFFSET pad_findlex(char *name, CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags)
+ PADOFFSET pad_findlex(const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags)
=for hackers
Found in file pad.c
@@ -625,7 +663,7 @@
then a fake entry is added to the current pad.
Returns the offset in the current pad, or NOT_IN_PAD on failure.
- PADOFFSET pad_findmy(char* name)
+ PADOFFSET pad_findmy(const char* name)
=for hackers
Found in file pad.c
@@ -678,10 +716,10 @@
=item pad_push
Push a new pad frame onto the padlist, unless there's already a pad at
-this depth, in which case don't bother creating a new one.
-If has_args is true, give the new pad an @_ in slot zero.
+this depth, in which case don't bother creating a new one. Then give
+the new pad an @_ in slot zero.
- void pad_push(PADLIST *padlist, int depth, int has_args)
+ void pad_push(PADLIST *padlist, int depth)
=for hackers
Found in file pad.c
@@ -776,11 +814,32 @@
=over 8
+=item find_uninit_var
+
+Find the name of the undefined variable (if any) that caused the operator o
+to issue a "Use of uninitialized value" warning.
+If match is true, only return a name if it's value matches uninit_sv.
+So roughly speaking, if a unary operator (such as OP_COS) generates a
+warning, then following the direct child of the op may yield an
+OP_PADSV or OP_GV that gives the name of the undefined variable. On the
+other hand, with OP_ADD there are two branches to follow, so we only print
+the variable name if we get an exact match.
+
+The name is returned as a mortal SV.
+
+Assumes that PL_op is the op that originally triggered the error, and that
+PL_comppad/PL_curpad points to the currently executing pad.
+
+ SV* find_uninit_var(OP* obase, SV* uninit_sv, bool top)
+
+=for hackers
+Found in file sv.c
+
=item report_uninit
Print appropriate "Use of uninitialized variable" warning
- void report_uninit()
+ void report_uninit(SV* uninit_sv)
=for hackers
Found in file sv.c