#define _PERL_OBJECT_THIS
#define PERL_OBJECT_THIS_
#define CALL_FPTR(fptr) (*fptr)
+#define MEMBER_TO_FPTR(name) name
#endif /* !PERL_CORE */
#define CALLRUNOPS PL_runops
#endif
-#ifdef MYMALLOC
-# include "malloc_ctl.h"
-#endif
-
struct RExC_state_t;
struct _reg_trie_data;
#define PERL_EXIT_EXPECTED 0x01
#define PERL_EXIT_DESTRUCT_END 0x02 /* Run END in perl_destruct */
-#ifndef MEMBER_TO_FPTR
-# define MEMBER_TO_FPTR(name) name
-#endif
-
#ifndef PERL_CORE
/* format to use for version numbers in file/directory names */
/* XXX move to Configure? */
#define PERL_MAGIC_rhash '%' /* extra data for restricted hashes */
#define PERL_MAGIC_arylen_p '@' /* to move arylen out of XPVAV */
#define PERL_MAGIC_ext '~' /* Available for use by extensions */
+#define PERL_MAGIC_checkcall ']' /* inlining/mutation of call to this CV */
#if defined(DEBUGGING) && defined(I_ASSERT)
# include <assert.h>
typedef bool (*destroyable_proc_t) (pTHX_ SV *sv);
typedef void (*despatch_signals_proc_t) (pTHX);
-/* _ (for $_) must be first in the following list (DEFSV requires it) */
-#define THREADSV_NAMES "_123456789&`'+/.,\\\";^-%=|~:\001\005!@"
-
/* NeXT has problems with crt0.o globals */
#if defined(__DYNAMIC__) && \
(defined(NeXT) || defined(__NeXT__) || defined(PERL_DARWIN))
# ifdef VMS_WE_ARE_CASE_SENSITIVE
" VMS_SYMBOL_CASE_AS_IS"
# endif
+# ifdef VMS_SHORTEN_LONG_SYMBOLS
+ " VMS_SHORTEN_LONG_SYMBOLS"
+# endif
"";
#else
EXTCONST char PL_bincompat_options[];
#endif
+/* The interpreter phases. If these ever change, PL_phase_names right below will
+ * need to be updated accordingly. */
+enum perl_phase {
+ PERL_PHASE_CONSTRUCT = 0,
+ PERL_PHASE_START = 1,
+ PERL_PHASE_CHECK = 2,
+ PERL_PHASE_INIT = 3,
+ PERL_PHASE_RUN = 4,
+ PERL_PHASE_END = 5,
+ PERL_PHASE_DESTRUCT = 6
+};
+
+#ifdef DOINIT
+EXTCONST char *const PL_phase_names[] = {
+ "CONSTRUCT",
+ "START",
+ "CHECK",
+ "INIT",
+ "RUN",
+ "END",
+ "DESTRUCT"
+};
+#else
+EXTCONST char *const PL_phase_names[];
+#endif
+
+#ifndef PERL_CORE
+/* Do not use this macro. It only exists for extensions that rely on PL_dirty
+ * instead of using the newer PL_phase, which provides everything PL_dirty
+ * provided, and more. */
+# define PL_dirty (PL_phase == PERL_PHASE_DESTRUCT)
+#endif /* !PERL_CORE */
+
END_EXTERN_C
/*****************************************************************************/
#define HINT_NO_AMAGIC 0x01000000 /* overloading pragma */
+#define HINT_RE_FLAGS 0x02000000 /* re '/xism' pragma */
+
/* The following are stored in $^H{sort}, not in PL_hints */
#define HINT_SORT_SORT_BITS 0x000000FF /* allow 256 different ones */
#define HINT_SORT_QUICKSORT 0x00000001
#define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o);
#define PERL_PPDEF(s) PERL_CALLCONV OP *s (pTHX);
+#ifdef MYMALLOC
+# include "malloc_ctl.h"
+#endif
+
#include "proto.h"
/* this has structure inits, so it cannot be included before here */
MGVTBL_SET(
PL_vtbl_sv,
- MEMBER_TO_FPTR(Perl_magic_get),
- MEMBER_TO_FPTR(Perl_magic_set),
- MEMBER_TO_FPTR(Perl_magic_len),
+ Perl_magic_get,
+ Perl_magic_set,
+ Perl_magic_len,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_env,
0,
- MEMBER_TO_FPTR(Perl_magic_set_all_env),
+ Perl_magic_set_all_env,
0,
- MEMBER_TO_FPTR(Perl_magic_clear_all_env),
+ Perl_magic_clear_all_env,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_envelem,
0,
- MEMBER_TO_FPTR(Perl_magic_setenv),
+ Perl_magic_setenv,
0,
- MEMBER_TO_FPTR(Perl_magic_clearenv),
+ Perl_magic_clearenv,
0,
0,
0,
#else
MGVTBL_SET(
PL_vtbl_sigelem,
- MEMBER_TO_FPTR(Perl_magic_getsig),
- MEMBER_TO_FPTR(Perl_magic_setsig),
+ Perl_magic_getsig,
+ Perl_magic_setsig,
0,
- MEMBER_TO_FPTR(Perl_magic_clearsig),
+ Perl_magic_clearsig,
0,
0,
0,
PL_vtbl_pack,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_sizepack),
- MEMBER_TO_FPTR(Perl_magic_wipepack),
+ Perl_magic_sizepack,
+ Perl_magic_wipepack,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_packelem,
- MEMBER_TO_FPTR(Perl_magic_getpack),
- MEMBER_TO_FPTR(Perl_magic_setpack),
+ Perl_magic_getpack,
+ Perl_magic_setpack,
0,
- MEMBER_TO_FPTR(Perl_magic_clearpack),
+ Perl_magic_clearpack,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_dbline,
0,
- MEMBER_TO_FPTR(Perl_magic_setdbline),
+ Perl_magic_setdbline,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_isa,
0,
- MEMBER_TO_FPTR(Perl_magic_setisa),
+ Perl_magic_setisa,
0,
- MEMBER_TO_FPTR(Perl_magic_clearisa),
+ Perl_magic_clearisa,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_isaelem,
0,
- MEMBER_TO_FPTR(Perl_magic_setisa),
+ Perl_magic_setisa,
0,
0,
0,
MGVTBL_SET_CONST_MAGIC_GET(
PL_vtbl_arylen,
- MEMBER_TO_FPTR(Perl_magic_getarylen),
- MEMBER_TO_FPTR(Perl_magic_setarylen),
+ Perl_magic_getarylen,
+ Perl_magic_setarylen,
0,
0,
0,
0,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_freearylen_p),
+ Perl_magic_freearylen_p,
0,
0,
0
MGVTBL_SET(
PL_vtbl_mglob,
0,
- MEMBER_TO_FPTR(Perl_magic_setmglob),
+ Perl_magic_setmglob,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_nkeys,
- MEMBER_TO_FPTR(Perl_magic_getnkeys),
- MEMBER_TO_FPTR(Perl_magic_setnkeys),
+ Perl_magic_getnkeys,
+ Perl_magic_setnkeys,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_taint,
- MEMBER_TO_FPTR(Perl_magic_gettaint),
- MEMBER_TO_FPTR(Perl_magic_settaint),
+ Perl_magic_gettaint,
+ Perl_magic_settaint,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_substr,
- MEMBER_TO_FPTR(Perl_magic_getsubstr),
- MEMBER_TO_FPTR(Perl_magic_setsubstr),
+ Perl_magic_getsubstr,
+ Perl_magic_setsubstr,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_vec,
- MEMBER_TO_FPTR(Perl_magic_getvec),
- MEMBER_TO_FPTR(Perl_magic_setvec),
+ Perl_magic_getvec,
+ Perl_magic_setvec,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_pos,
- MEMBER_TO_FPTR(Perl_magic_getpos),
- MEMBER_TO_FPTR(Perl_magic_setpos),
+ Perl_magic_getpos,
+ Perl_magic_setpos,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_bm,
0,
- MEMBER_TO_FPTR(Perl_magic_setregexp),
+ Perl_magic_setregexp,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_fm,
0,
- MEMBER_TO_FPTR(Perl_magic_setregexp),
+ Perl_magic_setregexp,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_uvar,
- MEMBER_TO_FPTR(Perl_magic_getuvar),
- MEMBER_TO_FPTR(Perl_magic_setuvar),
+ Perl_magic_getuvar,
+ Perl_magic_setuvar,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_defelem,
- MEMBER_TO_FPTR(Perl_magic_getdefelem),
- MEMBER_TO_FPTR(Perl_magic_setdefelem),
+ Perl_magic_getdefelem,
+ Perl_magic_setdefelem,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_regexp,
0,
- MEMBER_TO_FPTR(Perl_magic_setregexp),
+ Perl_magic_setregexp,
0,
0,
0,
PL_vtbl_regdata,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_regdata_cnt),
+ Perl_magic_regdata_cnt,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_regdatum,
- MEMBER_TO_FPTR(Perl_magic_regdatum_get),
- MEMBER_TO_FPTR(Perl_magic_regdatum_set),
+ Perl_magic_regdatum_get,
+ Perl_magic_regdatum_set,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_amagic,
0,
- MEMBER_TO_FPTR(Perl_magic_setamagic),
+ Perl_magic_setamagic,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_setamagic),
+ Perl_magic_setamagic,
0,
0,
0
MGVTBL_SET(
PL_vtbl_amagicelem,
0,
- MEMBER_TO_FPTR(Perl_magic_setamagic),
+ Perl_magic_setamagic,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_setamagic),
+ Perl_magic_setamagic,
0,
0,
0
0,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_killbackrefs),
+ Perl_magic_killbackrefs,
0,
0,
0
0,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_freeovrld),
+ Perl_magic_freeovrld,
0,
0,
0
MGVTBL_SET(
PL_vtbl_utf8,
0,
- MEMBER_TO_FPTR(Perl_magic_setutf8),
+ Perl_magic_setutf8,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_collxfrm,
0,
- MEMBER_TO_FPTR(Perl_magic_setcollxfrm),
+ Perl_magic_setcollxfrm,
0,
0,
0,
MGVTBL_SET(
PL_vtbl_hintselem,
0,
- MEMBER_TO_FPTR(Perl_magic_sethint),
+ Perl_magic_sethint,
0,
- MEMBER_TO_FPTR(Perl_magic_clearhint),
+ Perl_magic_clearhint,
0,
0,
0,
0,
0,
0,
- MEMBER_TO_FPTR(Perl_magic_clearhints),
+ Perl_magic_clearhints,
0,
0,
0,
/* START_MY_CXT must appear in all extensions that define a my_cxt_t structure,
* right after the definition (i.e. at file scope). The non-threads
* case below uses it to declare the data as static. */
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
-#define START_MY_CXT
-#define MY_CXT_INDEX Perl_my_cxt_index(aTHX_ MY_CXT_KEY)
-#define MY_CXT_INIT_ARG MY_CXT_KEY
-#else
-#define START_MY_CXT static int my_cxt_index = -1;
-#define MY_CXT_INDEX my_cxt_index
-#define MY_CXT_INIT_ARG &my_cxt_index
-#endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */
+# ifdef PERL_GLOBAL_STRUCT_PRIVATE
+# define START_MY_CXT
+# define MY_CXT_INDEX Perl_my_cxt_index(aTHX_ MY_CXT_KEY)
+# define MY_CXT_INIT_ARG MY_CXT_KEY
+# else
+# define START_MY_CXT static int my_cxt_index = -1;
+# define MY_CXT_INDEX my_cxt_index
+# define MY_CXT_INIT_ARG &my_cxt_index
+# endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */
/* Creates and zeroes the per-interpreter data.
* (We allocate my_cxtp in a Perl SV so that it will be released when
* the interpreter goes away.) */
-#define MY_CXT_INIT \
+# define MY_CXT_INIT \
my_cxt_t *my_cxtp = \
(my_cxt_t*)Perl_my_cxt_init(aTHX_ MY_CXT_INIT_ARG, sizeof(my_cxt_t))
-#define MY_CXT_INIT_INTERP(my_perl) \
+# define MY_CXT_INIT_INTERP(my_perl) \
my_cxt_t *my_cxtp = \
(my_cxt_t*)Perl_my_cxt_init(my_perl, MY_CXT_INIT_ARG, sizeof(my_cxt_t))
/* This declaration should be used within all functions that use the
* interpreter-local data. */
-#define dMY_CXT \
+# define dMY_CXT \
my_cxt_t *my_cxtp = (my_cxt_t *)PL_my_cxt_list[MY_CXT_INDEX]
-#define dMY_CXT_INTERP(my_perl) \
+# define dMY_CXT_INTERP(my_perl) \
my_cxt_t *my_cxtp = (my_cxt_t *)(my_perl)->Imy_cxt_list[MY_CXT_INDEX]
/* Clones the per-interpreter data. */
-#define MY_CXT_CLONE \
+# define MY_CXT_CLONE \
my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
Copy(PL_my_cxt_list[MY_CXT_INDEX], my_cxtp, 1, my_cxt_t);\
PL_my_cxt_list[MY_CXT_INDEX] = my_cxtp \
/* This macro must be used to access members of the my_cxt_t structure.
* e.g. MYCXT.some_data */
-#define MY_CXT (*my_cxtp)
+# define MY_CXT (*my_cxtp)
/* Judicious use of these macros can reduce the number of times dMY_CXT
* is used. Use is similar to pTHX, aTHX etc. */
-#define pMY_CXT my_cxt_t *my_cxtp
-#define pMY_CXT_ pMY_CXT,
-#define _pMY_CXT ,pMY_CXT
-#define aMY_CXT my_cxtp
-#define aMY_CXT_ aMY_CXT,
-#define _aMY_CXT ,aMY_CXT
+# define pMY_CXT my_cxt_t *my_cxtp
+# define pMY_CXT_ pMY_CXT,
+# define _pMY_CXT ,pMY_CXT
+# define aMY_CXT my_cxtp
+# define aMY_CXT_ aMY_CXT,
+# define _aMY_CXT ,aMY_CXT
#else /* PERL_IMPLICIT_CONTEXT */
-#define START_MY_CXT static my_cxt_t my_cxt;
-#define dMY_CXT_SV dNOOP
-#define dMY_CXT dNOOP
-#define dMY_CXT_INTERP(my_perl) dNOOP
-#define MY_CXT_INIT NOOP
-#define MY_CXT_CLONE NOOP
-#define MY_CXT my_cxt
-
-#define pMY_CXT void
-#define pMY_CXT_
-#define _pMY_CXT
-#define aMY_CXT
-#define aMY_CXT_
-#define _aMY_CXT
+# define START_MY_CXT static my_cxt_t my_cxt;
+# define dMY_CXT_SV dNOOP
+# define dMY_CXT dNOOP
+# define dMY_CXT_INTERP(my_perl) dNOOP
+# define MY_CXT_INIT NOOP
+# define MY_CXT_CLONE NOOP
+# define MY_CXT my_cxt
+
+# define pMY_CXT void
+# define pMY_CXT_
+# define _pMY_CXT
+# define aMY_CXT
+# define aMY_CXT_
+# define _aMY_CXT
#endif /* !defined(PERL_IMPLICIT_CONTEXT) */