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
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))); \
} \
=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
*/
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;
}
/*
=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
*/
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;
}
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"
SvREFCNT_dec(cop->cop_io);
#endif
}
- Perl_refcounted_he_free(aTHX_ cop->cop_hints);
+ Perl_refcounted_he_free(aTHX_ cop->cop_hints_hash);
}
void
}
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;
}
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);
=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)
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;
}
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
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;
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
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);