Discussion:
Change 29655: move easy lexer state variables into PL_parser
(too old to reply)
Dave Mitchell
2007-01-02 02:00:05 UTC
Permalink
Change 29655 by ***@davem-splatty on 2007/01/02 01:51:05

move easy lexer state variables into PL_parser
(where "easy" == "only appear in toke.c")

Affected files ...

... //depot/perl/embed.fnc#440 edit
... //depot/perl/embed.h#649 edit
... //depot/perl/embedvar.h#234 edit
... //depot/perl/intrpvar.h#189 edit
... //depot/perl/parser.h#4 edit
... //depot/perl/perl.h#749 edit
... //depot/perl/perlapi.h#156 edit
... //depot/perl/perly.c#104 edit
... //depot/perl/proto.h#780 edit
... //depot/perl/sv.c#1342 edit
... //depot/perl/toke.c#726 edit

Differences ...

==== //depot/perl/embed.fnc#440 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#439~29652~ 2007-01-01 14:37:40.000000000 -0800
+++ perl/embed.fnc 2007-01-01 17:51:05.000000000 -0800
@@ -957,6 +957,7 @@
p |int |yylex
p |int |yyparse
p |void |parser_free |NN const yy_parser *
+p |yy_parser*|parser_dup |NN const yy_parser *proto|NN CLONE_PARAMS* param
p |int |yywarn |NN const char* s
#if defined(MYMALLOC)
Ap |void |dump_mstats |NN char* s

==== //depot/perl/embed.h#649 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#648~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/embed.h 2007-01-01 17:51:05.000000000 -0800
@@ -977,6 +977,7 @@
#define yylex Perl_yylex
#define yyparse Perl_yyparse
#define parser_free Perl_parser_free
+#define parser_dup Perl_parser_dup
#define yywarn Perl_yywarn
#endif
#if defined(MYMALLOC)
@@ -3185,6 +3186,7 @@
#define yylex() Perl_yylex(aTHX)
#define yyparse() Perl_yyparse(aTHX)
#define parser_free(a) Perl_parser_free(aTHX_ a)
+#define parser_dup(a,b) Perl_parser_dup(aTHX_ a,b)
#define yywarn(a) Perl_yywarn(aTHX_ a)
#endif
#if defined(MYMALLOC)

