Rename cop_hints to cop_hints_hash
Nicholas Clark [Sat, 20 May 2006 12:31:09 +0000 (12:31 +0000)]
p4raw-id: //depot/perl@28252

cop.h
mg.c
op.c
perl.c
pod/perlintern.pod
pp_ctl.c
scope.c
scope.h
sv.c

diff --git a/cop.h b/cop.h
index b1273ac..203e431 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -150,7 +150,7 @@ struct cop {
     SV *       cop_io;         /* lexical IO defaults */
     /* compile time state of %^H.  See the comment in op.c for how this is
        used to recreate a hash to return from caller.  */
-    struct refcounted_he * cop_hints;
+    struct refcounted_he * cop_hints_hash;
 };
 
 #ifdef USE_ITHREADS
@@ -235,16 +235,16 @@ struct cop {
    using $[ is highly discouraged, no sane Perl code will be using it.  */
 #define CopARYBASE_get(c)      \
        ((CopHINTS_get(c) & HINT_ARYBASE)                               \
-        ? SvIV(Perl_refcounted_he_fetch(aTHX_ (c)->cop_hints, 0, "$[", 2, 0, \
-                                        0))                            \
+        ? SvIV(Perl_refcounted_he_fetch(aTHX_ (c)->cop_hints_hash, 0,  \
+                                        "$[", 2, 0, 0))                \
         : 0)
 #define CopARYBASE_set(c, b) STMT_START { \
        if (b || ((c)->op_private & HINT_ARYBASE)) {                    \
            (c)->op_private |= HINT_ARYBASE;                            \
            if ((c) == &PL_compiling)                                   \
                PL_hints |= HINT_LOCALIZE_HH | HINT_ARYBASE;            \
-           (c)->cop_hints                                              \
-              = Perl_refcounted_he_new(aTHX_ (c)->cop_hints,           \
+           (c)->cop_hints_hash                                         \
+              = Perl_refcounted_he_new(aTHX_ (c)->cop_hints_hash,      \
                                        sv_2mortal(newSVpvs("$[")),     \
                                        sv_2mortal(newSViv(b)));        \
        }                                                               \
diff --git a/mg.c b/mg.c
index c8c935a..217eb59 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -2855,8 +2855,9 @@ S_unwind_handler_stack(pTHX_ const void *p)
 =for apidoc magic_sethint
 
 Triggered by a store to %^H, records the key/value pair to
-C<PL_compiling.cop_hints>.  It is assumed that hints aren't storing anything
-that would need a deep copy.  Maybe we should warn if we find a reference.
+C<PL_compiling.cop_hints_hash>.  It is assumed that hints aren't storing
+anything that would need a deep copy.  Maybe we should warn if we find a
+reference.
 
 =cut
 */
@@ -2875,8 +2876,8 @@ Perl_magic_sethint(pTHX_ SV *sv, MAGIC *mg)
        Doing this here saves a lot of doing it manually in perl code (and
        forgetting to do it, and consequent subtle errors.  */
     PL_hints |= HINT_LOCALIZE_HH;
-    PL_compiling.cop_hints
-       = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints,
+    PL_compiling.cop_hints_hash
+       = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints_hash,
                                 (SV *)mg->mg_ptr, sv);
     return 0;
 }
@@ -2884,7 +2885,8 @@ Perl_magic_sethint(pTHX_ SV *sv, MAGIC *mg)
 /*
 =for apidoc magic_sethint
 
-Triggered by a delete from %^H, records the key to C<PL_compiling.cop_hints>.
+Triggered by a delete from %^H, records the key to
+C<PL_compiling.cop_hints_hash>.
 
 =cut
 */
@@ -2897,8 +2899,8 @@ Perl_magic_clearhint(pTHX_ SV *sv, MAGIC *mg)
     PERL_UNUSED_ARG(sv);
 
     PL_hints |= HINT_LOCALIZE_HH;
-    PL_compiling.cop_hints
-       = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints,
+    PL_compiling.cop_hints_hash
+       = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints_hash,
                                 (SV *)mg->mg_ptr, &PL_sv_placeholder);
     return 0;
 }
