This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use less memory in compiling regexes
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index 4d3465f..9f970a3 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -56,11 +56,6 @@ PERL_CALLCONV bool   Perl__is_utf8_FOO(pTHX_ const U8 classnum, const U8 *p)
 #define PERL_ARGS_ASSERT__IS_UTF8_FOO  \
        assert(p)
 
-PERL_STATIC_INLINE STRLEN      S__is_utf8_char_slow(const U8 *s, const U8 *e)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT__IS_UTF8_CHAR_SLOW    \
-       assert(s); assert(e)
-
 PERL_CALLCONV bool     Perl__is_utf8_idcont(pTHX_ const U8 *p)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT__IS_UTF8_IDCONT       \
@@ -122,9 +117,6 @@ PERL_CALLCONV SV *  Perl_amagic_deref_call(pTHX_ SV *ref, int method);
 #define PERL_ARGS_ASSERT_AMAGIC_DEREF_CALL     \
        assert(ref)
 PERL_CALLCONV bool     Perl_amagic_is_enabled(pTHX_ int method);
-PERL_STATIC_INLINE void        S_append_utf8_from_native_byte(const U8 byte, U8** dest);
-#define PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE  \
-       assert(dest)
 PERL_CALLCONV I32      Perl_apply(pTHX_ I32 type, SV** mark, SV** sp);
 #define PERL_ARGS_ASSERT_APPLY \
        assert(mark); assert(sp)
@@ -200,11 +192,6 @@ PERL_CALLCONV SV** Perl_av_store(pTHX_ AV *av, SSize_t key, SV *val);
 /* PERL_CALLCONV SSize_t       Perl_av_tindex(pTHX_ AV *av)
                        __attribute__warn_unused_result__; */
 
-PERL_STATIC_INLINE SSize_t     S_av_top_index(pTHX_ AV *av)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_AV_TOP_INDEX  \
-       assert(av)
-
 PERL_CALLCONV void     Perl_av_undef(pTHX_ AV *av);
 #define PERL_ARGS_ASSERT_AV_UNDEF      \
        assert(av)
@@ -219,7 +206,7 @@ PERL_CALLCONV OP*   Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
 PERL_CALLCONV OP*      Perl_block_end(pTHX_ I32 floor, OP* seq)
                        __attribute__warn_unused_result__;
 
-PERL_CALLCONV I32      Perl_block_gimme(pTHX)
+PERL_CALLCONV U8       Perl_block_gimme(pTHX)
                        __attribute__warn_unused_result__;
 
 PERL_CALLCONV int      Perl_block_start(pTHX_ int full)
@@ -535,6 +522,9 @@ PERL_CALLCONV void  Perl_ck_warner_d(pTHX_ U32 err, const char* pat, ...)
 
 PERL_CALLCONV bool     Perl_ckwarn(pTHX_ U32 w);
 PERL_CALLCONV bool     Perl_ckwarn_d(pTHX_ U32 w);
+PERL_CALLCONV void     Perl_clear_defarray(pTHX_ AV* av, bool abandon);
+#define PERL_ARGS_ASSERT_CLEAR_DEFARRAY        \
+       assert(av)
 PERL_CALLCONV const COP*       Perl_closest_cop(pTHX_ const COP *cop, const OP *o, const OP *curop, bool opnext);
 #define PERL_ARGS_ASSERT_CLOSEST_COP   \
        assert(cop)
@@ -550,7 +540,7 @@ PERL_CALLCONV SV *  Perl_core_prototype(pTHX_ SV *sv, const char *name, const int
 PERL_CALLCONV OP *     Perl_coresub_op(pTHX_ SV *const coreargssv, const int code, const int opnum);
 #define PERL_ARGS_ASSERT_CORESUB_OP    \
        assert(coreargssv)
-PERL_CALLCONV PERL_CONTEXT*    Perl_create_eval_scope(pTHX_ U32 flags);
+PERL_CALLCONV void     Perl_create_eval_scope(pTHX_ OP *retop, U32 flags);
 PERL_CALLCONV_NO_RET void      Perl_croak(pTHX_ const char* pat, ...)
                        __attribute__noreturn__
                        __attribute__format__null_ok__(__printf__,pTHX_1,pTHX_2);
@@ -684,10 +674,10 @@ PERL_CALLCONV_NO_RET void Perl_die_unwind(pTHX_ SV* msv)
 #define PERL_ARGS_ASSERT_DIE_UNWIND    \
        assert(msv)
 
-/* PERL_CALLCONV DO_EXEC_TYPE  Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp); */
+/* PERL_CALLCONV bool  Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp); */
 #define PERL_ARGS_ASSERT_DO_AEXEC      \
        assert(mark); assert(sp)
-PERL_CALLCONV DO_EXEC_TYPE     Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp, int fd, int do_report);
+PERL_CALLCONV bool     Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp, int fd, int do_report);
 #define PERL_ARGS_ASSERT_DO_AEXEC5     \
        assert(mark); assert(sp)
 PERL_CALLCONV int      Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode);