==== //depot/perl/embedvar.h#234 (text+w) ====
Index: perl/embedvar.h
--- perl/embedvar.h#233~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/embedvar.h 2007-01-01 17:51:05.000000000 -0800
@@ -195,7 +195,6 @@
#define PL_egid (vTHX->Iegid)
#define PL_encoding (vTHX->Iencoding)
#define PL_endav (vTHX->Iendav)
-#define PL_endwhite (vTHX->Iendwhite)
#define PL_envgv (vTHX->Ienvgv)
#define PL_errgv (vTHX->Ierrgv)
#define PL_error_count (vTHX->Ierror_count)
@@ -207,7 +206,6 @@
#define PL_exitlist (vTHX->Iexitlist)
#define PL_exitlistlen (vTHX->Iexitlistlen)
#define PL_expect (vTHX->Iexpect)
-#define PL_faketokens (vTHX->Ifaketokens)
#define PL_fdpid (vTHX->Ifdpid)
#define PL_filemode (vTHX->Ifilemode)
#define PL_forkprocess (vTHX->Iforkprocess)
@@ -241,22 +239,7 @@
#define PL_lastfd (vTHX->Ilastfd)
#define PL_laststatval (vTHX->Ilaststatval)
#define PL_laststype (vTHX->Ilaststype)
-#define PL_lasttoke (vTHX->Ilasttoke)
-#define PL_lex_brackets (vTHX->Ilex_brackets)
-#define PL_lex_brackstack (vTHX->Ilex_brackstack)
-#define PL_lex_casemods (vTHX->Ilex_casemods)
-#define PL_lex_casestack (vTHX->Ilex_casestack)
-#define PL_lex_defer (vTHX->Ilex_defer)
-#define PL_lex_dojoin (vTHX->Ilex_dojoin)
-#define PL_lex_expect (vTHX->Ilex_expect)
-#define PL_lex_formbrack (vTHX->Ilex_formbrack)
-#define PL_lex_inpat (vTHX->Ilex_inpat)
-#define PL_lex_inwhat (vTHX->Ilex_inwhat)
-#define PL_lex_op (vTHX->Ilex_op)
-#define PL_lex_repl (vTHX->Ilex_repl)
-#define PL_lex_starts (vTHX->Ilex_starts)
#define PL_lex_state (vTHX->Ilex_state)
-#define PL_lex_stuff (vTHX->Ilex_stuff)
#define PL_lineary (vTHX->Ilineary)
#define PL_linestart (vTHX->Ilinestart)
#define PL_linestr (vTHX->Ilinestr)
@@ -280,17 +263,13 @@
#define PL_minus_n (vTHX->Iminus_n)
#define PL_minus_p (vTHX->Iminus_p)
#define PL_modglobal (vTHX->Imodglobal)
-#define PL_multi_close (vTHX->Imulti_close)
#define PL_multi_end (vTHX->Imulti_end)
-#define PL_multi_open (vTHX->Imulti_open)
-#define PL_multi_start (vTHX->Imulti_start)
#define PL_my_cxt_keys (vTHX->Imy_cxt_keys)
#define PL_my_cxt_list (vTHX->Imy_cxt_list)
#define PL_my_cxt_size (vTHX->Imy_cxt_size)
#define PL_nexttoke (vTHX->Inexttoke)
#define PL_nexttype (vTHX->Inexttype)
#define PL_nextval (vTHX->Inextval)
-#define PL_nextwhite (vTHX->Inextwhite)
#define PL_nice_chunk (vTHX->Inice_chunk)
#define PL_nice_chunk_size (vTHX->Inice_chunk_size)
#define PL_nomemok (vTHX->Inomemok)
@@ -315,21 +294,18 @@
#define PL_padix_floor (vTHX->Ipadix_floor)
#define PL_parser (vTHX->Iparser)
#define PL_patchlevel (vTHX->Ipatchlevel)
-#define PL_pending_ident (vTHX->Ipending_ident)
#define PL_perl_destruct_level (vTHX->Iperl_destruct_level)
#define PL_perldb (vTHX->Iperldb)
#define PL_perlio (vTHX->Iperlio)
#define PL_pidstatus (vTHX->Ipidstatus)
#define PL_ppid (vTHX->Ippid)
#define PL_preambleav (vTHX->Ipreambleav)
-#define PL_preambled (vTHX->Ipreambled)
#define PL_preprocess (vTHX->Ipreprocess)
#define PL_profiledata (vTHX->Iprofiledata)
#define PL_psig_name (vTHX->Ipsig_name)
#define PL_psig_pend (vTHX->Ipsig_pend)
#define PL_psig_ptr (vTHX->Ipsig_ptr)
#define PL_ptr_table (vTHX->Iptr_table)
-#define PL_realtokenstart (vTHX->Irealtokenstart)
#define PL_reentrant_buffer (vTHX->Ireentrant_buffer)
#define PL_reentrant_retint (vTHX->Ireentrant_retint)
#define PL_regex_pad (vTHX->Iregex_pad)
@@ -348,7 +324,6 @@
#define PL_sig_pending (vTHX->Isig_pending)
#define PL_sighandlerp (vTHX->Isighandlerp)
#define PL_signals (vTHX->Isignals)
-#define PL_skipwhite (vTHX->Iskipwhite)
#define PL_sort_RealCmp (vTHX->Isort_RealCmp)
#define PL_splitstr (vTHX->Isplitstr)
#define PL_srand_called (vTHX->Isrand_called)
@@ -360,7 +335,6 @@
#define PL_stdingv (vTHX->Istdingv)
#define PL_strtab (vTHX->Istrtab)
#define PL_sub_generation (vTHX->Isub_generation)
-#define PL_sublex_info (vTHX->Isublex_info)
#define PL_subline (vTHX->Isubline)
#define PL_subname (vTHX->Isubname)
#define PL_sv_arenaroot (vTHX->Isv_arenaroot)
@@ -373,12 +347,6 @@
#define PL_sys_intern (vTHX->Isys_intern)
#define PL_taint_warn (vTHX->Itaint_warn)
#define PL_tainting (vTHX->Itainting)
-#define PL_thisclose (vTHX->Ithisclose)
-#define PL_thismad (vTHX->Ithismad)
-#define PL_thisopen (vTHX->Ithisopen)
-#define PL_thisstuff (vTHX->Ithisstuff)
-#define PL_thistoken (vTHX->Ithistoken)
-#define PL_thiswhite (vTHX->Ithiswhite)
#define PL_threadhook (vTHX->Ithreadhook)
#define PL_tokenbuf (vTHX->Itokenbuf)
#define PL_uid (vTHX->Iuid)
@@ -493,7 +461,6 @@
#define PL_Iegid PL_egid
#define PL_Iencoding PL_encoding
#define PL_Iendav PL_endav
-#define PL_Iendwhite PL_endwhite
#define PL_Ienvgv PL_envgv
#define PL_Ierrgv PL_errgv
#define PL_Ierror_count PL_error_count
@@ -505,7 +472,6 @@
#define PL_Iexitlist PL_exitlist
#define PL_Iexitlistlen PL_exitlistlen
#define PL_Iexpect PL_expect
-#define PL_Ifaketokens PL_faketokens
#define PL_Ifdpid PL_fdpid
#define PL_Ifilemode PL_filemode
#define PL_Iforkprocess PL_forkprocess
@@ -539,22 +505,7 @@
#define PL_Ilastfd PL_lastfd
#define PL_Ilaststatval PL_laststatval
#define PL_Ilaststype PL_laststype
-#define PL_Ilasttoke PL_lasttoke
-#define PL_Ilex_brackets PL_lex_brackets
-#define PL_Ilex_brackstack PL_lex_brackstack
-#define PL_Ilex_casemods PL_lex_casemods
-#define PL_Ilex_casestack PL_lex_casestack
-#define PL_Ilex_defer PL_lex_defer
-#define PL_Ilex_dojoin PL_lex_dojoin
-#define PL_Ilex_expect PL_lex_expect
-#define PL_Ilex_formbrack PL_lex_formbrack
-#define PL_Ilex_inpat PL_lex_inpat
-#define PL_Ilex_inwhat PL_lex_inwhat
-#define PL_Ilex_op PL_lex_op
-#define PL_Ilex_repl PL_lex_repl
-#define PL_Ilex_starts PL_lex_starts
#define PL_Ilex_state PL_lex_state
-#define PL_Ilex_stuff PL_lex_stuff
#define PL_Ilineary PL_lineary
#define PL_Ilinestart PL_linestart
#define PL_Ilinestr PL_linestr
@@ -578,17 +529,13 @@
#define PL_Iminus_n PL_minus_n
#define PL_Iminus_p PL_minus_p
#define PL_Imodglobal PL_modglobal
-#define PL_Imulti_close PL_multi_close
#define PL_Imulti_end PL_multi_end
-#define PL_Imulti_open PL_multi_open
-#define PL_Imulti_start PL_multi_start
#define PL_Imy_cxt_keys PL_my_cxt_keys
#define PL_Imy_cxt_list PL_my_cxt_list
#define PL_Imy_cxt_size PL_my_cxt_size
#define PL_Inexttoke PL_nexttoke
#define PL_Inexttype PL_nexttype
#define PL_Inextval PL_nextval
-#define PL_Inextwhite PL_nextwhite
#define PL_Inice_chunk PL_nice_chunk
#define PL_Inice_chunk_size PL_nice_chunk_size
#define PL_Inomemok PL_nomemok
@@ -613,21 +560,18 @@
#define PL_Ipadix_floor PL_padix_floor
#define PL_Iparser PL_parser
#define PL_Ipatchlevel PL_patchlevel
-#define PL_Ipending_ident PL_pending_ident
#define PL_Iperl_destruct_level PL_perl_destruct_level
#define PL_Iperldb PL_perldb
#define PL_Iperlio PL_perlio
#define PL_Ipidstatus PL_pidstatus
#define PL_Ippid PL_ppid
#define PL_Ipreambleav PL_preambleav
-#define PL_Ipreambled PL_preambled
#define PL_Ipreprocess PL_preprocess
#define PL_Iprofiledata PL_profiledata
#define PL_Ipsig_name PL_psig_name
#define PL_Ipsig_pend PL_psig_pend
#define PL_Ipsig_ptr PL_psig_ptr
#define PL_Iptr_table PL_ptr_table
-#define PL_Irealtokenstart PL_realtokenstart
#define PL_Ireentrant_buffer PL_reentrant_buffer
#define PL_Ireentrant_retint PL_reentrant_retint
#define PL_Iregex_pad PL_regex_pad
@@ -646,7 +590,6 @@
#define PL_Isig_pending PL_sig_pending
#define PL_Isighandlerp PL_sighandlerp
#define PL_Isignals PL_signals
-#define PL_Iskipwhite PL_skipwhite
#define PL_Isort_RealCmp PL_sort_RealCmp
#define PL_Isplitstr PL_splitstr
#define PL_Isrand_called PL_srand_called
@@ -658,7 +601,6 @@
#define PL_Istdingv PL_stdingv
#define PL_Istrtab PL_strtab
#define PL_Isub_generation PL_sub_generation
-#define PL_Isublex_info PL_sublex_info
#define PL_Isubline PL_subline
#define PL_Isubname PL_subname
#define PL_Isv_arenaroot PL_sv_arenaroot
@@ -671,12 +613,6 @@
#define PL_Isys_intern PL_sys_intern
#define PL_Itaint_warn PL_taint_warn
#define PL_Itainting PL_tainting
-#define PL_Ithisclose PL_thisclose
-#define PL_Ithismad PL_thismad
-#define PL_Ithisopen PL_thisopen
-#define PL_Ithisstuff PL_thisstuff
-#define PL_Ithistoken PL_thistoken
-#define PL_Ithiswhite PL_thiswhite
#define PL_Ithreadhook PL_threadhook
#define PL_Itokenbuf PL_tokenbuf
#define PL_Iuid PL_uid