diff --git a/op.c b/op.c
index c86c184..5afda98 100644 (file)
--- a/op.c
+++ b/op.c
@@ -89,10 +89,10 @@ recursive, but it's recursive on basic blocks, not on tree nodes.
    To cause actions on %^H to write out the serialisation records, it has
    magic type 'H'. This magic (itself) does nothing, but its presence causes
    the values to gain magic type 'h', which has entries for set and clear.
-   C<Perl_magic_sethint> updates C<PL_compiling.cop_hints> with a store
+   C<Perl_magic_sethint> updates C<PL_compiling.cop_hints_hash> with a store
    record, with deletes written by C<Perl_magic_clearhint>. C<SAVE_HINTS>
-   saves the current C<PL_compiling.cop_hints> on the save stack, so that it
-   will be correctly restored when any inner compiling scope is exited.
+   saves the current C<PL_compiling.cop_hints_hash> on the save stack, so that
+   it will be correctly restored when any inner compiling scope is exited.
 */
 
 #include "EXTERN.h"
@@ -502,7 +502,7 @@ S_cop_free(pTHX_ COP* cop)
        SvREFCNT_dec(cop->cop_io);
 #endif
     }
-    Perl_refcounted_he_free(aTHX_ cop->cop_hints);
+    Perl_refcounted_he_free(aTHX_ cop->cop_hints_hash);
 }
 
 void
@@ -3947,16 +3947,17 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o)
     }
     cop->cop_seq = seq;
     /* CopARYBASE is now "virtual", in that it's stored as a flag bit in
-       CopHINTS and a possible value in cop_hints, so no need to copy it.  */
+       CopHINTS and a possible value in cop_hints_hash, so no need to copy it.
+    */
     cop->cop_warnings = DUP_WARNINGS(PL_curcop->cop_warnings);
     if (specialCopIO(PL_curcop->cop_io))
         cop->cop_io = PL_curcop->cop_io;
     else
         cop->cop_io = newSVsv(PL_curcop->cop_io) ;
-    cop->cop_hints = PL_curcop->cop_hints;
-    if (cop->cop_hints) {
+    cop->cop_hints_hash = PL_curcop->cop_hints_hash;
+    if (cop->cop_hints_hash) {
        HINTS_REFCNT_LOCK;
-       cop->cop_hints->refcounted_he_refcnt++;
+       cop->cop_hints_hash->refcounted_he_refcnt++;
        HINTS_REFCNT_UNLOCK;
     }
 
diff --git a/perl.c b/perl.c
index fc95e83..7d71030 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1056,8 +1056,8 @@ perl_destruct(pTHXx)
     if (!specialCopIO(PL_compiling.cop_io))
        SvREFCNT_dec(PL_compiling.cop_io);
     PL_compiling.cop_io = NULL;
-    Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints);
-    PL_compiling.cop_hints = NULL;
+    Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints_hash);
+    PL_compiling.cop_hints_hash = NULL;
     CopFILE_free(&PL_compiling);
     CopSTASH_free(&PL_compiling);
 
index b79d54e..de67174 100644 (file)
@@ -539,7 +539,8 @@ Found in file doio.c
 =item magic_sethint
 X<magic_sethint>
 
-Triggered by a delete from %^H, records the key to C<PL_compiling.cop_hints>.
+Triggered by a delete from %^H, records the key to
+C<PL_compiling.cop_hints_hash>.
 
        int     magic_sethint(SV* sv, MAGIC* mg)
 
index baed3fd..21b96f7 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1720,10 +1720,10 @@ PP(pp_caller)
         PUSHs(sv_2mortal(mask));
     }
 
