summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-03-20 10:25:21 +0000
committerNicholas Clark <nick@ccl4.org>2011-03-20 10:25:21 +0000
commit4aa23ba6a3fa547a6950067258d60ad650571e77 (patch)
tree26fde57c89cb4aa15b5e4b9ae78e7ada70813812 /ext
parent88ecb8a6b9eca675d383c8a0292e9706cb2870d1 (diff)
downloadperl-4aa23ba6a3fa547a6950067258d60ad650571e77.tar.gz
Minimise the actions of the BEGIN block in B.pm
Retain the call to XSLoader::load() at BEGIN time, as we want the constants loaded before the compiler meets OPf_KIDS below, as the combination of having the constant stay a Proxy Constant Subroutine and its value being inlined saves a little over .5K
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.pm32
1 files changed, 17 insertions, 15 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index d98793ccfa..063eb401ae 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -16,26 +16,28 @@ require Exporter;
BEGIN {
$B::VERSION = '1.29';
+ @B::EXPORT_OK = ();
+
+ # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK.
+ # Want our constants loaded before the compiler meets OPf_KIDS below, as
+ # the combination of having the constant stay a Proxy Constant Subroutine
+ # and its value being inlined saves a little over .5K
- @B::EXPORT_OK = qw(minus_c ppname save_BEGINs
- class peekop cast_I32 cstring cchar hash threadsv_names
- main_root main_start main_cv svref_2object opnumber
- sub_generation amagic_generation perlstring
- walkoptree_slow walkoptree walkoptree_exec walksymtable
- parents comppadlist sv_undef compile_stats timing_info
- begin_av init_av check_av end_av regex_padav dowarn
- defstash curstash warnhook diehook inc_gv @optype
- @specialsv_name
- );
- push @B::EXPORT_OK, qw(unitcheck_av) if $] > 5.009;
-
- # All the above in this BEGIN, because our BOOT code needs $VERSION set,
- # and will append to @EXPORT_OK. And we need to run the BOOT code before
- # we see OPf_KIDS below.
require XSLoader;
XSLoader::load();
}
+push @B::EXPORT_OK, (qw(minus_c ppname save_BEGINs
+ class peekop cast_I32 cstring cchar hash threadsv_names
+ main_root main_start main_cv svref_2object opnumber
+ sub_generation amagic_generation perlstring
+ walkoptree_slow walkoptree walkoptree_exec walksymtable
+ parents comppadlist sv_undef compile_stats timing_info
+ begin_av init_av check_av end_av regex_padav dowarn
+ defstash curstash warnhook diehook inc_gv @optype
+ @specialsv_name
+ ), $] > 5.009 && 'unitcheck_av');
+
@B::SV::ISA = 'B::OBJECT';
@B::NULL::ISA = 'B::SV';
@B::PV::ISA = 'B::SV';