==== //depot/perl/intrpvar.h#189 (text) ====
Index: perl/intrpvar.h
--- perl/intrpvar.h#188~29650~ 2007-01-01 07:41:48.000000000 -0800
+++ perl/intrpvar.h 2007-01-01 17:51:05.000000000 -0800
@@ -173,7 +173,6 @@
PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */
PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */
PERLVARI(Igensym, I32, 0) /* next symbol for getsym() to define */
-PERLVAR(Ipreambled, bool)
PERLVAR(Ipreambleav, AV *)
PERLVARI(Ilaststatval, int, -1)
PERLVARI(Ilaststype, I32, OP_STAT)
@@ -227,8 +226,6 @@
PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */

PERLVAR(Ilinestart, char *) /* beg. of most recently read line */
-PERLVAR(Ipending_ident, char) /* pending identifier lookup */
-PERLVAR(Isublex_info, SUBLEXINFO) /* from toke.c */

PERLVAR(Iuid, Uid_t) /* current real user id */
PERLVAR(Ieuid, Uid_t) /* current effective user id */
@@ -282,36 +279,10 @@
#endif

PERLVAR(Ilex_state, U32) /* next token is determined */
-PERLVAR(Ilex_defer, U32) /* state after determined token */
-PERLVAR(Ilex_expect, int) /* expect after determined token */
-PERLVAR(Ilex_brackets, I32) /* bracket count */
-PERLVAR(Ilex_formbrack, I32) /* bracket count at outer format level */
-PERLVAR(Ilex_casemods, I32) /* casemod count */
-PERLVAR(Ilex_dojoin, I32) /* doing an array interpolation */
-PERLVAR(Ilex_starts, I32) /* how many interps done on level */
-PERLVAR(Ilex_stuff, SV *) /* runtime pattern from m// or s/// */
-PERLVAR(Ilex_repl, SV *) /* runtime replacement from s/// */
-PERLVAR(Ilex_op, OP *) /* extra info to pass back on op */
-PERLVAR(Ilex_inpat, OP *) /* in pattern $) and $| are special */
-PERLVAR(Ilex_inwhat, I32) /* what kind of quoting are we in */
-PERLVAR(Ilex_brackstack,char *) /* what kind of brackets to pop */
-PERLVAR(Ilex_casestack, char *) /* what kind of case mods in effect */

/* What we know when we're in LEX_KNOWNEXT state. */
#ifdef PERL_MAD
PERLVARA(Inexttoke,5, NEXTTOKE) /* value of next token, if any */
-PERLVAR(Ilasttoke, I32)
-PERLVAR(Irealtokenstart,I32)
-PERLVAR(Ifaketokens, I32)
-PERLVAR(Ithismad, MADPROP *)
-PERLVAR(Ithistoken, SV *)
-PERLVAR(Ithisopen, SV *)
-PERLVAR(Ithisstuff, SV *)
-PERLVAR(Ithisclose, SV *)
-PERLVAR(Ithiswhite, SV *)
-PERLVAR(Inextwhite, SV *)
-PERLVAR(Iskipwhite, SV *)
-PERLVAR(Iendwhite, SV *)
PERLVAR(Icurforce, I32)
#else
PERLVARA(Inextval,5, YYSTYPE) /* value of next token, if any */
@@ -326,10 +297,7 @@
PERLVAR(Ibufend, char *)
PERLVARI(Iexpect,int, XSTATE) /* how to interpret ambiguous tokens */

-PERLVAR(Imulti_start, I32) /* 1st line of multi-line string */
PERLVAR(Imulti_end, I32) /* last line of multi-line string */
-PERLVAR(Imulti_open, I32) /* delimiter of said string */
-PERLVAR(Imulti_close, I32) /* delimiter of said string */

PERLVAR(Ierror_count, I32) /* how many errors so far, max 10 */
PERLVAR(Isubline, I32) /* line this subroutine began on */

==== //depot/perl/parser.h#4 (text) ====
Index: perl/parser.h
--- perl/parser.h#3~29652~ 2007-01-01 14:37:40.000000000 -0800
+++ perl/parser.h 2007-01-01 17:51:05.000000000 -0800
@@ -21,6 +21,9 @@
} yy_stack_frame;

typedef struct yy_parser {
+
+ /* parser state */
+
struct yy_parser *old_parser; /* previous value of PL_parser */
int yychar; /* The lookahead symbol. */
YYSTYPE yylval; /* value of lookahead symbol, set by yylex() */
@@ -32,6 +35,44 @@
int yylen; /* length of active reduction */
yy_stack_frame *stack; /* base of stack */
yy_stack_frame *ps; /* current stack frame */
+
+ /* lexer state */
+
+ I32 lex_brackets; /* bracket count */
+ I32 lex_casemods; /* casemod count */
+ char *lex_brackstack;/* what kind of brackets to pop */
+ char *lex_casestack; /* what kind of case mods in effect */
+ U32 lex_defer; /* state after determined token */
+ I32 lex_dojoin; /* doing an array interpolation */
+ int lex_expect; /* expect after determined token */
+ I32 lex_formbrack; /* bracket count at outer format level */
+ OP *lex_inpat; /* in pattern $) and $| are special */
+ I32 lex_inwhat; /* what kind of quoting are we in */
+ OP *lex_op; /* extra info to pass back on op */
+ SV *lex_repl; /* runtime replacement from s/// */
+ I32 lex_starts; /* how many interps done on level */
+ SV *lex_stuff; /* runtime pattern from m// or s/// */
+ I32 multi_start; /* 1st line of multi-line string */
+ I32 multi_open; /* delimiter of said string */
+ I32 multi_close; /* delimiter of said string */
+ char pending_ident; /* pending identifier lookup */
+ bool preambled;
+ SUBLEXINFO sublex_info;
+
+#ifdef PERL_MAD
+ SV *endwhite;
+ I32 faketokens;
+ I32 lasttoke;
+ SV *nextwhite;
+ I32 realtokenstart;
+ SV *skipwhite;
+ SV *thisclose;
+ MADPROP * thismad;
+ SV *thisopen;
+ SV *thisstuff;
+ SV *thistoken;
+ SV *thiswhite;
+#endif
} yy_parser;



==== //depot/perl/perl.h#749 (text) ====
Index: perl/perl.h
--- perl/perl.h#748~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/perl.h 2007-01-01 17:51:05.000000000 -0800
@@ -3242,7 +3242,6 @@
# define YYTOKENTYPE
#endif
#include "perly.h"
-#include "parser.h"

#ifdef PERL_MAD
struct nexttoken {
@@ -3279,6 +3278,8 @@
char *super_bufend; /* PL_bufend that was */
};

+#include "parser.h"
+
typedef struct magic_state MGS; /* struct magic_state defined in mg.c */

struct scan_data_t; /* Used in S_* functions in regcomp.c */

