summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-07-15 16:45:34 +0100
committerDavid Mitchell <davem@iabyn.com>2011-07-15 17:29:00 +0100
commitf1fb87419225265377ea1d91eac0dc99547137a6 (patch)
treef5d932638efaf5f63ce861c9606552545b884d31 /perl.h
parent67a23c794408aa2530cd288e513ed53f4a9c73dd (diff)
downloadperl-f1fb87419225265377ea1d91eac0dc99547137a6.tar.gz
replace many SvTYPE assertions with lookup tables
Under a DEBUGGING build, this reduces the size of the perl binary by about 10%, and reduces the time to run the test suite by about 10-20%% (!)
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 4d2004717a..25d29aaf6a 100644
--- a/perl.h
+++ b/perl.h
@@ -5091,6 +5091,33 @@ EXTCONST U8 PL_magic_data[256] =
EXTCONST U8 PL_magic_data[256];
#endif
+#ifdef DOINIT
+ /* NL BD IV NV PV PI PN MG RX GV LV AV HV CV FM IO */
+EXTCONST bool
+PL_valid_types_IVX[] = { 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
+EXTCONST bool
+PL_valid_types_NVX[] = { 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
+EXTCONST bool
+PL_valid_types_PVX[] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1 };
+EXTCONST bool
+PL_valid_types_RV[] = { 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 };
+EXTCONST bool
+PL_valid_types_IV_set[] = { 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1 };
+EXTCONST bool
+PL_valid_types_NV_set[] = { 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
+
+#else
+
+EXTCONST bool PL_valid_types_IVX[];
+EXTCONST bool PL_valid_types_NVX[];
+EXTCONST bool PL_valid_types_PVX[];
+EXTCONST bool PL_valid_types_RV[];
+EXTCONST bool PL_valid_types_IV_set[];
+EXTCONST bool PL_valid_types_NV_set[];
+
+#endif
+
+
#include "overload.h"
END_EXTERN_C