move PL_tokenbuf into the PL_parser struct
authorDave Mitchell <davem@fdisolutions.com>
Mon, 21 May 2007 19:57:24 +0000 (19:57 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Mon, 21 May 2007 19:57:24 +0000 (19:57 +0000)
p4raw-id: //depot/perl@31252

embedvar.h
intrpvar.h
parser.h
perlapi.h
sv.c
toke.c
utf8.c

index 3ba2bfd..1272bfc 100644 (file)
 #define PL_tmps_ix             (vTHX->Itmps_ix)
 #define PL_tmps_max            (vTHX->Itmps_max)
 #define PL_tmps_stack          (vTHX->Itmps_stack)
-#define PL_tokenbuf            (vTHX->Itokenbuf)
 #define PL_top_env             (vTHX->Itop_env)
 #define PL_toptarget           (vTHX->Itoptarget)
 #define PL_uid                 (vTHX->Iuid)
 #define PL_Itmps_ix            PL_tmps_ix
 #define PL_Itmps_max           PL_tmps_max
 #define PL_Itmps_stack         PL_tmps_stack
-#define PL_Itokenbuf           PL_tokenbuf
 #define PL_Itop_env            PL_top_env
 #define PL_Itoptarget          PL_toptarget
 #define PL_Iuid                        PL_uid
index 3a171a6..77e455f 100644 (file)
@@ -431,8 +431,6 @@ PERLVARI(Imaxo,     int,    MAXO)           /* maximum number of ops */
 
 PERLVARI(Irunops,      runops_proc_t,  MEMBER_TO_FPTR(RUNOPS_DEFAULT))
 
-PERLVARA(Itokenbuf,256,        char)
-
 /*
 =for apidoc Amn|SV|PL_sv_undef
 This is the C<undef> SV.  Always refer to this as C<&PL_sv_undef>.
index f481cac..271d35a 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -100,6 +100,7 @@ typedef struct yy_parser {
 #endif
 
     COP                *saved_curcop;  /* the previous PL_curcop */
+    char       tokenbuf[256];
 
 } yy_parser;
     
index 7007543..a45571c 100644 (file)
--- a/perlapi.h
+++ b/perlapi.h
@@ -680,8 +680,6 @@ END_EXTERN_C
 #define PL_tmps_max            (*Perl_Itmps_max_ptr(aTHX))
 #undef  PL_tmps_stack
 #define PL_tmps_stack          (*Perl_Itmps_stack_ptr(aTHX))
-#undef  PL_tokenbuf
-#define PL_tokenbuf            (*Perl_Itokenbuf_ptr(aTHX))
 #undef  PL_top_env
 #define PL_top_env             (*Perl_Itop_env_ptr(aTHX))
 #undef  PL_toptarget
diff --git a/sv.c b/sv.c
index 2be8768..c614632 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -9609,6 +9609,8 @@ Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
        parser->bufend      = ls + SvCUR(parser->linestr);
     }
 
+    Copy(proto->tokenbuf, parser->tokenbuf, 256, char);
+
 
 #ifdef PERL_MAD
     parser->endwhite   = proto->endwhite;
@@ -11257,8 +11259,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
 
     PL_runops          = proto_perl->Irunops;
 
-    Copy(proto_perl->Itokenbuf, PL_tokenbuf, 256, char);
-
 #ifdef CSH
     PL_cshlen          = proto_perl->Icshlen;
     PL_cshname         = proto_perl->Icshname; /* XXX never deallocated */
diff --git a/toke.c b/toke.c
index e00a464..ef1c6a5 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -65,6 +65,7 @@
 #define PL_rsfp_filters                (PL_parser->rsfp_filters)
 #define PL_in_my               (PL_parser->in_my)
 #define PL_in_my_stash         (PL_parser->in_my_stash)
+#define PL_tokenbuf            (PL_parser->tokenbuf)
 
 #ifdef PERL_MAD
 #  define PL_endwhite          (PL_parser->endwhite)
diff --git a/utf8.c b/utf8.c
index e6cbd48..f5e8649 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1556,7 +1556,6 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
 {
     dVAR;
     SV* retval;
-    SV* const tokenbufsv = sv_newmortal();
     dSP;
     const size_t pkg_len = strlen(pkg);
     const size_t name_len = strlen(name);
@@ -1594,9 +1593,6 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
     PUSHs(sv_2mortal(newSViv(minbits)));
     PUSHs(sv_2mortal(newSViv(none)));
     PUTBACK;
-    if (IN_PERL_COMPILETIME) {
-       sv_setpv(tokenbufsv, PL_tokenbuf);
-    }
     errsv_save = newSVsv(ERRSV);
     if (call_method("SWASHNEW", G_SCALAR))
        retval = newSVsv(*PL_stack_sp--);
@@ -1608,10 +1604,6 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
     LEAVE;
     POPSTACK;
     if (IN_PERL_COMPILETIME) {
-       STRLEN len;
-       const char* const pv = SvPV_const(tokenbufsv, len);
-
-       Copy(pv, PL_tokenbuf, len+1, char);
        CopHINTS_set(PL_curcop, PL_hints);
     }
     if (!SvROK(retval) || SvTYPE(SvRV(retval)) != SVt_PVHV) {