==== //depot/perl/perlapi.h#156 (text+w) ====
Index: perl/perlapi.h
--- perl/perlapi.h#155~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/perlapi.h 2007-01-01 17:51:05.000000000 -0800
@@ -268,8 +268,6 @@
#define PL_encoding (*Perl_Iencoding_ptr(aTHX))
#undef PL_endav
#define PL_endav (*Perl_Iendav_ptr(aTHX))
-#undef PL_endwhite
-#define PL_endwhite (*Perl_Iendwhite_ptr(aTHX))
#undef PL_envgv
#define PL_envgv (*Perl_Ienvgv_ptr(aTHX))
#undef PL_errgv
@@ -292,8 +290,6 @@
#define PL_exitlistlen (*Perl_Iexitlistlen_ptr(aTHX))
#undef PL_expect
#define PL_expect (*Perl_Iexpect_ptr(aTHX))
-#undef PL_faketokens
-#define PL_faketokens (*Perl_Ifaketokens_ptr(aTHX))
#undef PL_fdpid
#define PL_fdpid (*Perl_Ifdpid_ptr(aTHX))
#undef PL_filemode
@@ -360,38 +356,8 @@
#define PL_laststatval (*Perl_Ilaststatval_ptr(aTHX))
#undef PL_laststype
#define PL_laststype (*Perl_Ilaststype_ptr(aTHX))
-#undef PL_lasttoke
-#define PL_lasttoke (*Perl_Ilasttoke_ptr(aTHX))
-#undef PL_lex_brackets
-#define PL_lex_brackets (*Perl_Ilex_brackets_ptr(aTHX))
-#undef PL_lex_brackstack
-#define PL_lex_brackstack (*Perl_Ilex_brackstack_ptr(aTHX))
-#undef PL_lex_casemods
-#define PL_lex_casemods (*Perl_Ilex_casemods_ptr(aTHX))
-#undef PL_lex_casestack
-#define PL_lex_casestack (*Perl_Ilex_casestack_ptr(aTHX))
-#undef PL_lex_defer
-#define PL_lex_defer (*Perl_Ilex_defer_ptr(aTHX))
-#undef PL_lex_dojoin
-#define PL_lex_dojoin (*Perl_Ilex_dojoin_ptr(aTHX))
-#undef PL_lex_expect
-#define PL_lex_expect (*Perl_Ilex_expect_ptr(aTHX))
-#undef PL_lex_formbrack
-#define PL_lex_formbrack (*Perl_Ilex_formbrack_ptr(aTHX))
-#undef PL_lex_inpat
-#define PL_lex_inpat (*Perl_Ilex_inpat_ptr(aTHX))
-#undef PL_lex_inwhat
-#define PL_lex_inwhat (*Perl_Ilex_inwhat_ptr(aTHX))
-#undef PL_lex_op
-#define PL_lex_op (*Perl_Ilex_op_ptr(aTHX))
-#undef PL_lex_repl
-#define PL_lex_repl (*Perl_Ilex_repl_ptr(aTHX))
-#undef PL_lex_starts
-#define PL_lex_starts (*Perl_Ilex_starts_ptr(aTHX))
#undef PL_lex_state
#define PL_lex_state (*Perl_Ilex_state_ptr(aTHX))
-#undef PL_lex_stuff
-#define PL_lex_stuff (*Perl_Ilex_stuff_ptr(aTHX))
#undef PL_lineary
#define PL_lineary (*Perl_Ilineary_ptr(aTHX))
#undef PL_linestart
@@ -438,14 +404,8 @@
#define PL_minus_p (*Perl_Iminus_p_ptr(aTHX))
#undef PL_modglobal
#define PL_modglobal (*Perl_Imodglobal_ptr(aTHX))
-#undef PL_multi_close
-#define PL_multi_close (*Perl_Imulti_close_ptr(aTHX))
#undef PL_multi_end
#define PL_multi_end (*Perl_Imulti_end_ptr(aTHX))
-#undef PL_multi_open
-#define PL_multi_open (*Perl_Imulti_open_ptr(aTHX))
-#undef PL_multi_start
-#define PL_multi_start (*Perl_Imulti_start_ptr(aTHX))
#undef PL_my_cxt_keys
#define PL_my_cxt_keys (*Perl_Imy_cxt_keys_ptr(aTHX))
#undef PL_my_cxt_list
@@ -458,8 +418,6 @@
#define PL_nexttype (*Perl_Inexttype_ptr(aTHX))
#undef PL_nextval
#define PL_nextval (*Perl_Inextval_ptr(aTHX))
-#undef PL_nextwhite
-#define PL_nextwhite (*Perl_Inextwhite_ptr(aTHX))
#undef PL_nice_chunk
#define PL_nice_chunk (*Perl_Inice_chunk_ptr(aTHX))
#undef PL_nice_chunk_size
@@ -508,8 +466,6 @@
#define PL_parser (*Perl_Iparser_ptr(aTHX))
#undef PL_patchlevel
#define PL_patchlevel (*Perl_Ipatchlevel_ptr(aTHX))
-#undef PL_pending_ident
-#define PL_pending_ident (*Perl_Ipending_ident_ptr(aTHX))
#undef PL_perl_destruct_level
#define PL_perl_destruct_level (*Perl_Iperl_destruct_level_ptr(aTHX))
#undef PL_perldb
@@ -522,8 +478,6 @@
#define PL_ppid (*Perl_Ippid_ptr(aTHX))
#undef PL_preambleav
#define PL_preambleav (*Perl_Ipreambleav_ptr(aTHX))
-#undef PL_preambled
-#define PL_preambled (*Perl_Ipreambled_ptr(aTHX))
#undef PL_preprocess
#define PL_preprocess (*Perl_Ipreprocess_ptr(aTHX))
#undef PL_profiledata
@@ -536,8 +490,6 @@
#define PL_psig_ptr (*Perl_Ipsig_ptr_ptr(aTHX))
#undef PL_ptr_table
#define PL_ptr_table (*Perl_Iptr_table_ptr(aTHX))
-#undef PL_realtokenstart
-#define PL_realtokenstart (*Perl_Irealtokenstart_ptr(aTHX))
#undef PL_reentrant_buffer
#define PL_reentrant_buffer (*Perl_Ireentrant_buffer_ptr(aTHX))
#undef PL_reentrant_retint
@@ -574,8 +526,6 @@
#define PL_sighandlerp (*Perl_Isighandlerp_ptr(aTHX))
#undef PL_signals
#define PL_signals (*Perl_Isignals_ptr(aTHX))
-#undef PL_skipwhite
-#define PL_skipwhite (*Perl_Iskipwhite_ptr(aTHX))
#undef PL_sort_RealCmp
#define PL_sort_RealCmp (*Perl_Isort_RealCmp_ptr(aTHX))
#undef PL_splitstr
@@ -598,8 +548,6 @@
#define PL_strtab (*Perl_Istrtab_ptr(aTHX))
#undef PL_sub_generation
#define PL_sub_generation (*Perl_Isub_generation_ptr(aTHX))
-#undef PL_sublex_info
-#define PL_sublex_info (*Perl_Isublex_info_ptr(aTHX))
#undef PL_subline
#define PL_subline (*Perl_Isubline_ptr(aTHX))
#undef PL_subname
@@ -624,18 +572,6 @@
#define PL_taint_warn (*Perl_Itaint_warn_ptr(aTHX))
#undef PL_tainting
#define PL_tainting (*Perl_Itainting_ptr(aTHX))
-#undef PL_thisclose
-#define PL_thisclose (*Perl_Ithisclose_ptr(aTHX))
-#undef PL_thismad
-#define PL_thismad (*Perl_Ithismad_ptr(aTHX))
-#undef PL_thisopen
-#define PL_thisopen (*Perl_Ithisopen_ptr(aTHX))
-#undef PL_thisstuff
-#define PL_thisstuff (*Perl_Ithisstuff_ptr(aTHX))
-#undef PL_thistoken
-#define PL_thistoken (*Perl_Ithistoken_ptr(aTHX))
-#undef PL_thiswhite
-#define PL_thiswhite (*Perl_Ithiswhite_ptr(aTHX))
#undef PL_threadhook
#define PL_threadhook (*Perl_Ithreadhook_ptr(aTHX))
#undef PL_tokenbuf