@@ -785,7 +775,7 @@ PERL_CALLCONV OP *  Perl_doref(pTHX_ OP *o, I32 type, bool set_op_ref);
 #define PERL_ARGS_ASSERT_DOREF \
        assert(o)
 PERL_CALLCONV void     Perl_dounwind(pTHX_ I32 cxix);
-PERL_CALLCONV I32      Perl_dowantarray(pTHX)
+PERL_CALLCONV U8       Perl_dowantarray(pTHX)
                        __attribute__warn_unused_result__;
 
 PERL_CALLCONV void     Perl_drand48_init_r(perl_drand48_t *random_state, U32 seed);
@@ -860,9 +850,6 @@ PERL_CALLCONV CV*   Perl_find_runcv_where(pTHX_ U8 cond, IV arg, U32 *db_seqp)
                        __attribute__warn_unused_result__;
 
 PERL_CALLCONV SV*      Perl_find_rundefsv(pTHX);
-PERL_CALLCONV SV*      Perl_find_rundefsv2(pTHX_ CV *cv, U32 seq);
-#define PERL_ARGS_ASSERT_FIND_RUNDEFSV2        \
-       assert(cv)
 PERL_CALLCONV PADOFFSET        Perl_find_rundefsvoffset(pTHX)
                        __attribute__deprecated__;
 
@@ -893,12 +880,6 @@ PERL_CALLCONV char*        Perl_form(pTHX_ const char* pat, ...)
 #define PERL_ARGS_ASSERT_FORM  \
        assert(pat)
 
-PERL_CALLCONV char*    Perl_form_short_octal_warning(pTHX_ const char * const s, const STRLEN len)
-                       __attribute__warn_unused_result__
-                       __attribute__pure__;
-#define PERL_ARGS_ASSERT_FORM_SHORT_OCTAL_WARNING      \
-       assert(s)
-
 PERL_CALLCONV void     Perl_free_tied_hv_pool(pTHX);
 PERL_CALLCONV void     Perl_free_tmps(pTHX);
 PERL_CALLCONV AV*      Perl_get_av(pTHX_ const char *name, I32 flags);