-    PUSHs(cx->blk_oldcop->cop_hints ?
+    PUSHs(cx->blk_oldcop->cop_hints_hash ?
          sv_2mortal(newRV_noinc(
-               (SV*)Perl_refcounted_he_chain_2hv(aTHX_
-                                                 cx->blk_oldcop->cop_hints)))
+           (SV*)Perl_refcounted_he_chain_2hv(aTHX_
+                                             cx->blk_oldcop->cop_hints_hash)))
          : &PL_sv_undef);
     RETURN;
 }
@@ -3476,13 +3476,13 @@ PP(pp_entereval)
         PL_compiling.cop_io = newSVsv(PL_curcop->cop_io);
         SAVEFREESV(PL_compiling.cop_io);
     }
-    if (PL_compiling.cop_hints) {
-       Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints);
+    if (PL_compiling.cop_hints_hash) {
+       Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints_hash);
     }
-    PL_compiling.cop_hints = PL_curcop->cop_hints;
-    if (PL_compiling.cop_hints) {
+    PL_compiling.cop_hints_hash = PL_curcop->cop_hints_hash;
+    if (PL_compiling.cop_hints_hash) {
        HINTS_REFCNT_LOCK;
-       PL_compiling.cop_hints->refcounted_he_refcnt++;
+       PL_compiling.cop_hints_hash->refcounted_he_refcnt++;
        HINTS_REFCNT_UNLOCK;
     }
     /* special case: an eval '' executed within the DB package gets lexically
diff --git a/scope.c b/scope.c
index c0f3428..58beb73 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -878,8 +878,8 @@ Perl_leave_scope(pTHX_ I32 base)
                GvHV(PL_hintgv) = NULL;
            }
            *(I32*)&PL_hints = (I32)SSPOPINT;
-           Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints);
-           PL_compiling.cop_hints = (struct refcounted_he *) SSPOPPTR;
+           Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints_hash);
+           PL_compiling.cop_hints_hash = (struct refcounted_he *) SSPOPPTR;
            if (PL_hints & HINT_LOCALIZE_HH) {
                SvREFCNT_dec((SV*)GvHV(PL_hintgv));
                GvHV(PL_hintgv) = (HV*)SSPOPPTR;
diff --git a/scope.h b/scope.h
index b18b84e..9943a05 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -158,12 +158,12 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
            SSPUSHPTR(GvHV(PL_hintgv));                 \
            GvHV(PL_hintgv) = Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv)); \
        }                                               \
-       if (PL_compiling.cop_hints) {                   \
+       if (PL_compiling.cop_hints_hash) {              \
            HINTS_REFCNT_LOCK;                          \
-           PL_compiling.cop_hints->refcounted_he_refcnt++;     \
+           PL_compiling.cop_hints_hash->refcounted_he_refcnt++;        \
            HINTS_REFCNT_UNLOCK;                        \
        }                                               \
-       SSPUSHPTR(PL_compiling.cop_hints);              \
+       SSPUSHPTR(PL_compiling.cop_hints_hash);         \
        SSPUSHINT(PL_hints);                            \
        SSPUSHINT(SAVEt_HINTS);                         \
     } STMT_END
diff --git a/sv.c b/sv.c
index c9a4402..8b17f37 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10965,9 +10965,9 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_compiling.cop_warnings = DUP_WARNINGS(PL_compiling.cop_warnings);
     if (!specialCopIO(PL_compiling.cop_io))
        PL_compiling.cop_io = sv_dup_inc(PL_compiling.cop_io, param);
-    if (PL_compiling.cop_hints) {
+    if (PL_compiling.cop_hints_hash) {
        HINTS_REFCNT_LOCK;
-       PL_compiling.cop_hints->refcounted_he_refcnt++;
+       PL_compiling.cop_hints_hash->refcounted_he_refcnt++;
        HINTS_REFCNT_UNLOCK;
     }
     PL_curcop          = (COP*)any_dup(proto_perl->Tcurcop, proto_perl);