==== //depot/perl/perly.c#104 (text) ====
Index: perl/perly.c
--- perl/perly.c#103~29652~ 2007-01-01 14:37:40.000000000 -0800
+++ perl/perly.c 2007-01-01 17:51:05.000000000 -0800
@@ -195,7 +195,7 @@
yy_stack_frame *ps = parser->ps;
int i;

- if (ps == parser->stack)
+ if (!parser->stack || ps == parser->stack)
return;

YYDPRINTF ((Perl_debug_log, "clearing the parse stack\n"));

==== //depot/perl/proto.h#780 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#779~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/proto.h 2007-01-01 17:51:05.000000000 -0800
@@ -2600,6 +2600,10 @@
PERL_CALLCONV void Perl_parser_free(pTHX_ const yy_parser *)
__attribute__nonnull__(pTHX_1);

+PERL_CALLCONV yy_parser* Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+
PERL_CALLCONV int Perl_yywarn(pTHX_ const char* s)
__attribute__nonnull__(pTHX_1);


==== //depot/perl/sv.c#1342 (text) ====
Index: perl/sv.c
--- perl/sv.c#1341~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/sv.c 2007-01-01 17:51:05.000000000 -0800
@@ -9479,6 +9479,70 @@
#define SAVEPV(p) ((p) ? savepv(p) : NULL)
#define SAVEPVN(p,n) ((p) ? savepvn(p,n) : NULL)

+/* clone a parser */
+
+yy_parser *
+Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+{
+ yy_parser *parser;
+
+ if (!proto)
+ return NULL;
+
+ Newxz(parser, 1, yy_parser);
+
+ parser->yyerrstatus = 0;
+ parser->yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* XXX these not yet duped */
+ parser->old_parser = NULL;
+ parser->stack = NULL;
+ parser->ps = NULL;
+ parser->stack_size = 0;
+ /* XXX parser->stack->state = 0; */
+
+ /* XXX eventually, just Copy() most of the parser struct ? */
+
+ parser->lex_brackets = proto->lex_brackets;
+ parser->lex_casemods = proto->lex_casemods;
+ parser->lex_brackstack = savepvn(proto->lex_brackstack,
+ (proto->lex_brackets < 120 ? 120 : proto->lex_brackets));
+ parser->lex_casestack = savepvn(proto->lex_casestack,
+ (proto->lex_casemods < 12 ? 12 : proto->lex_casemods));
+ parser->lex_defer = proto->lex_defer;
+ parser->lex_dojoin = proto->lex_dojoin;
+ parser->lex_expect = proto->lex_expect;
+ parser->lex_formbrack = proto->lex_formbrack;
+ parser->lex_inpat = proto->lex_inpat;
+ parser->lex_inwhat = proto->lex_inwhat;
+ parser->lex_op = proto->lex_op;
+ parser->lex_repl = sv_dup_inc(proto->lex_repl, param);
+ parser->lex_starts = proto->lex_starts;
+ parser->lex_stuff = sv_dup_inc(proto->lex_stuff, param);
+ parser->multi_close = proto->multi_close;
+ parser->multi_open = proto->multi_open;
+ parser->multi_start = proto->multi_start;
+ parser->pending_ident = proto->pending_ident;
+ parser->preambled = proto->preambled;
+ parser->sublex_info = proto->sublex_info; /* XXX not quite right */
+
+#ifdef PERL_MAD
+ parser->endwhite = proto->endwhite;
+ parser->faketokens = proto->faketokens;
+ parser->lasttoke = proto->lasttoke;
+ parser->nextwhite = proto->nextwhite;
+ parser->realtokenstart = proto->realtokenstart;
+ parser->skipwhite = proto->skipwhite;
+ parser->thisclose = proto->thisclose;
+ parser->thismad = proto->thismad;
+ parser->thisopen = proto->thisopen;
+ parser->thisstuff = proto->thisstuff;
+ parser->thistoken = proto->thistoken;
+ parser->thiswhite = proto->thiswhite;
+#endif
+ return parser;
+}
+

/* duplicate a file handle */

@@ -11022,7 +11086,6 @@
PL_Argv = NULL;
PL_Cmd = NULL;
PL_gensym = proto_perl->Igensym;
- PL_preambled = proto_perl->Ipreambled;
PL_preambleav = av_dup_inc(proto_perl->Ipreambleav, param);
PL_laststatval = proto_perl->Ilaststatval;
PL_laststype = proto_perl->Ilaststype;
@@ -11102,38 +11165,12 @@
PL_cshname = proto_perl->Icshname; /* XXX never deallocated */
#endif

+ PL_parser = parser_dup(proto_perl->Iparser, param);
+
PL_lex_state = proto_perl->Ilex_state;
- PL_lex_defer = proto_perl->Ilex_defer;
- PL_lex_expect = proto_perl->Ilex_expect;
- PL_lex_formbrack = proto_perl->Ilex_formbrack;
- PL_lex_dojoin = proto_perl->Ilex_dojoin;
- PL_lex_starts = proto_perl->Ilex_starts;
- PL_lex_stuff = sv_dup_inc(proto_perl->Ilex_stuff, param);
- PL_lex_repl = sv_dup_inc(proto_perl->Ilex_repl, param);
- PL_lex_op = proto_perl->Ilex_op;
- PL_lex_inpat = proto_perl->Ilex_inpat;
- PL_lex_inwhat = proto_perl->Ilex_inwhat;
- PL_lex_brackets = proto_perl->Ilex_brackets;
- i = (PL_lex_brackets < 120 ? 120 : PL_lex_brackets);
- PL_lex_brackstack = SAVEPVN(proto_perl->Ilex_brackstack,i);
- PL_lex_casemods = proto_perl->Ilex_casemods;
- i = (PL_lex_casemods < 12 ? 12 : PL_lex_casemods);
- PL_lex_casestack = SAVEPVN(proto_perl->Ilex_casestack,i);

#ifdef PERL_MAD
Copy(proto_perl->Inexttoke, PL_nexttoke, 5, NEXTTOKE);
- PL_lasttoke = proto_perl->Ilasttoke;
- PL_realtokenstart = proto_perl->Irealtokenstart;
- PL_faketokens = proto_perl->Ifaketokens;
- PL_thismad = proto_perl->Ithismad;
- PL_thistoken = proto_perl->Ithistoken;
- PL_thisopen = proto_perl->Ithisopen;
- PL_thisstuff = proto_perl->Ithisstuff;
- PL_thisclose = proto_perl->Ithisclose;
- PL_thiswhite = proto_perl->Ithiswhite;
- PL_nextwhite = proto_perl->Inextwhite;
- PL_skipwhite = proto_perl->Iskipwhite;
- PL_endwhite = proto_perl->Iendwhite;
PL_curforce = proto_perl->Icurforce;
#else
Copy(proto_perl->Inextval, PL_nextval, 5, YYSTYPE);
@@ -11151,15 +11188,10 @@
i = proto_perl->Ilinestart - SvPVX_const(proto_perl->Ilinestr);
PL_linestart = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_pending_ident = proto_perl->Ipending_ident;
- PL_sublex_info = proto_perl->Isublex_info; /* XXX not quite right */

