/* On OP_DBSTATE, indicates breakpoint
* (runtime property) */
/* On OP_REQUIRE, was seen as CORE::require */
- /* On OP_ENTERWHEN, there's no condition */
+ /* On OP_(ENTER|LEAVE)WHEN, there's
+ no condition */
/* On OP_SMARTMATCH, an implicit smartmatch */
/* On OP_ANONHASH and OP_ANONLIST, create a
reference to the new anon hash or array */
that was optimised away, so it should
not be bound via =~ */
/* On OP_CONST, from a constant CV */
- /* On OP_GLOB, use Perl glob function */
+ /* On OP_GLOB, two meanings:
+ - Before ck_glob, called as CORE::glob
+ - After ck_glob, use Perl glob function
+ */
/* old names; don't use in new code, but don't break them, either */
#define OPf_LIST OPf_WANT_LIST
/* OP_RV2[AGH]V, OP_PAD[AH]V, OP_[AH]ELEM, OP_[AH]SLICE OP_AV2ARYLEN,
OP_R?KEYS, OP_SUBSTR, OP_POS, OP_VEC */
#define OPpMAYBE_LVSUB 8 /* We might be an lvalue to return */
+
+ /* OP_SUBSTR only */
+#define OPpSUBSTR_REPL_FIRST 16 /* 1st arg is replacement string */
+
/* OP_PADSV only */
#define OPpPAD_STATE 16 /* is a "state" pad */
/* for OP_RV2?V, lower bits carry hints (currently only HINT_STRICT_REFS) */
/* Private for OP_ENTEREVAL */
#define OPpEVAL_HAS_HH 2 /* Does it have a copy of %^H */
+#define OPpEVAL_UNICODE 4
+#define OPpEVAL_BYTES 8
+#define OPpEVAL_COPHH 16 /* Construct %^H from cop hints */
-/* Private for OP_CALLER and OP_WANTARRAY */
+/* Private for OP_CALLER, OP_WANTARRAY and OP_RUNCV */
#define OPpOFFBYONE 128 /* Treat caller(1) as caller(2) */
/* Private for OP_COREARGS */
union {
OP * op_pmreplstart; /* Only used in OP_SUBST */
#ifdef USE_ITHREADS
- char * op_pmstashpv; /* Only used in OP_MATCH, with PMf_ONCE set */
+ struct {
+ char * op_pmstashpv; /* Only used in OP_MATCH, with PMf_ONCE set */
+ U32 op_pmstashflags; /* currently only SVf_UTF8 or 0 */
+ } op_pmstashthr;
#else
HV * op_pmstash;
#endif
#ifdef USE_ITHREADS
# define PmopSTASHPV(o) \
- (((o)->op_pmflags & PMf_ONCE) ? (o)->op_pmstashstartu.op_pmstashpv : NULL)
+ (((o)->op_pmflags & PMf_ONCE) ? (o)->op_pmstashstartu.op_pmstashthr.op_pmstashpv : NULL)
# if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
# define PmopSTASHPV_set(o,pv) ({ \
assert((o)->op_pmflags & PMf_ONCE); \
- ((o)->op_pmstashstartu.op_pmstashpv = savesharedpv(pv)); \
+ ((o)->op_pmstashstartu.op_pmstashthr.op_pmstashpv = savesharedpv(pv)); \
})
# else
# define PmopSTASHPV_set(o,pv) \
- ((o)->op_pmstashstartu.op_pmstashpv = savesharedpv(pv))
+ ((o)->op_pmstashstartu.op_pmstashthr.op_pmstashpv = savesharedpv(pv))
# endif
-# define PmopSTASH(o) (PmopSTASHPV(o) \
- ? gv_stashpv((o)->op_pmstashstartu.op_pmstashpv,GV_ADD) : NULL)
-# define PmopSTASH_set(o,hv) PmopSTASHPV_set(o, ((hv) ? HvNAME_get(hv) : NULL))
+# define PmopSTASH_flags(o) ((o)->op_pmstashstartu.op_pmstashthr.op_pmstashflags)
+# define PmopSTASH_flags_set(o,flags) ((o)->op_pmstashstartu.op_pmstashthr.op_pmstashflags = flags)
+# define PmopSTASH(o) (PmopSTASHPV(o) \
+ ? gv_stashpv((o)->op_pmstashstartu.op_pmstashthr.op_pmstashpv, \
+ GV_ADD | PmopSTASH_flags(o)) : NULL)
+# define PmopSTASH_set(o,hv) (PmopSTASHPV_set(o, (hv) ? HvNAME_get(hv) : NULL), \
+ PmopSTASH_flags_set(o, \
+ ((hv) && HvNAME_HEK(hv) && \
+ HvNAMEUTF8(hv)) \
+ ? SVf_UTF8 \
+ : 0))
# define PmopSTASH_free(o) PerlMemShared_free(PmopSTASHPV(o))
#else
/* no longer used anywhere in core */
#ifndef PERL_CORE
#define cv_ckproto(cv, gv, p) \
- cv_ckproto_len((cv), (gv), (p), (p) ? strlen(p) : 0)
+ cv_ckproto_len_flags((cv), (gv), (p), (p) ? strlen(p) : 0, 0)
#endif
#ifdef PERL_CORE