Change 29909 by [EMAIL PROTECTED] on 2007/01/21 22:28:56

        Integrate:
        [ 27327]
        Abstract the specific use of SvCUR in GVs for detecting variables on
        both sides of an assignment using GvASSIGN_GENERATION() and
        GvASSIGN_GENERATION_set().
        
        [ 27337]
        Fix code-before-declaration error (under VC++) from change #27334
        
        [ 27349]
        Subject: [PATCH] Removed a redundant o->op_type
        From: [EMAIL PROTECTED] (Andy Lester)
        Message-ID: <[EMAIL PROTECTED]>
        Date: Mon, 27 Feb 2006 14:20:43 -0600
        
        [ 27350]
        In Perl_sv_setsv_flags, swap the default in the type based switch to
        the "Bizarre copy" failure case.
        
        [ 27351]
        Silence a VC++ warning with DEBUGGING builds
        (signed/unsigned mismatch)
        
        [ 27355]
        Subject: [PATCH] a buglet in fakesdio.h
        From: Anton Berezin <[EMAIL PROTECTED]>
        Date: Wed, 1 Mar 2006 16:56:13 +0100
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 27360]
        Subject: [PATCH] Non-null optimizations
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Wed, 1 Mar 2006 22:13:45 -0600
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/maint-5.8/perl/embed.fnc#172 integrate
... //depot/maint-5.8/perl/fakesdio.h#5 integrate
... //depot/maint-5.8/perl/gv.h#17 integrate
... //depot/maint-5.8/perl/op.c#165 integrate
... //depot/maint-5.8/perl/perlio.c#85 integrate
... //depot/maint-5.8/perl/pod/perlapi.pod#83 integrate
... //depot/maint-5.8/perl/proto.h#161 integrate
... //depot/maint-5.8/perl/sv.c#298 integrate

Differences ...

==== //depot/maint-5.8/perl/embed.fnc#172 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#171~29904~   2007-01-20 16:30:14.000000000 -0800
+++ perl/embed.fnc      2007-01-21 14:28:56.000000000 -0800
@@ -552,8 +552,8 @@
 Apa    |OP*    |newPADOP       |I32 type|I32 flags|NULLOK SV* sv
 Apa    |OP*    |newPMOP        |I32 type|I32 flags
 Apa    |OP*    |newPVOP        |I32 type|I32 flags|NULLOK char* pv
-Apa    |SV*    |newRV          |NN SV* pref
-Apda   |SV*    |newRV_noinc    |NN SV *sv
+Apa    |SV*    |newRV          |NN SV* sv
+Apda   |SV*    |newRV_noinc    |NN SV* sv
 Apda   |SV*    |newSV          |STRLEN len
 Apa    |OP*    |newSVREF       |NN OP* o
 Apa    |OP*    |newSVOP        |I32 type|I32 flags|NN SV* sv

==== //depot/maint-5.8/perl/fakesdio.h#5 (text) ====
Index: perl/fakesdio.h
--- perl/fakesdio.h#4~19400~    2003-05-04 01:29:43.000000000 -0700
+++ perl/fakesdio.h     2007-01-21 14:28:56.000000000 -0800
@@ -65,7 +65,6 @@
 #else
 #define printf PerlIO_stdoutf
 #endif
-#endif
 
 #define fprintf                        PerlIO_printf
 #define stdin                  PerlIO_stdin()

==== //depot/maint-5.8/perl/gv.h#17 (text) ====
Index: perl/gv.h
--- perl/gv.h#16~29809~ 2007-01-14 05:47:07.000000000 -0800
+++ perl/gv.h   2007-01-21 14:28:56.000000000 -0800
@@ -31,6 +31,11 @@
 #define GvSTASH(gv)    (GvXPVGV(gv)->xgv_stash)
 #define GvFLAGS(gv)    (GvXPVGV(gv)->xgv_flags)
 