PL_expect = proto_perl->Iexpect;

- PL_multi_start = proto_perl->Imulti_start;
PL_multi_end = proto_perl->Imulti_end;
- PL_multi_open = proto_perl->Imulti_open;
- PL_multi_close = proto_perl->Imulti_close;

PL_error_count = proto_perl->Ierror_count;
PL_subline = proto_perl->Isubline;

==== //depot/perl/toke.c#726 (text) ====
Index: perl/toke.c
--- perl/toke.c#725~29654~ 2007-01-01 16:07:52.000000000 -0800
+++ perl/toke.c 2007-01-01 17:51:05.000000000 -0800
@@ -28,6 +28,44 @@
/* YYINITDEPTH -- initial size of the parser's stacks. */
#define YYINITDEPTH 200

+/* XXX temporary backwards compatibility */
+#define PL_lex_brackets (PL_parser->lex_brackets)
+#define PL_lex_brackstack (PL_parser->lex_brackstack)
+#define PL_lex_casemods (PL_parser->lex_casemods)
+#define PL_lex_casestack (PL_parser->lex_casestack)
+#define PL_lex_defer (PL_parser->lex_defer)
+#define PL_lex_dojoin (PL_parser->lex_dojoin)
+#define PL_lex_expect (PL_parser->lex_expect)
+#define PL_lex_formbrack (PL_parser->lex_formbrack)
+#define PL_lex_inpat (PL_parser->lex_inpat)
+#define PL_lex_inwhat (PL_parser->lex_inwhat)
+#define PL_lex_op (PL_parser->lex_op)
+#define PL_lex_repl (PL_parser->lex_repl)
+#define PL_lex_starts (PL_parser->lex_starts)
+#define PL_lex_stuff (PL_parser->lex_stuff)
+#define PL_multi_start (PL_parser->multi_start)
+#define PL_multi_open (PL_parser->multi_open)
+#define PL_multi_close (PL_parser->multi_close)
+#define PL_pending_ident (PL_parser->pending_ident)
+#define PL_preambled (PL_parser->preambled)
+#define PL_sublex_info (PL_parser->sublex_info)
+
+#ifdef PERL_MAD
+# define PL_endwhite (PL_parser->endwhite)
+# define PL_faketokens (PL_parser->faketokens)
+# define PL_lasttoke (PL_parser->lasttoke)
+# define PL_nextwhite (PL_parser->nextwhite)
+# define PL_realtokenstart (PL_parser->realtokenstart)
+# define PL_skipwhite (PL_parser->skipwhite)
+# define PL_thisclose (PL_parser->thisclose)
+# define PL_thismad (PL_parser->thismad)
+# define PL_thisopen (PL_parser->thisopen)
+# define PL_thisstuff (PL_parser->thisstuff)
+# define PL_thistoken (PL_parser->thistoken)
+# define PL_thiswhite (PL_parser->thiswhite)
+#endif
+
+
static const char ident_too_long[] = "Identifier too long";
static const char commaless_variable_list[] = "comma-less variable list";

@@ -571,6 +609,8 @@
}
#endif

+
+
/*
* Perl_lex_start
* Initialize variables. Uses the Perl save_stack to save its state (for
@@ -587,7 +627,7 @@

/* create and initialise a parser */

- Newx(parser, 1, yy_parser);
+ Newxz(parser, 1, yy_parser);
parser->old_parser = PL_parser;
PL_parser = parser;

@@ -601,35 +641,19 @@

/* initialise lexer state */

- SAVEI32(PL_lex_dojoin);
SAVEI32(PL_lex_brackets);
SAVEI32(PL_lex_casemods);
- SAVEI32(PL_lex_starts);
SAVEI32(PL_lex_state);
- SAVEVPTR(PL_lex_inpat);
- SAVEI32(PL_lex_inwhat);
#ifdef PERL_MAD
if (PL_lex_state == LEX_KNOWNEXT) {
- I32 toke = PL_lasttoke;
+ I32 toke = parser->old_parser->lasttoke;
while (--toke >= 0) {
SAVEI32(PL_nexttoke[toke].next_type);
SAVEVPTR(PL_nexttoke[toke].next_val);
if (PL_madskills)
SAVEVPTR(PL_nexttoke[toke].next_mad);
}
- SAVEI32(PL_lasttoke);
}
- SAVESPTR(PL_endwhite);
- SAVESPTR(PL_thistoken);
- SAVESPTR(PL_thiswhite);
- SAVESPTR(PL_nextwhite);
- SAVESPTR(PL_thisopen);
- SAVESPTR(PL_thisclose);
- SAVESPTR(PL_thisstuff);
- SAVEVPTR(PL_thismad);
- SAVEI32(PL_realtokenstart);
- SAVEI32(PL_faketokens);
- SAVESPTR(PL_skipwhite);
SAVEI32(PL_curforce);
#else
if (PL_lex_state == LEX_KNOWNEXT) {
@@ -650,70 +674,17 @@
SAVEPPTR(PL_last_uni);
SAVEPPTR(PL_linestart);
SAVESPTR(PL_linestr);
- SAVEGENERICPV(PL_lex_brackstack);
- SAVEGENERICPV(PL_lex_casestack);
SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp);
- SAVESPTR(PL_lex_stuff);
- SAVEI32(PL_lex_defer);
- SAVEI32(PL_sublex_info.sub_inwhat);
- SAVEI32(PL_sublex_info.super_state);
- SAVEVPTR(PL_sublex_info.sub_op);
- SAVEPPTR(PL_sublex_info.super_bufptr);
- SAVEPPTR(PL_sublex_info.super_bufend);
- SAVESPTR(PL_lex_repl);
SAVEINT(PL_expect);
- SAVEINT(PL_lex_expect);
- SAVEI32(PL_lex_formbrack);
- SAVEVPTR(PL_lex_op);
- SAVEI32(PL_multi_close);
- SAVEI32(PL_multi_open);
- SAVEI32(PL_multi_start);
- SAVEI8(PL_pending_ident);
- SAVEBOOL(PL_preambled);

PL_lex_state = LEX_NORMAL;
- PL_lex_defer = 0;
PL_expect = XSTATE;
- PL_lex_brackets = 0;
- Newx(PL_lex_brackstack, 120, char);
- Newx(PL_lex_casestack, 12, char);
- PL_lex_casemods = 0;
- *PL_lex_casestack = '\0';
- PL_lex_dojoin = 0;
- PL_lex_starts = 0;
- PL_lex_stuff = NULL;
- PL_lex_repl = NULL;
- PL_lex_inpat = 0;
-#ifdef PERL_MAD
- PL_lasttoke = 0;
- PL_endwhite = NULL;
- PL_faketokens = 0;
- PL_nextwhite = NULL;
- PL_realtokenstart = 0;
- PL_skipwhite = NULL;
- PL_thisclose = NULL;
- PL_thisopen = NULL;
- PL_thisstuff = NULL;
- PL_thistoken = NULL;
- PL_thiswhite = NULL;
- PL_thismad = NULL;
-#else
+ Newx(parser->lex_brackstack, 120, char);
+ Newx(parser->lex_casestack, 12, char);
+ *parser->lex_casestack = '\0';
+#ifndef PERL_MAD
PL_nexttoke = 0;
#endif
- PL_lex_inwhat = 0;
- PL_sublex_info.sub_inwhat = 0;
- PL_sublex_info.super_state = 0;
- PL_sublex_info.sub_op = NULL;
- PL_sublex_info.super_bufptr = NULL;
- PL_sublex_info.super_bufend = NULL;
- PL_lex_expect = 0;
- PL_lex_formbrack = 0;
- PL_lex_op = NULL;
- PL_multi_close = 0;
- PL_multi_open = 0;
- PL_multi_start = 0;
- PL_pending_ident = '\0';
- PL_preambled = FALSE;

