summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-08-03 13:53:40 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-08-04 13:12:18 -0700
commit036bbc13ecf0ff7517db4871ba606c5a3affcb60 (patch)
treeaa2a696184e8be99d0deeb91016c09b29729ca5d /perly.y
parent241bf533f84336b4429cbfe9b261c0857c93c67d (diff)
downloadperl-036bbc13ecf0ff7517db4871ba606c5a3affcb60.tar.gz
Use parser, not PL_parser, in perly.y
The code snippets in perly.y are #included in a C function that has a ‘parser’ local variable. Local variables require less machine code (especially under threads).
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y32
1 files changed, 16 insertions, 16 deletions
diff --git a/perly.y b/perly.y
index 6ffe0516d0..8f4791ee96 100644
--- a/perly.y
+++ b/perly.y
@@ -657,9 +657,9 @@ sigslurpelem: sigslurpsigil sigvarname sigdefault/* def only to catch errors */
OP *var = $2;
OP *defexpr = $3;
- if (PL_parser->sig_slurpy)
+ if (parser->sig_slurpy)
yyerror("Multiple slurpy parameters not allowed");
- PL_parser->sig_slurpy = (char)sigil;
+ parser->sig_slurpy = (char)sigil;
if (defexpr)
yyerror("A slurpy parameter may not have "
@@ -685,13 +685,13 @@ sigscalarelem:
OP *var = $2;
OP *defexpr = $3;
- if (PL_parser->sig_slurpy)
+ if (parser->sig_slurpy)
yyerror("Slurpy parameter not last");
- PL_parser->sig_elems++;
+ parser->sig_elems++;
if (defexpr) {
- PL_parser->sig_optelems++;
+ parser->sig_optelems++;
if ( defexpr->op_type == OP_NULL
&& !(defexpr->op_flags & OPf_KIDS))
@@ -709,7 +709,7 @@ sigscalarelem:
LINKLIST(defexpr));
/* re-purpose op_targ to hold @_ index */
defop->op_targ =
- (PADOFFSET)(PL_parser->sig_elems - 1);
+ (PADOFFSET)(parser->sig_elems - 1);
if (var) {
var->op_flags |= OPf_STACKED;
@@ -734,7 +734,7 @@ sigscalarelem:
}
}
else {
- if (PL_parser->sig_optelems)
+ if (parser->sig_optelems)
yyerror("Mandatory parameter "
"follows optional parameter");
}
@@ -773,12 +773,12 @@ siglistornull: /* NULL */
subsignature: '('
{
ENTER;
- SAVEIV(PL_parser->sig_elems);
- SAVEIV(PL_parser->sig_optelems);
- SAVEI8(PL_parser->sig_slurpy);
- PL_parser->sig_elems = 0;
- PL_parser->sig_optelems = 0;
- PL_parser->sig_slurpy = 0;
+ SAVEIV(parser->sig_elems);
+ SAVEIV(parser->sig_optelems);
+ SAVEI8(parser->sig_slurpy);
+ parser->sig_elems = 0;
+ parser->sig_optelems = 0;
+ parser->sig_slurpy = 0;
parser->expect = XSIGVAR;
}
siglistornull
@@ -797,9 +797,9 @@ subsignature: '('
aux = (UNOP_AUX_item*)PerlMemShared_malloc(
sizeof(UNOP_AUX_item) * 3);
- aux[0].iv = PL_parser->sig_elems;
- aux[1].iv = PL_parser->sig_optelems;
- aux[2].iv = PL_parser->sig_slurpy;
+ aux[0].iv = parser->sig_elems;
+ aux[1].iv = parser->sig_optelems;
+ aux[2].iv = parser->sig_slurpy;
check = newUNOP_AUX(OP_ARGCHECK, 0, NULL, aux);
sigops = op_prepend_elem(OP_LINESEQ, check, sigops);
sigops = op_prepend_elem(OP_LINESEQ,