diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-05-20 12:31:09 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-05-20 12:31:09 +0000 |
commit | c28fe1ecc160a002d731cdf38ff7215ad3cf2a19 (patch) | |
tree | 1e2f422e7ae0c64e5419784494fae185eb6e02eb | |
parent | e22ae1e278fa878ce0da6700e97da49f0dacf636 (diff) | |
download | perl-c28fe1ecc160a002d731cdf38ff7215ad3cf2a19.tar.gz |
Rename cop_hints to cop_hints_hash
p4raw-id: //depot/perl@28252
-rw-r--r-- | cop.h | 10 | ||||
-rw-r--r-- | mg.c | 16 | ||||
-rw-r--r-- | op.c | 17 | ||||
-rw-r--r-- | perl.c | 4 | ||||
-rw-r--r-- | pod/perlintern.pod | 3 | ||||
-rw-r--r-- | pp_ctl.c | 16 | ||||
-rw-r--r-- | scope.c | 4 | ||||
-rw-r--r-- | scope.h | 6 | ||||
-rw-r--r-- | sv.c | 4 |
9 files changed, 42 insertions, 38 deletions
@@ -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))); \ } \ @@ -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; } @@ -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; } @@ -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); diff --git a/pod/perlintern.pod b/pod/perlintern.pod index b79d54e874..de67174a41 100644 --- a/pod/perlintern.pod +++ b/pod/perlintern.pod @@ -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) @@ -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 @@ -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; @@ -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 @@ -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); |