if (line) {
s = SvPV_const(line, len);
End of Patch.
John E. Malmberg
2007-01-12 05:23:39 UTC
Permalink
Post by Dave Mitchell
move easy lexer state variables into PL_parser
(where "easy" == "only appear in toke.c")
Affected files ...
... //depot/perl/sv.c#1342 edit
==== //depot/perl/sv.c#1342 (text) ====
Index: perl/sv.c
--- perl/sv.c#1341~29653~ 2007-01-01 14:48:33.000000000 -0800
+++ perl/sv.c 2007-01-01 17:51:05.000000000 -0800
@@ -9479,6 +9479,70 @@
#define SAVEPV(p) ((p) ? savepv(p) : NULL)
#define SAVEPVN(p,n) ((p) ? savepvn(p,n) : NULL)
+/* clone a parser */
+
+yy_parser *
+Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+{
+ yy_parser *parser;
This change appears to have broken non-threaded builds on VMS.

The VMS build uses a routine that collects public symbols for export in
a shareable image, and that is finding Perl_parser_dup().

In a non-threaded build, the routine Perl_parser_dup is conditionally
compiled out, thus the symbol is not resolved at the link time for the
shared image.

I am not sure of the proper fix here, so I am CC: Craig Berry.

-John
***@qsl.network
Personal Opinion Only
Dave Mitchell
2007-01-12 11:16:41 UTC
Permalink
Post by John E. Malmberg
Post by Dave Mitchell
+yy_parser *
+Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+{
+ yy_parser *parser;
This change appears to have broken non-threaded builds on VMS.
The VMS build uses a routine that collects public symbols for export in
a shareable image, and that is finding Perl_parser_dup().
In a non-threaded build, the routine Perl_parser_dup is conditionally
compiled out, thus the symbol is not resolved at the link time for the
shared image.
I am not sure of the proper fix here, so I am CC: Craig Berry.
Nor am I, but but comparison with the similar Perl_fp_dup, I'm hoping that
the following change may fix it
--
The warp engines start playing up a bit, but seem to sort themselves out
after a while without any intervention from boy genius Wesley Crusher.
-- Things That Never Happen in "Star Trek" #17

Change 29766 by ***@davem-pigeon on 2007/01/12 11:13:49

fix PL_parser_dup symbol

Affected files ...

... //depot/perl/embed.fnc#447 edit
... //depot/perl/embed.h#655 edit
... //depot/perl/makedef.pl#214 edit

Differences ...

==== //depot/perl/embed.fnc#447 (text) ====

@@ -958,7 +958,6 @@
p |int |yylex
p |int |yyparse
p |void |parser_free |NN const yy_parser *
-p |yy_parser*|parser_dup |NN const yy_parser *proto|NN CLONE_PARAMS* param
p |int |yywarn |NN const char* s
#if defined(MYMALLOC)
Ap |void |dump_mstats |NN char* s
@@ -1058,6 +1057,7 @@
ApR |MAGIC* |mg_dup |NULLOK MAGIC* mg|NN CLONE_PARAMS* param
ApR |SV* |sv_dup |NULLOK const SV* sstr|NN CLONE_PARAMS* param
Ap |void |rvpv_dup |NN SV* dstr|NN const SV *sstr|NN CLONE_PARAMS* param
+p |yy_parser*|parser_dup |NN const yy_parser *proto|NN CLONE_PARAMS* param
#endif
Apa |PTR_TBL_t*|ptr_table_new
ApR |void* |ptr_table_fetch|NN PTR_TBL_t *tbl|NN const void *sv

==== //depot/perl/embed.h#655 (text+w) ====

@@ -978,7 +978,6 @@
#define yylex Perl_yylex
#define yyparse Perl_yyparse
#define parser_free Perl_parser_free
-#define parser_dup Perl_parser_dup
#define yywarn Perl_yywarn
#endif
#if defined(MYMALLOC)
@@ -1057,6 +1056,9 @@
#define mg_dup Perl_mg_dup
#define sv_dup Perl_sv_dup
#define rvpv_dup Perl_rvpv_dup
+#ifdef PERL_CORE
+#define parser_dup Perl_parser_dup
+#endif
#endif
#define ptr_table_new Perl_ptr_table_new
#define ptr_table_fetch Perl_ptr_table_fetch
@@ -3183,7 +3185,6 @@
#define yylex() Perl_yylex(aTHX)
#define yyparse() Perl_yyparse(aTHX)
#define parser_free(a) Perl_parser_free(aTHX_ a)
-#define parser_dup(a,b) Perl_parser_dup(aTHX_ a,b)
#define yywarn(a) Perl_yywarn(aTHX_ a)
#endif
#if defined(MYMALLOC)
@@ -3259,6 +3260,9 @@
#define mg_dup(a,b) Perl_mg_dup(aTHX_ a,b)
#define sv_dup(a,b) Perl_sv_dup(aTHX_ a,b)
#define rvpv_dup(a,b,c) Perl_rvpv_dup(aTHX_ a,b,c)
+#ifdef PERL_CORE
+#define parser_dup(a,b) Perl_parser_dup(aTHX_ a,b)
+#endif
#endif
#define ptr_table_new() Perl_ptr_table_new(aTHX)
#define ptr_table_fetch(a,b) Perl_ptr_table_fetch(aTHX_ a,b)

==== //depot/perl/makedef.pl#214 (text) ====

@@ -719,6 +719,7 @@
PL_hints_mutex
PL_perlio_mutex
PL_regdupe
+ Perl_parser_dup
Perl_dirp_dup
Perl_cx_dup
Perl_si_dup
John E. Malmberg
2007-01-12 15:18:30 UTC
Permalink
Post by Dave Mitchell
Post by John E. Malmberg
Post by Dave Mitchell
+yy_parser *
+Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+{
+ yy_parser *parser;
This change appears to have broken non-threaded builds on VMS.
The VMS build uses a routine that collects public symbols for export in
a shareable image, and that is finding Perl_parser_dup().
In a non-threaded build, the routine Perl_parser_dup is conditionally
compiled out, thus the symbol is not resolved at the link time for the
shared image.
I am not sure of the proper fix here, so I am CC: Craig Berry.
Nor am I, but but comparison with the similar Perl_fp_dup, I'm hoping that
the following change may fix it.
I am sorry to report that I am getting the same build error about the
undefined symbol Perl_parser_dup.

-John
***@qsl.network
Personal Opinion Only
John E. Malmberg
2007-01-12 20:01:37 UTC
Permalink
Post by Dave Mitchell
Post by John E. Malmberg
Post by Dave Mitchell
+yy_parser *
+Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+{
+ yy_parser *parser;
This change appears to have broken non-threaded builds on VMS.
The VMS build uses a routine that collects public symbols for export in a shareable image, and that is finding Perl_parser_dup().
In a non-threaded build, the routine Perl_parser_dup is conditionally compiled out, thus the symbol is not resolved at the link time for the shared image.
I am not sure of the proper fix here, so I am CC: Craig Berry.
Nor am I, but but comparison with the similar Perl_fp_dup, I'm hoping that
the following change may fix it.
I am sorry to report that I am getting the same build error about the undefined symbol Perl_parser_dup.
Actually Dave's patch gets us back in business if you also regen
headers by running regen.pl.
I am attempting to do so with miniperl, however it is giving me warnings
as I can not seem to get the "-I" list correct.

-John
***@qsl.net
Personal Opinion Only
Dave Mitchell
2007-01-12 22:00:51 UTC
Permalink
Post by John E. Malmberg
Actually Dave's patch gets us back in business if you also regen
headers by running regen.pl.
I am attempting to do so with miniperl, however it is giving me warnings
as I can not seem to get the "-I" list correct.
Three things:

* regen.pl can be run with any perl, not just the current one
I'm suprised that running regen.pl could make a difference; my previous

* change included (in theory) any files changed by regen.pl

* does the further change below fix it?
--
My Dad used to say 'always fight fire with fire', which is probably why
he got thrown out of the fire brigade.

Change 29780 by ***@davem-pigeon on 2007/01/12 21:49:13

fix PL_parser_dup symbol (again)

Affected files ...

... //depot/perl/embed.fnc#448 edit
... //depot/perl/embed.h#656 edit
... //depot/perl/global.sym#319 edit

Differences ...

==== //depot/perl/embed.fnc#448 (text) ====

@@ -1057,7 +1057,7 @@
ApR |MAGIC* |mg_dup |NULLOK MAGIC* mg|NN CLONE_PARAMS* param
ApR |SV* |sv_dup |NULLOK const SV* sstr|NN CLONE_PARAMS* param
Ap |void |rvpv_dup |NN SV* dstr|NN const SV *sstr|NN CLONE_PARAMS* param
-p |yy_parser*|parser_dup |NN const yy_parser *proto|NN CLONE_PARAMS* param
+Ap |yy_parser*|parser_dup |NN const yy_parser *proto|NN CLONE_PARAMS* param
#endif
Apa |PTR_TBL_t*|ptr_table_new
ApR |void* |ptr_table_fetch|NN PTR_TBL_t *tbl|NN const void *sv

==== //depot/perl/embed.h#656 (text+w) ====

@@ -1056,10 +1056,8 @@
#define mg_dup Perl_mg_dup
#define sv_dup Perl_sv_dup
#define rvpv_dup Perl_rvpv_dup
-#ifdef PERL_CORE
#define parser_dup Perl_parser_dup
#endif
-#endif
#define ptr_table_new Perl_ptr_table_new
#define ptr_table_fetch Perl_ptr_table_fetch
#define ptr_table_store Perl_ptr_table_store
@@ -3260,10 +3258,8 @@
#define mg_dup(a,b) Perl_mg_dup(aTHX_ a,b)
#define sv_dup(a,b) Perl_sv_dup(aTHX_ a,b)
#define rvpv_dup(a,b,c) Perl_rvpv_dup(aTHX_ a,b,c)
-#ifdef PERL_CORE
#define parser_dup(a,b) Perl_parser_dup(aTHX_ a,b)
#endif
-#endif
#define ptr_table_new() Perl_ptr_table_new(aTHX)
#define ptr_table_fetch(a,b) Perl_ptr_table_fetch(aTHX_ a,b)
#define ptr_table_store(a,b,c) Perl_ptr_table_store(aTHX_ a,b,c)

==== //depot/perl/global.sym#319 (text+w) ====

@@ -655,6 +655,7 @@
Perl_mg_dup
Perl_sv_dup
Perl_rvpv_dup
+Perl_parser_dup
Perl_ptr_table_new
Perl_ptr_table_fetch
Perl_ptr_table_store
John E. Malmberg
2007-01-12 22:32:19 UTC
Permalink
Post by Dave Mitchell
Post by John E. Malmberg
Actually Dave's patch gets us back in business if you also regen
headers by running regen.pl.
I am attempting to do so with miniperl, however it is giving me
warnings as I can not seem to get the "-I" list correct.
* regen.pl can be run with any perl, not just the current one
I'm suprised that running regen.pl could make a difference; my
previous
* change included (in theory) any files changed by regen.pl
Maybe I need to do some reading on using regen.pl. I finally got it to
run using miniperl by setting the logical name for finding the perl
libraries, because it appears to be running child subprocesses that were
not inheriting the library path list from the command line.

I am trying to build with the results now. Actually modified results,
as it appeared to build bad regnodes.h. This could mean that I missed
pulling a file down from blead.

I also noticed that a few of the files were missing the 2007 copyrights.

When I checked the other files, PROTO.H and PERLAPI.H were changed. I
restored the regnodes.h file from blead and restarted my build.

It has progressed beyond the failure point as I type this.
Post by Dave Mitchell
* does the further change below fix it?
I don't know. If this build succeeds, it will be several hours before I
see the results of the tests being run, and then I can sync up with
blead and try it again.

-John
***@qsl.network
Personal Opinion Only
Craig A. Berry
2007-01-12 22:46:05 UTC
Permalink
Post by Dave Mitchell
I'm suprised that running regen.pl could make a difference; my previous
* change included (in theory) any files changed by regen.pl
The difference I noticed was in proto.h. After the regen, the
Perl_parser_dup prototype was inside a block protected by #if
defined(USE_ITHREADS), so it was correctly excluded from the symbol
list in a non-threads build. It may be I only needed to run embed.pl.

The way we build the symbol list on VMS is by running perl.h through
the C preprocessor and rooting through the output, so if there's a
prototype for a function that's never defined we get in trouble.
Post by Dave Mitchell
* does the further change below fix it?
I haven't tried it but after eyeballing proto.h I still don't see the
necessary change. Your original patch (29655) did update proto.h,
but 29766 did not.
--
________________________________________
Craig A. Berry
mailto:***@mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser
Craig A. Berry
2007-01-12 19:52:20 UTC
Permalink
Post by Dave Mitchell
Post by John E. Malmberg
Post by Dave Mitchell
+yy_parser *
+Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+{
+ yy_parser *parser;
This change appears to have broken non-threaded builds on VMS.
The VMS build uses a routine that collects public symbols for export in a shareable image, and that is finding Perl_parser_dup().
In a non-threaded build, the routine Perl_parser_dup is conditionally compiled out, thus the symbol is not resolved at the link time for the shared image.
I am not sure of the proper fix here, so I am CC: Craig Berry.
Nor am I, but but comparison with the similar Perl_fp_dup, I'm hoping that
the following change may fix it.
I am sorry to report that I am getting the same build error about the undefined symbol Perl_parser_dup.
Actually Dave's patch gets us back in business if you also regen
headers by running regen.pl.
--
________________________________________
Craig A. Berry
mailto:***@mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser
Loading...