diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2007-05-21 19:57:24 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-05-21 19:57:24 +0000 |
commit | 14047fc9aecf45824605bc7cab225fa40118f1cc (patch) | |
tree | 646094a65acda92772a2330525a9159b4c25097e | |
parent | e37659a3d616afed86fb8f0e0699e900ad4d59b7 (diff) | |
download | perl-14047fc9aecf45824605bc7cab225fa40118f1cc.tar.gz |
move PL_tokenbuf into the PL_parser struct
p4raw-id: //depot/perl@31252
-rw-r--r-- | embedvar.h | 2 | ||||
-rw-r--r-- | intrpvar.h | 2 | ||||
-rw-r--r-- | parser.h | 1 | ||||
-rw-r--r-- | perlapi.h | 2 | ||||
-rw-r--r-- | sv.c | 4 | ||||
-rw-r--r-- | toke.c | 1 | ||||
-rw-r--r-- | utf8.c | 8 |
7 files changed, 4 insertions, 16 deletions
diff --git a/embedvar.h b/embedvar.h index 3ba2bfd3e8..1272bfcf2b 100644 --- a/embedvar.h +++ b/embedvar.h @@ -322,7 +322,6 @@ #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) @@ -644,7 +643,6 @@ #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 diff --git a/intrpvar.h b/intrpvar.h index 3a171a6acf..77e455fcfd 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -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>. @@ -100,6 +100,7 @@ typedef struct yy_parser { #endif COP *saved_curcop; /* the previous PL_curcop */ + char tokenbuf[256]; } yy_parser; @@ -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 @@ -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 */ @@ -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) @@ -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) { |