PL_hints stores the hints at compile time that get copied into the
cop_hints field of each COP (in newSTATEOP).
Since perl-5.8.0-8053-gd5ec298, COPs have stored all the hints.
Before that, COPs used to store only some of the hints. The hints
were copied here and there into PL_compiling, a static COP-shaped buf-
fer used during compilation, so that things like constant folding
would see the correct hints.
a0ed51b3 back in 1998 did that.
Now that COPs can store all the hints, we can just use
PL_compiling.cop_hints to avoid having to copy them from PL_hints from
time to time.
This simplifies the code and avoids creating bugs like those that
a547fd219 and
1c75beb82 fixed.
#define PL_hash_rand_bits (vTHX->Ihash_rand_bits)
#define PL_hash_rand_bits_enabled (vTHX->Ihash_rand_bits_enabled)
#define PL_hintgv (vTHX->Ihintgv)
-#define PL_hints (vTHX->Ihints)
#define PL_hv_fetch_ent_mh (vTHX->Ihv_fetch_ent_mh)
#define PL_in_clean_all (vTHX->Iin_clean_all)
#define PL_in_clean_objs (vTHX->Iin_clean_objs)
PERLVAR(I, padix_floor, I32) /* how low may inner block reset padix */
-PERLVAR(I, hints, U32) /* pragma-tic compile-time flags */
-
#ifdef USE_LOCALE_COLLATE
PERLVAR(I, collation_name, char *) /* Name of current collation */
PERLVAR(I, collxfrm_base, Size_t) /* Basic overhead in *xfrm() */
break;
case '\010': /* ^H */
PL_hints = SvIV(sv);
- CopHINTS_set(&PL_compiling, PL_hints);
break;
case '\011': /* ^I */ /* NOT \t in EBCDIC */
Safefree(PL_inplace);
CALL_BLOCK_HOOKS(bhk_pre_end, &retval);
LEAVE_SCOPE(floor);
- CopHINTS_set(&PL_compiling, PL_hints);
if (needblockscope)
PL_hints |= HINT_BLOCK_SCOPE; /* propagate out */
o = pad_leavemy();
/* Verify that we don't need to save it: */
assert(PL_curcop == &PL_compiling);
StructCopy(&PL_compiling, ¬_compiling, COP);
- CopHINTS_set(¬_compiling, PL_hints);
PL_curcop = ¬_compiling;
/* The above ensures that we run with all the correct hints of the
currently compiling COP, but that IN_PERL_RUNTIME is not true. */
#ifdef NATIVE_HINTS
cop->op_private |= NATIVE_HINTS;
#endif
- CopHINTS_set(&PL_compiling, CopHINTS_get(cop));
cop->op_next = (OP*)cop;
cop->cop_seq = seq;
GvCV_set(gv,0); /* cv has been hijacked */
call_list(oldscope, PL_beginav);
- CopHINTS_set(&PL_compiling, PL_hints);
LEAVE;
}
else
# define PL_amagic_generation PL_na
#endif /* !PERL_CORE */
+#define PL_hints PL_compiling.cop_hints
+
END_EXTERN_C
/*****************************************************************************/