@@ -960,14 +941,6 @@ PERL_CALLCONV bool Perl_grok_atoUV(const char* pv, UV* valptr, const char** endp
 PERL_CALLCONV UV       Perl_grok_bin(pTHX_ const char* start, STRLEN* len_p, I32* flags, NV *result);
 #define PERL_ARGS_ASSERT_GROK_BIN      \
        assert(start); assert(len_p); assert(flags)
-PERL_CALLCONV char     Perl_grok_bslash_c(pTHX_ const char source, const bool output_warning)
-                       __attribute__warn_unused_result__;
-
-PERL_CALLCONV bool     Perl_grok_bslash_o(pTHX_ char** s, UV* uv, const char** error_msg, const bool output_warning, const bool strict, const bool silence_non_portable, const bool utf8)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_GROK_BSLASH_O \
-       assert(s); assert(uv); assert(error_msg)
-
 PERL_CALLCONV UV       Perl_grok_hex(pTHX_ const char* start, STRLEN* len_p, I32* flags, NV *result);
 #define PERL_ARGS_ASSERT_GROK_HEX      \
        assert(start); assert(len_p); assert(flags)
@@ -1309,11 +1282,6 @@ PERL_CALLCONV bool       Perl_is_invariant_string(const U8 *s, STRLEN len)
 PERL_CALLCONV I32      Perl_is_lvalue_sub(pTHX)
                        __attribute__warn_unused_result__;
 
-PERL_STATIC_INLINE bool        S_is_safe_syscall(pTHX_ const char *pv, STRLEN len, const char *what, const char *op_name)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_SAFE_SYSCALL       \
-       assert(pv); assert(what); assert(op_name)
-
 PERL_CALLCONV bool     Perl_is_uni_alnum(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
@@ -1628,6 +1596,9 @@ PERL_CALLCONV I32 Perl_keyword(pTHX_ const char *name, I32 len, bool all_keyword
 PERL_CALLCONV int      Perl_keyword_plugin_standard(pTHX_ char* keyword_ptr, STRLEN keyword_len, OP** op_ptr);
 #define PERL_ARGS_ASSERT_KEYWORD_PLUGIN_STANDARD       \
        assert(keyword_ptr); assert(op_ptr)
+PERL_CALLCONV void     Perl_leave_adjust_stacks(pTHX_ SV **from_sp, SV **to_sp, U8 gimme, int filter);
+#define PERL_ARGS_ASSERT_LEAVE_ADJUST_STACKS   \
+       assert(from_sp); assert(to_sp)
 PERL_CALLCONV void     Perl_leave_scope(pTHX_ I32 base);
 PERL_CALLCONV bool     Perl_lex_bufutf8(pTHX);
 PERL_CALLCONV void     Perl_lex_discard_to(pTHX_ char* ptr);
@@ -2786,6 +2757,7 @@ PERL_CALLCONV char*       Perl_savesvpv(pTHX_ SV* sv)
 #define PERL_ARGS_ASSERT_SAVESVPV      \
        assert(sv)
 
+PERL_CALLCONV void     Perl_savetmps(pTHX);
 PERL_CALLCONV OP*      Perl_sawparens(pTHX_ OP* o);
 PERL_CALLCONV OP*      Perl_scalar(pTHX_ OP* o);
 PERL_CALLCONV OP*      Perl_scalarvoid(pTHX_ OP* o);
@@ -2900,7 +2872,7 @@ PERL_CALLCONV char*       Perl_sv_2pvutf8(pTHX_ SV *sv, STRLEN *const lp);
 PERL_CALLCONV UV       Perl_sv_2uv_flags(pTHX_ SV *const sv, const I32 flags);
 #define PERL_ARGS_ASSERT_SV_2UV_FLAGS  \
        assert(sv)
-PERL_CALLCONV int      Perl_sv_backoff(SV *const sv);
+PERL_CALLCONV void     Perl_sv_backoff(SV *const sv);
 #define PERL_ARGS_ASSERT_SV_BACKOFF    \
        assert(sv)
 PERL_CALLCONV SV*      Perl_sv_bless(pTHX_ SV *const sv, HV *const stash);
@@ -3084,9 +3056,6 @@ PERL_CALLCONV void        Perl_sv_nosharing(pTHX_ SV *sv);
 PERL_CALLCONV NV       Perl_sv_nv(pTHX_ SV* sv);
 #define PERL_ARGS_ASSERT_SV_NV \
        assert(sv)
-PERL_STATIC_INLINE bool        S_sv_only_taint_gmagic(SV *sv);
-#define PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC  \
-       assert(sv)
 PERL_CALLCONV char*    Perl_sv_peek(pTHX_ SV* sv);
 PERL_CALLCONV void     Perl_sv_pos_b2u(pTHX_ SV *const sv, I32 *const offsetp);
 #define PERL_ARGS_ASSERT_SV_POS_B2U    \
@@ -3365,9 +3334,11 @@ PERL_CALLCONV U32        Perl_to_uni_upper_lc(pTHX_ U32 c)
                        __attribute__warn_unused_result__
                        __attribute__pure__;
 
-PERL_CALLCONV UV       Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special);
+PERL_CALLCONV UV       Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special)
+                       __attribute__deprecated__;
 #define PERL_ARGS_ASSERT_TO_UTF8_CASE  \
        assert(p); assert(ustrp); assert(swashp); assert(normal)
+
 /* PERL_CALLCONV UV    Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); */
 #define PERL_ARGS_ASSERT_TO_UTF8_FOLD  \
        assert(p); assert(ustrp)
@@ -3588,7 +3559,7 @@ PERL_CALLCONV Signal_t    Perl_sighandler(int sig);
 PERL_CALLCONV void     Perl_sv_nounlocking(pTHX_ SV *sv);
 #endif
 #if !(defined(PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION))
-PERL_CALLCONV DO_EXEC_TYPE     Perl_do_exec(pTHX_ const char* cmd);
+PERL_CALLCONV bool     Perl_do_exec(pTHX_ const char* cmd);
 #define PERL_ARGS_ASSERT_DO_EXEC       \
        assert(cmd)
 #endif
@@ -3688,20 +3659,18 @@ PERL_STATIC_INLINE IV*  S_get_invlist_previous_index_addr(SV* invlist)
 #define PERL_ARGS_ASSERT_GET_INVLIST_PREVIOUS_INDEX_ADDR       \
        assert(invlist)
 
-PERL_STATIC_INLINE bool        S_invlist_is_iterating(SV* const invlist)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_INVLIST_IS_ITERATING  \
-       assert(invlist)
-
 PERL_STATIC_INLINE IV  S_invlist_previous_index(SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_INVLIST_PREVIOUS_INDEX        \
        assert(invlist)
 
+STATIC void    S_invlist_replace_list(pTHX_ SV *dest, SV *src);
+#define PERL_ARGS_ASSERT_INVLIST_REPLACE_LIST  \
+       assert(dest); assert(src)
 PERL_STATIC_INLINE void        S_invlist_set_previous_index(SV* const invlist, const IV index);
 #define PERL_ARGS_ASSERT_INVLIST_SET_PREVIOUS_INDEX    \
        assert(invlist)
-PERL_STATIC_INLINE void        S_invlist_trim(SV* const invlist);
+PERL_STATIC_INLINE void        S_invlist_trim(SV* invlist);
 #define PERL_ARGS_ASSERT_INVLIST_TRIM  \
        assert(invlist)
 #  endif
@@ -3719,6 +3688,83 @@ STATIC SV *      S_incpush_if_exists(pTHX_ AV *const av, SV *dir, SV *const stem);
        assert(av); assert(dir); assert(stem)
 #  endif
 #endif
+#if !defined(PERL_NO_INLINE_FUNCTIONS)
+PERL_STATIC_INLINE STRLEN      S__is_utf8_char_slow(const U8 *s, const U8 *e)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT__IS_UTF8_CHAR_SLOW    \
+       assert(s); assert(e)
+
+PERL_STATIC_INLINE void        S_append_utf8_from_native_byte(const U8 byte, U8** dest);
+#define PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE  \
+       assert(dest)
+PERL_STATIC_INLINE SSize_t     S_av_top_index(pTHX_ AV *av)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_AV_TOP_INDEX  \
+       assert(av)
+
+PERL_STATIC_INLINE void        S_cx_popblock(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPBLOCK   \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popeval(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPEVAL    \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popformat(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPFORMAT  \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popgiven(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPGIVEN   \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_poploop(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPLOOP    \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popsub(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPSUB     \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popsub_args(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPSUB_ARGS        \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popsub_common(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPSUB_COMMON      \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_popwhen(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_POPWHEN    \
+       assert(cx)
+PERL_STATIC_INLINE PERL_CONTEXT *      S_cx_pushblock(pTHX_ U8 type, U8 gimme, SV** sp, I32 saveix);
+#define PERL_ARGS_ASSERT_CX_PUSHBLOCK  \
+       assert(sp)
+PERL_STATIC_INLINE void        S_cx_pusheval(pTHX_ PERL_CONTEXT *cx, OP *retop, SV *namesv);
+#define PERL_ARGS_ASSERT_CX_PUSHEVAL   \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_pushformat(pTHX_ PERL_CONTEXT *cx, CV *cv, OP *retop, GV *gv);
+#define PERL_ARGS_ASSERT_CX_PUSHFORMAT \
+       assert(cx); assert(cv)
+PERL_STATIC_INLINE void        S_cx_pushgiven(pTHX_ PERL_CONTEXT *cx, SV *orig_defsv);
+#define PERL_ARGS_ASSERT_CX_PUSHGIVEN  \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_pushloop_for(pTHX_ PERL_CONTEXT *cx, void *itervarp, SV *itersave);
+#define PERL_ARGS_ASSERT_CX_PUSHLOOP_FOR       \
+       assert(cx); assert(itervarp)
+PERL_STATIC_INLINE void        S_cx_pushloop_plain(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_PUSHLOOP_PLAIN     \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_pushsub(pTHX_ PERL_CONTEXT *cx, CV *cv, OP *retop, bool hasargs);
+#define PERL_ARGS_ASSERT_CX_PUSHSUB    \
+       assert(cx); assert(cv)
+PERL_STATIC_INLINE void        S_cx_pushwhen(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_PUSHWHEN   \
+       assert(cx)
+PERL_STATIC_INLINE void        S_cx_topblock(pTHX_ PERL_CONTEXT *cx);
+#define PERL_ARGS_ASSERT_CX_TOPBLOCK   \
+       assert(cx)
+PERL_STATIC_INLINE bool        S_is_safe_syscall(pTHX_ const char *pv, STRLEN len, const char *what, const char *op_name)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_IS_SAFE_SYSCALL       \
+       assert(pv); assert(what); assert(op_name)
+
+PERL_STATIC_INLINE bool        S_sv_only_taint_gmagic(SV *sv);
+#define PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC  \
+       assert(sv)
+#endif
 #if !defined(PERL_NO_UTF16_FILTER)
 #  if defined(PERL_IN_TOKE_C)
 STATIC U8*     S_add_utf16_textfilter(pTHX_ U8 *const s, bool reversed);
@@ -3747,7 +3793,7 @@ STATIC NV S_mulexp10(NV value, I32 exponent);
 #  endif
 #endif
 #if !defined(WIN32)
-PERL_CALLCONV DO_EXEC_TYPE     Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report);
+PERL_CALLCONV bool     Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report);
 #define PERL_ARGS_ASSERT_DO_EXEC3      \
        assert(incmd)
 #endif
@@ -3790,9 +3836,15 @@ STATIC void      S_dump_trie_interim_table(pTHX_ const struct _reg_trie_data *trie, H
 STATIC const regnode*  S_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, const regnode *last, const regnode *plast, SV* sv, I32 indent, U32 depth);
 #define PERL_ARGS_ASSERT_DUMPUNTIL     \
        assert(r); assert(start); assert(node); assert(sv)
-STATIC bool    S_put_charclass_bitmap_innards(pTHX_ SV* sv, char* bitmap, SV** bitmap_invlist);
+STATIC bool    S_put_charclass_bitmap_innards(pTHX_ SV* sv, char* bitmap, SV* nonbitmap_invlist, SV* only_utf8_locale_invlist, const regnode * const node);
 #define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS  \
        assert(sv); assert(bitmap)
+STATIC SV*     S_put_charclass_bitmap_innards_common(pTHX_ SV* invlist, SV* posixes, SV* only_utf8, SV* not_utf8, SV* only_utf8_locale, const bool invert);
+#define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS_COMMON   \
+       assert(invlist)
+STATIC void    S_put_charclass_bitmap_innards_invlist(pTHX_ SV *sv, SV* invlist);
+#define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS_INVLIST  \
+       assert(sv); assert(invlist)
 STATIC void    S_put_code_point(pTHX_ SV* sv, UV c);
 #define PERL_ARGS_ASSERT_PUT_CODE_POINT        \
        assert(sv)
@@ -3954,7 +4006,7 @@ PERL_CALLCONV PADOFFSET   Perl_op_refcnt_dec(pTHX_ OP *o);
 PERL_CALLCONV OP *     Perl_op_refcnt_inc(pTHX_ OP *o);
 #endif
 #if defined(PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION)
-/* PERL_CALLCONV DO_EXEC_TYPE  Perl_do_exec(pTHX_ const char* cmd); */
+/* PERL_CALLCONV bool  Perl_do_exec(pTHX_ const char* cmd); */
 #endif
 #if defined(PERL_DONT_CREATE_GVSV)
 /* PERL_CALLCONV GV*   Perl_gv_SVadd(pTHX_ GV *gv); */
@@ -4469,7 +4521,7 @@ STATIC OP*        S_do_smartmatch(pTHX_ HV* seen_this, HV* seen_other, const bool copie
 STATIC OP*     S_docatch(pTHX_ OP *o)
                        __attribute__warn_unused_result__;
 
-STATIC bool    S_doeval(pTHX_ int gimme, CV* outside, U32 seq, HV* hh);
+STATIC bool    S_doeval_compile(pTHX_ U8 gimme, CV* outside, U32 seq, HV* hh);
 STATIC OP*     S_dofindlabel(pTHX_ OP *o, const char *label, STRLEN len, U32 flags, OP **opstack, OP **oplimit)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DOFINDLABEL   \
@@ -4481,7 +4533,7 @@ STATIC MAGIC *    S_doparseform(pTHX_ SV *sv);
 STATIC I32     S_dopoptoeval(pTHX_ I32 startingblock)
                        __attribute__warn_unused_result__;
 
-STATIC I32     S_dopoptogiven(pTHX_ I32 startingblock)
+STATIC I32     S_dopoptogivenfor(pTHX_ I32 startingblock)
                        __attribute__warn_unused_result__;
 
 STATIC I32     S_dopoptolabel(pTHX_ const char *label, STRLEN len, U32 flags)
@@ -4500,9 +4552,6 @@ STATIC I32        S_dopoptosub_at(pTHX_ const PERL_CONTEXT* cxstk, I32 startingblock)
 STATIC I32     S_dopoptowhen(pTHX_ I32 startingblock)
                        __attribute__warn_unused_result__;
 
-STATIC SV **   S_leave_common(pTHX_ SV **newsp, SV **sp, SV **mark, I32 gimme, U32 flags, bool lvalue);
-#define PERL_ARGS_ASSERT_LEAVE_COMMON  \
-       assert(newsp); assert(sp); assert(mark)
 STATIC PMOP*   S_make_matcher(pTHX_ REGEXP* re)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_MAKE_MATCHER  \
@@ -4675,9 +4724,11 @@ PERL_STATIC_INLINE U8    S_compute_EXACTish(RExC_state_t *pRExC_state);
 STATIC regnode *       S_construct_ahocorasick_from_trie(pTHX_ RExC_state_t *pRExC_state, regnode *source, U32 depth);
 #define PERL_ARGS_ASSERT_CONSTRUCT_AHOCORASICK_FROM_TRIE       \
        assert(pRExC_state); assert(source)
-STATIC bool    S_could_it_be_a_POSIX_class(RExC_state_t *pRExC_state);
-#define PERL_ARGS_ASSERT_COULD_IT_BE_A_POSIX_CLASS     \
-       assert(pRExC_state)
+STATIC int     S_edit_distance(const UV *src, const UV *tgt, const STRLEN x, const STRLEN y, const SSize_t maxDistance)
+                       __attribute__pure__;
+#define PERL_ARGS_ASSERT_EDIT_DISTANCE \
+       assert(src); assert(tgt)
+
 STATIC SV*     S_get_ANYOF_cp_list_for_ssc(pTHX_ const RExC_state_t *pRExC_state, const regnode_charclass* const node);
 #define PERL_ARGS_ASSERT_GET_ANYOF_CP_LIST_FOR_SSC     \
        assert(pRExC_state); assert(node)
@@ -4686,9 +4737,15 @@ PERL_STATIC_INLINE STRLEN*       S_get_invlist_iter_addr(SV* invlist)
 #define PERL_ARGS_ASSERT_GET_INVLIST_ITER_ADDR \
        assert(invlist)
 
-STATIC bool    S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode** nodep, UV *code_point_p, int* cp_count, I32 *flagp, const U32 depth);
+STATIC bool    S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode** nodep, UV *code_point_p, int* cp_count, I32 *flagp, const bool strict, const U32 depth);
 #define PERL_ARGS_ASSERT_GROK_BSLASH_N \
        assert(pRExC_state); assert(flagp)
+PERL_STATIC_INLINE regnode*    S_handle_named_backref(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, char * parse_start, char ch);
+#define PERL_ARGS_ASSERT_HANDLE_NAMED_BACKREF  \
+       assert(pRExC_state); assert(flagp); assert(parse_start)
+STATIC int     S_handle_possible_posix(pTHX_ RExC_state_t *pRExC_state, const char* const s, char ** updated_parse_ptr, AV** posix_warnings);
+#define PERL_ARGS_ASSERT_HANDLE_POSSIBLE_POSIX \
+       assert(pRExC_state); assert(s)
 STATIC regnode*        S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV ** return_invlist, I32 *flagp, U32 depth, char * const oregcomp_parse);
 #define PERL_ARGS_ASSERT_HANDLE_REGEX_SETS     \
        assert(pRExC_state); assert(flagp); assert(oregcomp_parse)
@@ -4697,6 +4754,11 @@ PERL_STATIC_INLINE SV*   S_invlist_clone(pTHX_ SV* const invlist)
 #define PERL_ARGS_ASSERT_INVLIST_CLONE \
        assert(invlist)
 
+STATIC SV*     S_invlist_contents(pTHX_ SV* const invlist, const bool traditional_style)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_INVLIST_CONTENTS      \
+       assert(invlist)
+
 STATIC void    S_invlist_extend(pTHX_ SV* const invlist, const UV len);
 #define PERL_ARGS_ASSERT_INVLIST_EXTEND        \
        assert(invlist)
@@ -4705,6 +4767,11 @@ PERL_STATIC_INLINE UV    S_invlist_highest(SV* const invlist)
 #define PERL_ARGS_ASSERT_INVLIST_HIGHEST       \
        assert(invlist)
 
+PERL_STATIC_INLINE bool        S_invlist_is_iterating(SV* const invlist)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_INVLIST_IS_ITERATING  \
+       assert(invlist)
+
 PERL_STATIC_INLINE void        S_invlist_iterfinish(SV* invlist);
 #define PERL_ARGS_ASSERT_INVLIST_ITERFINISH    \
        assert(invlist)
@@ -4733,7 +4800,7 @@ STATIC U32        S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan, UV *min_
 STATIC I32     S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *first, regnode *last, regnode *tail, U32 word_count, U32 flags, U32 depth);
 #define PERL_ARGS_ASSERT_MAKE_TRIE     \
        assert(pRExC_state); assert(startbranch); assert(first); assert(last); assert(tail)
-STATIC char *  S_nextchar(pTHX_ RExC_state_t *pRExC_state);
+STATIC void    S_nextchar(pTHX_ RExC_state_t *pRExC_state);
 #define PERL_ARGS_ASSERT_NEXTCHAR      \
        assert(pRExC_state)
 STATIC void    S_parse_lparen_question_flags(pTHX_ RExC_state_t *pRExC_state);
@@ -4756,7 +4823,7 @@ STATIC regnode*   S_reg2Lanode(pTHX_ RExC_state_t *pRExC_state, const U8 op, const
 STATIC regnode*        S_reg_node(pTHX_ RExC_state_t *pRExC_state, U8 op);
 #define PERL_ARGS_ASSERT_REG_NODE      \
        assert(pRExC_state)
-STATIC UV      S_reg_recode(pTHX_ const char value, SV **encp);
+STATIC UV      S_reg_recode(pTHX_ const U8 value, SV **encp);
 #define PERL_ARGS_ASSERT_REG_RECODE    \
        assert(encp)
 STATIC SV *    S_reg_scan_name(pTHX_ RExC_state_t *pRExC_state, U32 flags);
@@ -4774,7 +4841,7 @@ STATIC regnode*   S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth
 STATIC regnode*        S_regbranch(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, I32 first, U32 depth);
 #define PERL_ARGS_ASSERT_REGBRANCH     \
        assert(pRExC_state); assert(flagp)
-STATIC regnode*        S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, const bool stop_at_1, bool allow_multi_fold, const bool silence_non_portable, const bool strict, const bool optimizable, SV** ret_invlist);
+STATIC regnode*        S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, const bool stop_at_1, bool allow_multi_fold, const bool silence_non_portable, const bool strict, bool optimizable, SV** ret_invlist, AV** posix_warnings);
 #define PERL_ARGS_ASSERT_REGCLASS      \
        assert(pRExC_state); assert(flagp)
 STATIC unsigned int    S_regex_set_precedence(const U8 my_operator)
@@ -4786,18 +4853,10 @@ STATIC void     S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op, regnode *opnd, U
 STATIC regnode*        S_regnode_guts(pTHX_ RExC_state_t *pRExC_state, const U8 op, const STRLEN extra_len, const char* const name);
 #define PERL_ARGS_ASSERT_REGNODE_GUTS  \
        assert(pRExC_state); assert(name)
-STATIC char *  S_regpatws(RExC_state_t *pRExC_state, char *p, const bool recognize_comment)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_REGPATWS      \
-       assert(pRExC_state); assert(p)
-
 STATIC regnode*        S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth);
 #define PERL_ARGS_ASSERT_REGPIECE      \
        assert(pRExC_state); assert(flagp)
-PERL_STATIC_INLINE I32 S_regpposixcc(pTHX_ RExC_state_t *pRExC_state, I32 value, const bool strict);
-#define PERL_ARGS_ASSERT_REGPPOSIXCC   \
-       assert(pRExC_state)
-STATIC void    S_regtail(pTHX_ RExC_state_t *pRExC_state, regnode *p, const regnode *val, U32 depth);
+STATIC void    S_regtail(pTHX_ RExC_state_t * pRExC_state, const regnode * const p, const regnode * const val, const U32 depth);
 #define PERL_ARGS_ASSERT_REGTAIL       \
        assert(pRExC_state); assert(p); assert(val)
 STATIC void    S_scan_commit(pTHX_ const RExC_state_t *pRExC_state, struct scan_data_t *data, SSize_t *minlenp, int is_inf);
@@ -4806,6 +4865,9 @@ STATIC void       S_scan_commit(pTHX_ const RExC_state_t *pRExC_state, struct scan_dat
 STATIC void    S_set_ANYOF_arg(pTHX_ RExC_state_t* const pRExC_state, regnode* const node, SV* const cp_list, SV* const runtime_defns, SV* const only_utf8_locale_list, SV* const swash, const bool has_user_defined_property);
 #define PERL_ARGS_ASSERT_SET_ANYOF_ARG \
        assert(pRExC_state); assert(node)
+STATIC void    S_skip_to_be_ignored_text(pTHX_ RExC_state_t *pRExC_state, char ** p, const bool force_to_xmod);
+#define PERL_ARGS_ASSERT_SKIP_TO_BE_IGNORED_TEXT       \
+       assert(pRExC_state); assert(p)
 PERL_STATIC_INLINE void        S_ssc_add_range(pTHX_ regnode_ssc *ssc, UV const start, UV const end);
 #define PERL_ARGS_ASSERT_SSC_ADD_RANGE \
        assert(ssc)
@@ -4856,6 +4918,9 @@ PERL_CALLCONV void        Perl__invlist_dump(pTHX_ PerlIO *file, I32 level, const char*
        assert(file); assert(indent); assert(invlist)
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_PERL_C) || defined(PERL_IN_UTF8_C)
+PERL_CALLCONV bool     Perl__invlistEQ(pTHX_ SV* const a, SV* const b, const bool complement_b);
+#define PERL_ARGS_ASSERT__INVLISTEQ    \
+       assert(a); assert(b)
 PERL_CALLCONV SV*      Perl__new_invlist_C_array(pTHX_ const UV* const list)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT__NEW_INVLIST_C_ARRAY  \
@@ -4863,7 +4928,7 @@ PERL_CALLCONV SV* Perl__new_invlist_C_array(pTHX_ const UV* const list)
 
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C)
-PERL_CALLCONV SV*      Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, const struct regnode *node, bool doinit, SV **listsvp, SV **lonly_utf8_locale, SV *exclude_list);
+PERL_CALLCONV SV*      Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, const struct regnode *node, bool doinit, SV **listsvp, SV **lonly_utf8_locale, SV **output_invlist);
 #define PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA  \
        assert(node)
 PERL_CALLCONV void     Perl__load_PL_utf8_foldclosures(pTHX);
@@ -4882,11 +4947,6 @@ PERL_STATIC_INLINE bool  S__invlist_contains_cp(SV* const invlist, const UV cp)
 #define PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP  \
        assert(invlist)
 
-PERL_CALLCONV SV*      Perl__invlist_contents(pTHX_ SV* const invlist)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT__INVLIST_CONTENTS     \
-       assert(invlist)
-
 PERL_STATIC_INLINE UV  S__invlist_len(SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT__INVLIST_LEN  \
@@ -4918,8 +4978,21 @@ PERL_CALLCONV SV*        Perl__core_swash_init(pTHX_ const char* pkg, const char* name,
 #define PERL_ARGS_ASSERT__CORE_SWASH_INIT      \
        assert(pkg); assert(name); assert(listsv)
 #endif
-#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
-PERL_STATIC_INLINE bool        S_grok_bslash_x(pTHX_ char** s, UV* uv, const char** error_msg, const bool output_warning, const bool strict, const bool silence_non_portable, const bool utf8)
+#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_DQUOTE_C)
+PERL_STATIC_INLINE char*       S_form_short_octal_warning(pTHX_ const char * const s, const STRLEN len)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FORM_SHORT_OCTAL_WARNING      \
+       assert(s)
+
+PERL_CALLCONV char     Perl_grok_bslash_c(pTHX_ const char source, const bool output_warning)
+                       __attribute__warn_unused_result__;
+
+PERL_CALLCONV bool     Perl_grok_bslash_o(pTHX_ char** s, UV* uv, const char** error_msg, const bool output_warning, const bool strict, const bool silence_non_portable, const bool utf8)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_GROK_BSLASH_O \
+       assert(s); assert(uv); assert(error_msg)
+
+PERL_CALLCONV bool     Perl_grok_bslash_x(pTHX_ char** s, UV* uv, const char** error_msg, const bool output_warning, const bool strict, const bool silence_non_portable, const bool utf8)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_GROK_BSLASH_X \
        assert(s); assert(uv); assert(error_msg)
@@ -4965,16 +5038,26 @@ PERL_CALLCONV SV*       Perl__swash_to_invlist(pTHX_ SV* const swash)
 
 #endif
 #if defined(PERL_IN_REGEXEC_C)
+STATIC LB_enum S_advance_one_LB(pTHX_ U8 ** curpos, const U8 * const strend, const bool utf8_target)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_ADVANCE_ONE_LB        \
+       assert(curpos); assert(strend)
+
 STATIC SB_enum S_advance_one_SB(pTHX_ U8 ** curpos, const U8 * const strend, const bool utf8_target)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_ADVANCE_ONE_SB        \
        assert(curpos); assert(strend)
 
-STATIC WB_enum S_advance_one_WB(pTHX_ U8 ** curpos, const U8 * const strend, const bool utf8_target)
+STATIC WB_enum S_advance_one_WB(pTHX_ U8 ** curpos, const U8 * const strend, const bool utf8_target, const bool skip_Extend_Format)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_ADVANCE_ONE_WB        \
        assert(curpos); assert(strend)
 
+STATIC LB_enum S_backup_one_LB(pTHX_ const U8 * const strbeg, U8 ** curpos, const bool utf8_target)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_BACKUP_ONE_LB \
+       assert(strbeg); assert(curpos)
+
 STATIC SB_enum S_backup_one_SB(pTHX_ const U8 * const strbeg, U8 ** curpos, const bool utf8_target)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_BACKUP_ONE_SB \
@@ -4998,9 +5081,14 @@ STATIC bool      S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character)
 #define PERL_ARGS_ASSERT_ISFOO_UTF8_LC \
        assert(character)
 
-STATIC bool    S_isGCB(const GCB_enum before, const GCB_enum after)
+PERL_STATIC_INLINE bool        S_isGCB(const GCB_enum before, const GCB_enum after)
                        __attribute__warn_unused_result__;
 
+STATIC bool    S_isLB(pTHX_ LB_enum before, LB_enum after, const U8 * const strbeg, const U8 * const curpos, const U8 * const strend, const bool utf8_target)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_ISLB  \
+       assert(strbeg); assert(curpos); assert(strend)
+
 STATIC bool    S_isSB(pTHX_ SB_enum before, SB_enum after, const U8 * const strbeg, const U8 * const curpos, const U8 * const strend, const bool utf8_target)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_ISSB  \
@@ -5052,7 +5140,7 @@ STATIC I32        S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, r
 #define PERL_ARGS_ASSERT_REGREPEAT     \
        assert(prog); assert(startposp); assert(p); assert(reginfo)
 
-STATIC I32     S_regtry(pTHX_ regmatch_info *reginfo, char **startposp)
+STATIC bool    S_regtry(pTHX_ regmatch_info *reginfo, char **startposp)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_REGTRY        \
        assert(reginfo); assert(startposp)
@@ -5317,6 +5405,9 @@ STATIC bool       S_isa_lookup(pTHX_ HV *stash, const char * const name, STRLEN len, U
        assert(stash); assert(name)
 #endif
 #if defined(PERL_IN_UTF8_C)
+STATIC UV      S__to_utf8_case(pTHX_ const UV uv1, const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special);
+#define PERL_ARGS_ASSERT__TO_UTF8_CASE \
+       assert(p); assert(ustrp); assert(swashp); assert(normal)
 STATIC UV      S_check_locale_boundary_crossing(pTHX_ const U8* const p, const UV result, U8* const ustrp, STRLEN *lenp)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_CHECK_LOCALE_BOUNDARY_CROSSING        \