Change 29913 by [EMAIL PROTECTED] on 2007/01/22 14:45:23
Integrate:
[ 27213]
The two whitespace changes from
Subject: arena-rework : consolidated patch
From: Jim Cromie <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Mon, 13 Feb 2006 14:12:41 -0700
[ 27397]
Subject: Re: [PATCH] Removed a redundant o->op_type
From: Paul Johnson <[EMAIL PROTECTED]>
Date: Tue, 28 Feb 2006 20:17:31 +0100
Message-ID: <[EMAIL PROTECTED]>
[ 27414]
Subject: [PATCH] Removed unused check and assignment in pp_hot.c
From: [EMAIL PROTECTED] (Andy Lester)
Date: Wed, 8 Mar 2006 00:45:29 -0600
Message-ID: <[EMAIL PROTECTED]>
[ 27423]
Change from Larry in the MAD code which seems to be unrelated to MAD.
[ 27443]
Refactoring from Larry inplicit in the MAD patch.
[ 27444]
Another refactoring from Larry implicit in the MAD patch.
[ 27451]
Avoid scribbling on the passed in command line string for -i in
moreswitches.
[ 27452]
Superior *printf-fu lets us avoid modifying source code.
[ 27456]
Correct another gv_fetchpv() - it takes a bitmask of flags, not simply
TRUE/FALSE.
[ 27458]
Tease apart the keyword/subroutine test in S_checkcomma.
[ 27459]
Summon constman! S_checkcomma now has all 3 arguments const char.
[ 27469]
Subject: [PATCH] Localizing some vars in S_checkcomma
From: [EMAIL PROTECTED] (Andy Lester)
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 10 Mar 2006 16:31:00 -0600
[ 27470]
Subject: [PATCH] Sync up embed.fnc and doio.c
From: [EMAIL PROTECTED] (Andy Lester)
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 11 Mar 2006 01:13:38 -0600
[ 27480]
isSPACE('\0') is false, so can simplify the condition in the for
loop. As the for loop is basically a while loop, write it as one, to
make its intentions clearer.
[ 27493]
Subject: [PATCH] Do nothing in a GCC-friendly way
From: [EMAIL PROTECTED] (Andy Lester)
Date: Mon, 13 Mar 2006 12:48:50 -0600
Message-ID: <[EMAIL PROTECTED]>
[ 27507]
Expunge references to HV_AMAGIC, HV_AMAGICbad and HV_AMAGICmb which
have been unused since revision 1.
[ 27523]
Correct the macros in the comments in hv.c. Given the improvements in
compiler optimisation, and the almost irrelevance of instructions
executed over cache misses, maybe we should just remove the comments
by putting their code back in place of the o{ptimis,bfuscat}ed version.
Affected files ...
... //depot/maint-5.8/perl/embed.fnc#174 integrate
... //depot/maint-5.8/perl/gv.c#85 integrate
... //depot/maint-5.8/perl/hv.c#99 integrate
... //depot/maint-5.8/perl/hv.h#25 integrate
... //depot/maint-5.8/perl/op.c#166 integrate
... //depot/maint-5.8/perl/perl.c#188 integrate
... //depot/maint-5.8/perl/pp_hot.c#114 integrate
... //depot/maint-5.8/perl/proto.h#163 edit
... //depot/maint-5.8/perl/sv.h#70 integrate
... //depot/maint-5.8/perl/toke.c#137 integrate
Differences ...
==== //depot/maint-5.8/perl/embed.fnc#174 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#173~29912~ 2007-01-21 15:33:27.000000000 -0800
+++ perl/embed.fnc 2007-01-22 06:45:23.000000000 -0800
@@ -190,7 +190,7 @@
p |OP* |die_where |NULLOK char* message|STRLEN msglen
Ap |void |dounwind |I32 cxix
pmb |bool |do_aexec |NULLOK SV* really|NN SV** mark|NN SV** sp
-p |bool |do_aexec5 |NULLOK SV* really|NN SV** mark|NN SV** sp|int
fd|int flag
+p |bool |do_aexec5 |NULLOK SV* really|NN SV** mark|NN SV** sp|int
fd|int do_report
Ap |int |do_binmode |NN PerlIO *fp|int iotype|int mode
p |void |do_chop |NN SV* asv|NN SV* sv
Ap |bool |do_close |NN GV* gv|bool not_implicit
@@ -208,7 +208,7 @@
Ap |int |do_spawn_nowait|NN char* cmd
#endif
#if !defined(WIN32)
-p |bool |do_exec3 |NN char* cmd|int fd|int flag
+p |bool |do_exec3 |NN char* cmd|int fd|int do_report
#endif
p |void |do_execfree
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
@@ -1348,7 +1348,8 @@
|int allow_package|NN STRLEN *slp
sR |char* |skipspace |NN char *s
sR |char* |swallow_bom |NN U8 *s
-s |void |checkcomma |NN char *s|NN const char *name|NN const char
*what
+s |void |checkcomma |NN const char *s|NN const char *name \
+ |NN const char *what
s |void |force_ident |NN const char *s|int kind
s |void |incline |NN char *s
s |int |intuit_method |NN char *s|NULLOK GV *gv|NULLOK CV *cv
==== //depot/maint-5.8/perl/gv.c#85 (text) ====
Index: perl/gv.c
--- perl/gv.c#84~29908~ 2007-01-21 13:58:40.000000000 -0800
+++ perl/gv.c 2007-01-22 06:45:23.000000000 -0800
@@ -1352,7 +1352,7 @@
Perl_newGVgen(pTHX_ char *pack)
{
return gv_fetchpv(Perl_form(aTHX_ "%s::_GEN_%ld", pack, (long)PL_gensym++),
- TRUE, SVt_PVGV);
+ GV_ADD, SVt_PVGV);
}
/* hopefully this is only called on local symbol table entries */
==== //depot/maint-5.8/perl/hv.c#99 (text) ====
Index: perl/hv.c
--- perl/hv.c#98~29897~ 2007-01-20 10:14:46.000000000 -0800
+++ perl/hv.c 2007-01-22 06:45:23.000000000 -0800
@@ -779,7 +779,7 @@
{
const HE *counter = HeNEXT(entry);
- xhv->xhv_keys++; /* HvKEYS(hv)++ */
+ xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */
if (!counter) { /* initial entry? */
xhv->xhv_fill++; /* HvFILL(hv)++ */
} else if (xhv->xhv_keys > (IV)xhv->xhv_max) {
@@ -1055,7 +1055,7 @@
HvLAZYDEL_on(hv);
else
hv_free_ent(hv, entry);
- xhv->xhv_keys--; /* HvKEYS(hv)-- */
+ xhv->xhv_keys--; /* HvTOTALKEYS(hv)-- */
if (xhv->xhv_keys == 0)
HvHASKFLAGS_off(hv);
}
@@ -1989,7 +1989,7 @@
}
Safefree(HeKEY_hek(entry));
del_HE(entry);
- xhv->xhv_keys--; /* HvKEYS(hv)-- */
+ xhv->xhv_keys--; /* HvTOTALKEYS(hv)-- */
}
}
@@ -2079,7 +2079,7 @@
HeVAL(entry) = Nullsv;
HeNEXT(entry) = next;
*head = entry;
- xhv->xhv_keys++; /* HvKEYS(hv)++ */
+ xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */
if (!next) { /* initial entry? */
xhv->xhv_fill++; /* HvFILL(hv)++ */
} else if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv)
*/) {
==== //depot/maint-5.8/perl/hv.h#25 (text) ====
Index: perl/hv.h
--- perl/hv.h#24~29771~ 2007-01-12 05:01:39.000000000 -0800
+++ perl/hv.h 2007-01-22 06:45:23.000000000 -0800
@@ -245,19 +245,6 @@
#define HvREHASH_on(hv) (SvFLAGS(hv) |= SVphv_REHASH)
#define HvREHASH_off(hv) (SvFLAGS(hv) &= ~SVphv_REHASH)
-/* Maybe amagical: */
-/* #define HV_AMAGICmb(hv) (SvFLAGS(hv) & (SVpgv_badAM | SVpgv_AM)) */
-
-#define HV_AMAGIC(hv) (SvFLAGS(hv) & SVpgv_AM)
-#define HV_AMAGIC_on(hv) (SvFLAGS(hv) |= SVpgv_AM)
-#define HV_AMAGIC_off(hv) (SvFLAGS(hv) &= ~SVpgv_AM)
-
-/*
-#define HV_AMAGICbad(hv) (SvFLAGS(hv) & SVpgv_badAM)
-#define HV_badAMAGIC_on(hv) (SvFLAGS(hv) |= SVpgv_badAM)
-#define HV_badAMAGIC_off(hv) (SvFLAGS(hv) &= ~SVpgv_badAM)
-*/
-
#define Nullhe Null(HE*)
#define HeNEXT(he) (he)->hent_next
#define HeKEY_hek(he) (he)->hent_hek
==== //depot/maint-5.8/perl/op.c#166 (text) ====
Index: perl/op.c
--- perl/op.c#165~29909~ 2007-01-21 14:28:56.000000000 -0800
+++ perl/op.c 2007-01-22 06:45:23.000000000 -0800
@@ -374,7 +374,6 @@
op_free(kid);
}
}
- type = o->op_type;
if (type == OP_NULL)
type = (OPCODE)o->op_targ;
@@ -3639,7 +3638,9 @@
scalarboolean(first);
/* optimize "!a && b" to "a || b", and "!a || b" to "a && b" */
- if (first->op_type == OP_NOT && (first->op_flags & OPf_SPECIAL)) {
+ if (first->op_type == OP_NOT
+ && (first->op_flags & OPf_SPECIAL)
+ && (first->op_flags & OPf_KIDS)) {
if (type == OP_AND || type == OP_OR) {
if (type == OP_AND)
type = OP_OR;
==== //depot/maint-5.8/perl/perl.c#188 (text) ====
Index: perl/perl.c
--- perl/perl.c#187~29908~ 2007-01-21 13:58:40.000000000 -0800
+++ perl/perl.c 2007-01-22 06:45:23.000000000 -0800
@@ -3254,13 +3254,17 @@
return s+1;
}
#endif /* __CYGWIN__ */
- PL_inplace = savepv(s+1);
- for (s = PL_inplace; *s && !isSPACE(*s); s++)
- ;
+ {
+ const char *start = ++s;
+ while (*s && !isSPACE(*s))
+ ++s;
+
+ PL_inplace = savepvn(start, s - start);
+ }
if (*s) {
- *s++ = '\0';
+ ++s;
if (*s == '-') /* Additional switches on #! line. */
- s++;
+ s++;
}
return s;
case 'I': /* -I handled both here and in parse_body() */
==== //depot/maint-5.8/perl/pp_hot.c#114 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#113~29908~ 2007-01-21 13:58:40.000000000 -0800
+++ perl/pp_hot.c 2007-01-22 06:45:23.000000000 -0800
@@ -2596,13 +2596,12 @@
save_item(dbsv);
if (!PERLDB_SUB_NN) {
- GV *gv = CvGV(cv);
+ GV * const gv = CvGV(cv);
if ( (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED))
|| strEQ(GvNAME(gv), "END")
|| ((GvCV(gv) != cv) && /* Could be imported, and old sub
redefined. */
- !( (SvTYPE(*svp) == SVt_PVGV) && (GvCV((GV*)*svp) == cv)
- && (gv = (GV*)*svp) ))) {
+ !( (SvTYPE(*svp) == SVt_PVGV) && (GvCV((GV*)*svp) == cv) ))) {
/* Use GV from the stack as a fallback. */
/* GV is potentially non-unique, or contain different CV. */
SV * const tmp = newRV((SV*)cv);
==== //depot/maint-5.8/perl/proto.h#163 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#162~29912~ 2007-01-21 15:33:27.000000000 -0800
+++ perl/proto.h 2007-01-22 06:45:23.000000000 -0800
@@ -263,7 +263,7 @@
PERL_CALLCONV OP* Perl_die_where(pTHX_ char* message, STRLEN msglen);
PERL_CALLCONV void Perl_dounwind(pTHX_ I32 cxix);
/* PERL_CALLCONV bool Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp); */
-PERL_CALLCONV bool Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp,
int fd, int flag);
+PERL_CALLCONV bool Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp,
int fd, int do_report);
PERL_CALLCONV int Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode);
PERL_CALLCONV void Perl_do_chop(pTHX_ SV* asv, SV* sv);
PERL_CALLCONV bool Perl_do_close(pTHX_ GV* gv, bool not_implicit);
@@ -281,7 +281,7 @@
PERL_CALLCONV int Perl_do_spawn_nowait(pTHX_ char* cmd);
#endif
#if !defined(WIN32)
-PERL_CALLCONV bool Perl_do_exec3(pTHX_ char* cmd, int fd, int flag);
+PERL_CALLCONV bool Perl_do_exec3(pTHX_ char* cmd, int fd, int do_report);
#endif
PERL_CALLCONV void Perl_do_execfree(pTHX);
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
@@ -1964,7 +1964,7 @@
STATIC char* S_swallow_bom(pTHX_ U8 *s)
__attribute__warn_unused_result__;
-STATIC void S_checkcomma(pTHX_ char *s, const char *name, const char *what);
+STATIC void S_checkcomma(pTHX_ const char *s, const char *name, const char
*what);
STATIC void S_force_ident(pTHX_ const char *s, int kind);
STATIC void S_incline(pTHX_ char *s);
STATIC int S_intuit_method(pTHX_ char *s, GV *gv, CV *cv);
==== //depot/maint-5.8/perl/sv.h#70 (text) ====
Index: perl/sv.h
--- perl/sv.h#69~29906~ 2007-01-21 04:16:40.000000000 -0800
+++ perl/sv.h 2007-01-22 06:45:23.000000000 -0800
@@ -829,11 +829,6 @@
#define SvGAMAGIC(sv) (SvFLAGS(sv) & (SVs_GMG|SVf_AMAGIC))
-/*
-#define Gv_AMG(stash) \
- (HV_AMAGICmb(stash) && \
- ((!HV_AMAGICbad(stash) && HV_AMAGIC(stash)) || Gv_AMupdate(stash)))
-*/
#define Gv_AMG(stash) (PL_amagic_generation && Gv_AMupdate(stash))
#define SvWEAKREF(sv) ((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) \
==== //depot/maint-5.8/perl/toke.c#137 (text) ====
Index: perl/toke.c
--- perl/toke.c#136~29903~ 2007-01-20 16:16:12.000000000 -0800
+++ perl/toke.c 2007-01-22 06:45:23.000000000 -0800
@@ -861,15 +861,10 @@
if ((t = strchr(s, '(')) && t < PL_bufptr)
return;
- /* XXX Things like this are just so nasty. We shouldn't be modifying
- source code, even if we realquick set it back. */
if (ckWARN_d(WARN_AMBIGUOUS)){
- const char ch = *s;
- *s = '\0';
Perl_warner(aTHX_ packWARN(WARN_AMBIGUOUS),
- "Warning: Use of \"%s\" without parentheses is ambiguous",
- PL_last_uni);
- *s = ch;
+ "Warning: Use of \"%.*s\" without parentheses is ambiguous",
+ (int)(s - PL_last_uni), PL_last_uni);
}
}
@@ -3027,13 +3022,14 @@
CopLINE_dec(PL_curcop);
incline(s);
}
- d = PL_bufend;
- while (s < d && *s != '\n')
- s++;
- if (s < d)
- s++;
- else if (s > d) /* Found by Ilya: feed random input to Perl. */
- Perl_croak(aTHX_ "panic: input overflow");
+ d = s;
+ while (d < PL_bufend && *d != '\n')
+ d++;
+ if (d < PL_bufend)
+ d++;
+ else if (d > PL_bufend) /* Found by Ilya: feed random input to
Perl. */
+ Perl_croak(aTHX_ "panic: input overflow");
+ s = d;
incline(s);
if (PL_lex_formbrack && PL_lex_brackets <= PL_lex_formbrack) {
PL_bufptr = s;
@@ -9001,21 +8997,21 @@
}
STATIC void
-S_checkcomma(pTHX_ register char *s, const char *name, const char *what)
+S_checkcomma(pTHX_ const char *s, const char *name, const char *what)
{
- const char *w;
if (*s == ' ' && s[1] == '(') { /* XXX gotta be a better way */
if (ckWARN(WARN_SYNTAX)) {
int level = 1;
+ const char *w;
for (w = s+2; *w && level; w++) {
if (*w == '(')
++level;
else if (*w == ')')
--level;
}
- if (*w)
- for (; *w && isSPACE(*w); w++) ;
+ while (isSPACE(*w))
+ ++w;
if (!*w || !strchr(";|})]oaiuw!=", *w)) /* an advisory hack
only... */
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"%s (...) interpreted as function",name);
@@ -9028,17 +9024,18 @@
while (s < PL_bufend && isSPACE(*s))
s++;
if (isIDFIRST_lazy_if(s,UTF)) {
- w = s++;
+ const char * const w = s++;
while (isALNUM_lazy_if(s,UTF))
s++;
while (s < PL_bufend && isSPACE(*s))
s++;
if (*s == ',') {
- int kw;
- *s = '\0'; /* XXX If we didn't do this, we could const a lot of
toke.c */
- kw = keyword((char *)w, s - w) || get_cv(w, FALSE) != 0;
- *s = ',';
- if (kw)
+ GV* gv;
+ if (keyword((char *)w, s - w))
+ return;
+
+ gv = gv_fetchpvn_flags(w, s - w, 0, SVt_PVCV);
+ if (gv && GvCVu(gv))
return;
Perl_croak(aTHX_ "No comma allowed after %s", what);
}
@@ -9447,9 +9444,9 @@
pm->op_pmflags |= PMf_EVAL;
while (es-- > 0)
sv_catpv(repl, es ? "eval " : "do ");
- sv_catpvs(repl, "{ ");
+ sv_catpvs(repl, "{");
sv_catsv(repl, PL_lex_repl);
- sv_catpvs(repl, " }");
+ sv_catpvs(repl, "}");
SvEVALED_on(repl);
SvREFCNT_dec(PL_lex_repl);
PL_lex_repl = repl;
End of Patch.