+#define        GvASSIGN_GENERATION(gv)         (0 + ((XPV*) 
SvANY(gv))->xpv_cur)
+#define        GvASSIGN_GENERATION_set(gv,val)                 \
+       STMT_START { assert(SvTYPE(gv) == SVt_PVGV);    \
+               (((XPV*) SvANY(gv))->xpv_cur = (val)); } STMT_END
+
 /*
 =head1 GV Functions
 

==== //depot/maint-5.8/perl/op.c#165 (text) ====
Index: perl/op.c
--- perl/op.c#164~29908~        2007-01-21 13:58:40.000000000 -0800
+++ perl/op.c   2007-01-21 14:28:56.000000000 -0800
@@ -340,24 +340,27 @@
 Perl_op_free(pTHX_ OP *o)
 {
     OPCODE type;
-    PADOFFSET refcnt;
 
     if (!o || o->op_seq == (U16)-1)
        return;
 
+    type = o->op_type;
     if (o->op_private & OPpREFCOUNTED) {
-       switch (o->op_type) {
+       switch (type) {
        case OP_LEAVESUB:
        case OP_LEAVESUBLV:
        case OP_LEAVEEVAL:
        case OP_LEAVE:
        case OP_SCOPE:
        case OP_LEAVEWRITE:
+           {
+           PADOFFSET refcnt;
            OP_REFCNT_LOCK;
            refcnt = OpREFCNT_dec(o);
            OP_REFCNT_UNLOCK;
            if (refcnt)
                return;
+           }
            break;
        default:
            break;
@@ -3441,9 +3444,10 @@
                if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
                    if (curop->op_type == OP_GV) {
                        GV *gv = cGVOPx_gv(curop);
-                       if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
+                       if (gv == PL_defgv
+                           || (int)GvASSIGN_GENERATION(gv) == PL_generation)
                            break;
-                       SvCUR_set(gv, PL_generation);
+                       GvASSIGN_GENERATION_set(gv, PL_generation);
                    }
                    else if (curop->op_type == OP_PADSV ||
                             curop->op_type == OP_PADAV ||
@@ -3473,9 +3477,11 @@
 #else
                            GV *gv = (GV*)((PMOP*)curop)->op_pmreplroot;
 #endif
-                           if (gv == PL_defgv || (int)SvCUR(gv) == 
PL_generation)
+                           if (gv == PL_defgv
+                               || (int)GvASSIGN_GENERATION(gv) == 
PL_generation)
                                break;
-                           SvCUR_set(gv, PL_generation);
+                           GvASSIGN_GENERATION_set(gv, PL_generation);
+                           GvASSIGN_GENERATION_set(gv, PL_generation);
                        }
                    }
                    else

==== //depot/maint-5.8/perl/perlio.c#85 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#84~29897~     2007-01-20 10:14:46.000000000 -0800
+++ perl/perlio.c       2007-01-21 14:28:56.000000000 -0800
@@ -607,6 +607,8 @@
 PerlIO_list_push(pTHX_ PerlIO_list_t *list, PerlIO_funcs *funcs, SV *arg)
 {
     PerlIO_pair_t *p;
+    PERL_UNUSED_CONTEXT;
+
     if (list->cur >= list->len) {
        list->len += 8;
        if (list->array)

==== //depot/maint-5.8/perl/pod/perlapi.pod#83 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#82~29891~      2007-01-19 16:30:02.000000000 -0800
+++ perl/pod/perlapi.pod        2007-01-21 14:28:56.000000000 -0800
@@ -4377,7 +4377,7 @@
 Creates an RV wrapper for an SV.  The reference count for the original
 SV is B<not> incremented.
 
-       SV*     newRV_noinc(SV *sv)
+       SV*     newRV_noinc(SV* sv)
 
 =for hackers
 Found in file sv.c

==== //depot/maint-5.8/perl/proto.h#161 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#160~29904~     2007-01-20 16:30:14.000000000 -0800
+++ perl/proto.h        2007-01-21 14:28:56.000000000 -0800
@@ -896,11 +896,11 @@
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
-PERL_CALLCONV SV*      Perl_newRV(pTHX_ SV* pref)
+PERL_CALLCONV SV*      Perl_newRV(pTHX_ SV* sv)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
-PERL_CALLCONV SV*      Perl_newRV_noinc(pTHX_ SV *sv)
+PERL_CALLCONV SV*      Perl_newRV_noinc(pTHX_ SV* sv)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 

==== //depot/maint-5.8/perl/sv.c#298 (text) ====
Index: perl/sv.c
--- perl/sv.c#297~29906~        2007-01-21 04:16:40.000000000 -0800
+++ perl/sv.c   2007-01-21 14:28:56.000000000 -0800
@@ -1024,7 +1024,7 @@
     assert(bdp->arena_size);
 
     if (!done_sanity_check) {
-       int i = SVt_LAST;
+       unsigned int i = SVt_LAST;
 
        done_sanity_check = TRUE;
 
@@ -3330,10 +3330,7 @@
        if (dtype < SVt_PVNV)
            sv_upgrade(dstr, SVt_PVNV);
        break;
-    case SVt_PVAV:
-    case SVt_PVHV:
-    case SVt_PVCV:
-    case SVt_PVIO:
+    default:
        {
        const char * const type = sv_reftype(sstr,0);
        if (PL_op)
@@ -3350,7 +3347,9 @@
        }
        /*FALLTHROUGH*/
 
-    default:
+    case SVt_PVMG:
+    case SVt_PVLV:
+    case SVt_PVBM:
        if (SvGMAGICAL(sstr) && (flags & SV_GMAGIC)) {
            mg_get(sstr);
            if ((int)SvTYPE(sstr) != stype) {
@@ -6591,9 +6590,9 @@
  */
 
 SV *
-Perl_newRV(pTHX_ SV *tmpRef)
+Perl_newRV(pTHX_ SV *sv)
 {
-    return newRV_noinc(SvREFCNT_inc_simple(tmpRef));
+    return newRV_noinc(SvREFCNT_inc_simple_NN(sv));
 }
 
 /*
@@ -8849,6 +8848,7 @@
 
 
 #define sv_dup_inc(s,t)        SvREFCNT_inc(sv_dup(s,t))
+#define sv_dup_inc_NN(s,t)     SvREFCNT_inc_NN(sv_dup(s,t))
 #define av_dup(s,t)    (AV*)sv_dup((SV*)s,t)
 #define av_dup_inc(s,t)        (AV*)SvREFCNT_inc(sv_dup((SV*)s,t))
 #define hv_dup(s,t)    (HV*)sv_dup((SV*)s,t)
@@ -10449,8 +10449,7 @@
        const I32 len = av_len((AV*)proto_perl->Iregex_padav);
        SV* const * const regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
        IV i;
-       av_push(PL_regex_padav,
-               sv_dup_inc(regexen[0],param));
+       av_push(PL_regex_padav, sv_dup_inc_NN(regexen[0],param));
        for(i = 1; i <= len; i++) {
            const SV * const regex = regexen[i];
            SV * const sv =
End of Patch.

Reply via email to