diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-03-08 13:40:48 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-03-08 13:40:48 +0000 |
commit | 1dba731d9f7b0a03b8cecb69b9d80500a283425e (patch) | |
tree | 8ef86d80db20e147b6170a449e303a7b1c1c194d | |
parent | 69f571849d518b6e7953b40abe5d05d244a0d6f9 (diff) | |
download | perl-1dba731d9f7b0a03b8cecb69b9d80500a283425e.tar.gz |
Add MAD changes to pad code (new function Perl_pad_peg)
p4raw-id: //depot/perl@27419
-rw-r--r-- | embed.fnc | 3 | ||||
-rw-r--r-- | embed.h | 10 | ||||
-rw-r--r-- | makedef.pl | 1 | ||||
-rw-r--r-- | pad.c | 10 | ||||
-rw-r--r-- | pad.h | 6 | ||||
-rw-r--r-- | proto.h | 5 |
6 files changed, 34 insertions, 1 deletions
@@ -1646,6 +1646,9 @@ px |void |my_clearenv Apo |void* |my_cxt_init |NN int *index|size_t size #endif +#ifdef PERL_MAD +Mnp |void |pad_peg |NN const char* s +#endif END_EXTERN_C /* @@ -1721,6 +1721,11 @@ #endif #ifdef PERL_IMPLICIT_CONTEXT #endif +#ifdef PERL_MAD +#ifdef PERL_CORE +#define pad_peg Perl_pad_peg +#endif +#endif #define ck_anoncode Perl_ck_anoncode #define ck_bitop Perl_ck_bitop #define ck_chdir Perl_ck_chdir @@ -3796,6 +3801,11 @@ #endif #ifdef PERL_IMPLICIT_CONTEXT #endif +#ifdef PERL_MAD +#ifdef PERL_CORE +#define pad_peg Perl_pad_peg +#endif +#endif #define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a) #define ck_bitop(a) Perl_ck_bitop(aTHX_ a) #define ck_chdir(a) Perl_ck_chdir(aTHX_ a) diff --git a/makedef.pl b/makedef.pl index 241365db8d..4d9abf115b 100644 --- a/makedef.pl +++ b/makedef.pl @@ -841,6 +841,7 @@ unless ($define{'PERL_MAD'}) { skip_symbols [qw( PL_madskills PL_xmlfp + Perl_pad_peg )]; } @@ -113,7 +113,12 @@ to be generated in evals, such as #define PAD_MAX 999999999 - +#ifdef PERL_MAD +void pad_peg(const char* s) { + static int pegcnt; + pegcnt++; +} +#endif /* =for apidoc pad_new @@ -233,6 +238,7 @@ Perl_pad_undef(pTHX_ CV* cv) I32 ix; const PADLIST * const padlist = CvPADLIST(cv); + pad_peg("pad_undef"); if (!padlist) return; if (SvIS_FREED(padlist)) /* may be during global destruction */ @@ -468,6 +474,7 @@ Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type) dVAR; PADOFFSET ix; SV* const name = newSV(0); + pad_peg("add_anon"); sv_upgrade(name, SVt_PVNV); sv_setpvn(name, "&", 1); SvIV_set(name, -1); @@ -584,6 +591,7 @@ Perl_pad_findmy(pTHX_ const char *name) const AV *nameav; SV **name_svp; + pad_peg("pad_findmy"); offset = pad_findlex(name, PL_compcv, PL_cop_seqmax, 1, NULL, &out_sv, &out_flags); if (offset != NOT_IN_PAD) @@ -50,14 +50,20 @@ typedef enum { * whether PL_comppad and PL_curpad are consistent and whether they have * active values */ +#ifndef PERL_MAD +# define pad_peg(label) +#endif + #ifdef DEBUGGING # define ASSERT_CURPAD_LEGAL(label) \ + pad_peg(label); \ if (PL_comppad ? (AvARRAY(PL_comppad) != PL_curpad) : (PL_curpad != 0)) \ Perl_croak(aTHX_ "panic: illegal pad in %s: 0x%"UVxf"[0x%"UVxf"]",\ label, PTR2UV(PL_comppad), PTR2UV(PL_curpad)); # define ASSERT_CURPAD_ACTIVE(label) \ + pad_peg(label); \ if (!PL_comppad || (AvARRAY(PL_comppad) != PL_curpad)) \ Perl_croak(aTHX_ "panic: invalid pad in %s: 0x%"UVxf"[0x%"UVxf"]",\ label, PTR2UV(PL_comppad), PTR2UV(PL_curpad)); @@ -4268,6 +4268,11 @@ PERL_CALLCONV void* Perl_my_cxt_init(pTHX_ int *index, size_t size) #endif +#ifdef PERL_MAD +PERL_CALLCONV void Perl_pad_peg(const char* s) + __attribute__nonnull__(1); + +#endif END_EXTERN_C /* |