Karl Williamson [Sun, 31 Oct 2010 19:37:11 +0000 (13:37 -0600)]
regcomp.h: Remove unused #define
ANYOF_RUNTIME() is no longer used, so can be removed.
I had long tried to figure out what the purpose of this was, and
discovered it really had none.
I think it must have had something to do with locales at one time. But
locales don't do well with utf8, and I don't know how to make it better.
In any event this wasn't actually accomplishing anything.
Karl Williamson [Sun, 31 Oct 2010 19:31:13 +0000 (13:31 -0600)]
reginclass: Remove redundant test
The previous re-ordering of this function makes it clear that this test
doesn't do anything. It is testing the charclass bitmap, but that was
already done in the re-ordered block from a previous commit, so if it
didn't succeed there, it won't succeed here.
In fact, trying to understand why this code was here was what led me to
figure out that it wasn't, and that things could be sped up by doing the
reordering.
Karl Williamson [Sun, 31 Oct 2010 19:17:34 +0000 (13:17 -0600)]
reginclass: Reorder fastest first
This patch simply moves the block of code that does the bitmap tests in
front of the block of code that deals with potential things not in the
bit map. The reason to do this is that it is faster to find things in
the bitmap, than to have to create a utf8 swash.
The patch also adds some comments, and the first block doesn't have to
test if there has been a match, and the second block does, so if
statements for those two blocks are adjusted accordingly.
The proof that this doesn't break anything stems from the fact that the
routine never stops early. If there wasn't a match in the first block
of code, it would execute the second block. Thus swapping the order
doesn't affect the outcome. The side effects of the first block are
reading in the swash. These side effects won't happen if it no longer
gets executed, because the other block matched. And thus an error could
be introduced if there were coding errors elsewhere that didn't
initialize the swash before using it. But that doesn't appear to be the
case, as all tests pass.
Karl Williamson [Sun, 31 Oct 2010 18:45:50 +0000 (12:45 -0600)]
reginclass: Remove unnecessary test
The previous changes have made it clear that this test never was useful,
so remove it.
Karl Williamson [Sun, 31 Oct 2010 18:36:49 +0000 (12:36 -0600)]
reginclass: Make explicit the length assumptions
reginclass assumes that can match always at least one character. Make
that explicit, and now that we have that length always saved, don't
recalculate it.
Karl Williamson [Sun, 31 Oct 2010 18:31:11 +0000 (12:31 -0600)]
reginclass: Rename variable for clarity
Several other variables in the routine have the previous name
Karl Williamson [Sun, 31 Oct 2010 18:07:43 +0000 (12:07 -0600)]
regcomp.h: Clean up some comments
Karl Williamson [Sun, 31 Oct 2010 18:05:23 +0000 (12:05 -0600)]
ANYOF_LARGE is now the same as ANYOF_CLASS
These two #defines now mean the same thing. Free up bit used by
ANYOF_LARGE
Karl Williamson [Sun, 31 Oct 2010 17:50:08 +0000 (11:50 -0600)]
regexec.c: reorder statements for speed
The call to reginclass is guaranteed by constness to not change
locinput, so if going to fail don't waste time calling it.
Karl Williamson [Sun, 31 Oct 2010 17:20:43 +0000 (11:20 -0600)]
regexec.c: Add clarifying comment
Karl Williamson [Sun, 31 Oct 2010 16:37:55 +0000 (10:37 -0600)]
reginclass: add some consts to prototype
Karl Williamson [Sun, 31 Oct 2010 16:33:50 +0000 (10:33 -0600)]
regexec.c: Remove redundant line.
Now that reginclass is guaranteed to return the match length upon
success, the caller need not do it again.
Karl Williamson [Sun, 31 Oct 2010 16:21:14 +0000 (10:21 -0600)]
reginclass: Return matched length even if not utf8
This also allows for less special case testing
Karl Williamson [Sun, 31 Oct 2010 15:20:41 +0000 (09:20 -0600)]
reginclass: Change variable name for clarity.
Karl Williamson [Sun, 31 Oct 2010 15:11:39 +0000 (09:11 -0600)]
regexec.c: Document existing reginclass behavior
Father Chrysostomos [Sun, 31 Oct 2010 21:35:59 +0000 (14:35 -0700)]
perldelta up to
7cb18e1b02
Nicholas Clark [Sun, 31 Oct 2010 21:20:08 +0000 (21:20 +0000)]
Merge Storable::{is_storing,is_retrieving} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 20:52:25 +0000 (20:52 +0000)]
Storable::{last_op_in_netorder,is_storing,is_retrieving} are all boolean.
Hence they can have return type bool, which allows xsubpp to generate slightly
simpler (and smaller) code, and at run time avoids using a temporary for the
return value.
Nicholas Clark [Sun, 31 Oct 2010 20:32:20 +0000 (20:32 +0000)]
Merge Storable::{,net_}pstore and Storable::{,net_}mstore using ALIAS.
Remove the static functions {,net}[mp]store(), which were trivial wrappers
around do_store(). Instead call do_store() directly, using the ALIAS index
as the flag. Less code.
On this platform, this reduces the object code by over 1K. (Over 1%)
Karl Williamson [Sat, 30 Oct 2010 21:35:00 +0000 (15:35 -0600)]
Add l1_char_class_tab.h to Make dependencies
Karl Williamson [Sat, 30 Oct 2010 22:55:42 +0000 (16:55 -0600)]
regcomp.c: No longer need _C_C_T_ and variant macro
Now, all calls have been converted to the more general case; can remove
the old one, and rename the new one to have the same name as the old one
Karl Williamson [Sat, 30 Oct 2010 22:48:55 +0000 (16:48 -0600)]
[:posix:] now works under /u
This patch is part of fixing the Unicode bug. The /u regex modifier now
applies to posix character classes. This resolves [perl #18281].
The Todo tests in reg_posicc.t have all been made not todo.
Karl Williamson [Sat, 30 Oct 2010 21:33:34 +0000 (15:33 -0600)]
l1_char_class_tab.h: Wrong for ALNUMC
The generated table was wrong in the Latin1 range for characters with
the ALNUMC property
Karl Williamson [Sat, 30 Oct 2010 21:23:11 +0000 (15:23 -0600)]
Nits in re pods
Karl Williamson [Sat, 30 Oct 2010 21:20:24 +0000 (15:20 -0600)]
DOCs: Clarify that \w matches marks and \Pc
The previous documentation really didn't specify what \w is. It matches
the underscore, but also all other connector punctuation, plus any
marks, such as diacritical accents that occur within a word.
Karl Williamson [Sat, 30 Oct 2010 16:13:48 +0000 (10:13 -0600)]
Add consistent synonyms for \p{PosxFOO}
This patch adds a set of synonyms \p{XPosixFOO} for the full extended
Unicode version of \p{PosixFOO}, so only one rule need be remembered.
Similarly, \p{XPerlSpace} is added to preserve the rule for the one
similar class that doesn't have Posix in its name.
Prior to this patch there was no exact equivalent to \p{PosixPunct}
extended beyond ASCII.
Father Chrysostomos [Sun, 31 Oct 2010 17:23:39 +0000 (10:23 -0700)]
Revert "Add consistent synonyms for \p{PosxFOO}"
This reverts commit
d5944336d74c819152158dabfd806d49ad0ecb21.
Nicholas Clark [Sun, 31 Oct 2010 14:10:32 +0000 (14:10 +0000)]
Merge the XS implementation of all B::MG accessors using ALIAS.
On this platform, this reduces the object code size by over 5K.
Rafael Garcia-Suarez [Sun, 31 Oct 2010 13:17:20 +0000 (14:17 +0100)]
Bump Safe's version to 2.29
Rafael Garcia-Suarez [Sun, 31 Oct 2010 13:08:53 +0000 (14:08 +0100)]
Add &version::vxs::VCMP to Safe's default share
This is to accomodate this new function in version.pm 0.85.
Karl Williamson [Sat, 30 Oct 2010 16:13:48 +0000 (10:13 -0600)]
Add consistent synonyms for \p{PosxFOO}
This patch adds a set of synonyms \p{XPosixFOO} for the full extended
Unicode version of \p{PosixFOO}, so only one rule need be remembered.
Similarly, \p{XPerlSpace} is added to preserve the rule for the one
similar class that doesn't have Posix in its name.
Karl Williamson [Sat, 30 Oct 2010 16:13:35 +0000 (10:13 -0600)]
perlrecharclass: Nits
Karl Williamson [Sat, 30 Oct 2010 15:53:06 +0000 (09:53 -0600)]
mktables: Clarify \d description for perluniprops
Karl Williamson [Sat, 30 Oct 2010 15:43:50 +0000 (09:43 -0600)]
mktables: Add tests for wrong equivalence attempts
mktables allows for multiple tables to be made equivalent, which in Unix
terminology means that they are essentially symbolic links. However
this should happen only when they have the same code points in them to
begin with. This adds a little more error checking.
David Mitchell [Sun, 31 Oct 2010 12:44:39 +0000 (12:44 +0000)]
RT 75082: recv() with MSG_TRUNC flag SEGV
The recv() system call, with the MSG_TRUNC flag, returns the
true size of the packet, even if it is larger than the supplied buffer.
Since perl's equivalent recv() function doesn't return the size
(apart from what's implied as the returned length of the buffer), there
doesn't seem to to be any way to return this value to the caller. So
silently ignore it.
Before, we were setting SvCUR to the size, even if it was larger than
the buffer. Which was Bad.
Nicholas Clark [Sun, 31 Oct 2010 12:42:52 +0000 (12:42 +0000)]
Merge the implementation of B::{main_root,main_start} using ALIAS.
David Mitchell [Sun, 31 Oct 2010 11:50:16 +0000 (11:50 +0000)]
RT 72246: rcatline memory leak on bad $/
When allocating a temporary SV, make sure it will get freed if we die.
David Mitchell [Sun, 31 Oct 2010 10:31:56 +0000 (10:31 +0000)]
adjust output of -Dm
The address printed for malloc() didn't always match that for free().
Print the malloc() address *after* any modification by PERL_TRACK_MEMPOOL
Chris 'BinGOs' Williams [Sun, 31 Oct 2010 11:46:43 +0000 (11:46 +0000)]
Update Unicode-Collate to CPAN version 0.64
[DELTA]
0.64 Sun Oct 31 14:17:29 2010
- U::C::Locale newly supports locale: ja.
- added Unicode::Collate::CJK::JISX0208 for ja.
- a subroutine specified in 'overrideCJK' or 'overrideHangul' is allowed
to return an integer or undef value.
- fix: Ideographs Ext.A are assigned since UCA Version 9 (Unicode 3.1).
This fix should affect only the case of (UCA_Version => 8).
Nicholas Clark [Sun, 31 Oct 2010 11:39:53 +0000 (11:39 +0000)]
Merge the implementation of B::{dowarn,sub_generation} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 09:52:40 +0000 (09:52 +0000)]
Merge the implementation of B::{minus_c,save_BEGINSs} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 09:43:15 +0000 (09:43 +0000)]
Remove the conditional #define of OPpPAD_STATE from the BOOT block in B.xs
This can now be done with less code in the Makefile.PL since commit
b1826b71659a2c08 changed B to use ExtUtils::Constant
Nicholas Clark [Sun, 31 Oct 2010 09:31:31 +0000 (09:31 +0000)]
Remove the variables stash and export_ok from the BOOT block in B.xs
These are no longer needed since commit
b1826b71659a2c08 changed how B was
generating its exported constants.
Nicholas Clark [Sun, 31 Oct 2010 08:35:14 +0000 (08:35 +0000)]
Merge the implementation of B::HE::{VAL,SVKEY_force} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 08:16:54 +0000 (08:16 +0000)]
Merge the implementation of B::CV::{XSUB,XSUBANY} using ALIAS.
Father Chrysostomos [Sun, 31 Oct 2010 01:32:22 +0000 (18:32 -0700)]
Tests for [perl #77358]
Father Chrysostomos [Sun, 31 Oct 2010 01:19:56 +0000 (18:19 -0700)]
[perl #77358] ISA warnings after aliasing packages
This commit makes mro_package_moved call mro_isa_changed_in on the
stash that has been assigned if it did not have an effective name
(HvENAME) before the assignment.
This is what was happening:
{package Right} # autovivify it
@thing::ISA = qw[Left];
*Left:: = delete $::{"Right::"};
When Right is deleted, it is not attached to the symbol table any
more, so it has no effective name. mro_isa_changed_in3 is called on
it, which resets the caches and then proceeds to cache a new isa linearisation. The new linearisation, of course, does not use the
name ‘Left’.
When Right is assigned over the top of Left, Right is given an
HvENAME of ‘Left’. Then mro_isa_changed_is3 is called on the
original Left, which, in turn, calls mro_isa_changed on its sub-
classes. So thing’s isa linearisation is calculated, which is just
‘thing’ + get_linear_isa(Left) (where ‘Left’ now refers to what was previously called Right). This ends up using the bad linearisation.
So the linearisation of a heretofore effectively nameless stash must
be recalculated, but after it has been given a name.
If it has an effective name already, then it appears elsewhere in the
symbol table, and its effective name does not change. (The name added
simply becomes an alternative to switch to should the HvENAME become
invalid.) So the existing isa cache is fine and we do not need to call
mro_isa_changed_in.
(That is a rather lengthy commit message, is it not?)
Father Chrysostomos [Sat, 30 Oct 2010 21:27:48 +0000 (14:27 -0700)]
Set stash names before calling mro_isa_changed_in3
mro_isa_changed_in3 cannot update isa caches properly if it only sees
an intermediate state.
Nicholas Clark [Sat, 30 Oct 2010 20:29:39 +0000 (21:29 +0100)]
Make B::HV::NAME an ALIAS of B::GV::NAME, as both convert HEKs to SVs.
Previously B::HV::NAME was a simple XS wrapper around HvNAME(), which meant a
conversion to a char *, and then back to an SV.
Nicholas Clark [Sat, 30 Oct 2010 20:02:58 +0000 (21:02 +0100)]
Merge B::BM::PREVIOUS, B::BM::RARE and B::BM::USEFUL into the common accessor.
On this platform this reduces object code size by over 2K.
David Mitchell [Sat, 30 Oct 2010 19:37:32 +0000 (20:37 +0100)]
Merge branch 'blead' of perl5.git.perl.org:/gitroot/perl into blead
Nicholas Clark [Sat, 30 Oct 2010 19:34:39 +0000 (20:34 +0100)]
Merge B::HV::MAX and B::HV::KES into the common accessor.
On this platform this reduces object code size by about 1.5K
David Mitchell [Sat, 30 Oct 2010 19:15:18 +0000 (20:15 +0100)]
RT #63790: &{PL_sv_yes} corrupted mark stack
Calling a subref whose value was PL_sv_yes, and without args,
failed to pop an entry off the mark stack
Nicholas Clark [Sat, 30 Oct 2010 19:06:56 +0000 (20:06 +0100)]
Merge all B::CV structure accesses into the common accessor code.
On this platform this reduces the object size by 7K.
(CvDEPTH() was changed from a long to I32 in change
bb17208353b2f15e in 2006 -
B.xs was never updated)
Nicholas Clark [Sat, 30 Oct 2010 17:22:41 +0000 (18:22 +0100)]
Merge B::AV::MAX and B::FM::LINES into the common accessor.
On this platform this reduces object code size by over 1.5K
Nicholas Clark [Sat, 30 Oct 2010 16:15:27 +0000 (17:15 +0100)]
Merge all B::IO structure accesses into the common accessor code.
On this platform this reduces the object size by 9K.
(IoLINES(), IoPAGE(), IoPAGE_LEN() and IoLINES_LEFT() were changed from
long to IV in commit
11a7ac70a867da65 in 2001 - B.xs was never updated)
Father Chrysostomos [Sat, 30 Oct 2010 16:48:44 +0000 (09:48 -0700)]
Comment typo
Father Chrysostomos [Sat, 30 Oct 2010 16:38:24 +0000 (09:38 -0700)]
Move the meta->isa code from UNIVERSAL::isa to mro_get_linear_isa
This is so that it can be used for PL_isarev bookkeeping as well.
This will have no effect on the speed of DFS classes. C3 classes on
which ->isa is never called will have a slight slowdown. (We could
always add an API for setting meta->isa if we want to avoid that.)
Nicholas Clark [Sat, 30 Oct 2010 13:56:53 +0000 (14:56 +0100)]
Merge B::GV::{STASH,GvFLAGS} into the common accessor.
On this platform this reduces the object code size by over 1K.
Father Chrysostomos [Sat, 30 Oct 2010 13:52:24 +0000 (06:52 -0700)]
Switch UNIVERSAL::isa over to HvENAME
Father Chrysostomos [Sat, 30 Oct 2010 13:52:00 +0000 (06:52 -0700)]
Suppress warning from gv.t
Father Chrysostomos [Sat, 30 Oct 2010 13:51:33 +0000 (06:51 -0700)]
A plethora of isarev tests
Father Chrysostomos [Sat, 30 Oct 2010 12:48:41 +0000 (05:48 -0700)]
Correct reference to get_linear_isa in get_isarev’ description
Father Chrysostomos [Sat, 30 Oct 2010 12:46:47 +0000 (05:46 -0700)]
To-do tests for isarev (more to come)
Father Chrysostomos [Sat, 30 Oct 2010 12:15:36 +0000 (05:15 -0700)]
Increase mro’s version
Nicholas Clark [Sat, 30 Oct 2010 13:26:53 +0000 (14:26 +0100)]
Merge the direct structure lookup for B::{PV,PVMG,PVLV} to the common routine.
On this platform this reduces the object code size by about 5K.
Nicholas Clark [Sat, 30 Oct 2010 12:43:34 +0000 (13:43 +0100)]
Merge the direct structure lookup for B::IV:: and B::NV:: into 1 routine.
As for OPs and GPs, encode the type and offset in the XS alias integer.
Use different names for the type macros, to give them different constant
values, to allow the 3 accessor routines to have no gaps in the values used
for the set of types that they deal with. Otherwise, at least 1 switch
statement would compile to a jump table with "holes".
On this platform, this refactoring reduces the object code size by 4.5K.
Nicholas Clark [Sat, 30 Oct 2010 11:09:26 +0000 (12:09 +0100)]
Merge the implementation of B::IV::{needs64bits,packiv} using ALIAS.
Nicholas Clark [Sat, 30 Oct 2010 10:40:08 +0000 (11:40 +0100)]
257e0650 used the "wrong" croak() - correct B::GV:SV to use Perl_croak().
Perl_croak() is a variable argument C function, hence can't have a macro to
permit the use of croak() with/without a context pointer. croak *is* defined
as a macro, substituting croak_nocontext. But we have a context to hand, so we
can use Perl_croak() directly.
Nicholas Clark [Sat, 30 Oct 2010 10:10:18 +0000 (11:10 +0100)]
Merge B::GV::{file,name} using ALIAS.
This saves about 700 bytes of object code on this platform.
Nicholas Clark [Sat, 30 Oct 2010 09:35:27 +0000 (10:35 +0100)]
For B's GP accessors, encode the type and offset in the XS alias integer.
This allows most of the code for simple structure lookups in the GP of a GV to
be merged into one XS routine. This saves over 5.5K of object code on this
platform.
Nicholas Clark [Sat, 30 Oct 2010 08:03:29 +0000 (09:03 +0100)]
In B.xs, move the direct COP access for stash and file into the common code.
Both pairs of accessors are provided for both ithreads and not, but for each,
one pair is direct structure access, and 1 pair "faked up" with a more comple
macro. The direct structure access pair uses the common code (B::OP::next)
This reduces the object code by about 1K for both threaded and unthreaded
builds.
Father Chrysostomos [Sat, 30 Oct 2010 06:11:51 +0000 (23:11 -0700)]
Macros are not called with aTHX_
Father Chrysostomos [Sat, 30 Oct 2010 05:55:07 +0000 (22:55 -0700)]
Switch S_mro_get_linear_isa_c3 to HvENAME
Father Chrysostomos [Sat, 30 Oct 2010 05:51:13 +0000 (22:51 -0700)]
Remove the #ifdef PERL_CORE surrounding the HvENAME* macros
Father Chrysostomos [Sat, 30 Oct 2010 05:26:34 +0000 (22:26 -0700)]
Add HvENAME_HEK
Father Chrysostomos [Sat, 30 Oct 2010 05:17:44 +0000 (22:17 -0700)]
Add docs for hv_ename_*
Father Chrysostomos [Sat, 30 Oct 2010 05:12:55 +0000 (22:12 -0700)]
perlmroapi: suggest HvNAME as a fallback
Father Chrysostomos [Sat, 30 Oct 2010 05:07:32 +0000 (22:07 -0700)]
Add test for the crashes fixed in 00169e2
Father Chrysostomos [Sat, 30 Oct 2010 03:45:34 +0000 (20:45 -0700)]
Switch the core MRO code over to HvENAME
This has the side-effect of fixing these one-liners:
$ perl5.13.5 -le' my $glob = \*foo::ISA; delete $::{"foo::"}; *$glob = *a'
Bus error
$ perl5.13.5 -le' my $glob = \*foo::ISA; delete $::{"foo::"}; *$glob = []'
Bus error
$ perl5.13.6 -le'sub baz; my $glob = \*foo::bar; delete $::{"foo::"}; *$glob = *baz;'
Bus error
$ perl5.13.6 -le'sub foo::bar; my $glob = \*foo::bar; delete $::{"foo::"}; *$glob = *baz;'
Bus error
In the first two cases the crash was inadvertently fixed (isn’t it
nice when that happens?) in 5.13.6 (by
6f86b615fa7), but there was
still a fatal error:
Can't call mro_isa_changed_in() on anonymous symbol table at -e line 1.
Because sv_clear calls ->DESTROY, if an object’s stash has been
detached from the symbol table, mro_get_linear_isa can be called on a
hash with no HvENAME. So HvNAME is used as a fallback for those cases.
Father Chrysostomos [Fri, 29 Oct 2010 15:59:33 +0000 (08:59 -0700)]
Add HvENAME
Add HvENAME as an alias for HvENAME_get and make it public.
This is now the preferred name for use in isa caches.
Father Chrysostomos [Fri, 29 Oct 2010 13:17:28 +0000 (06:17 -0700)]
In S_hv_delete_common, call mro_package_moved after the deletion
George Greer [Sat, 30 Oct 2010 00:39:33 +0000 (20:39 -0400)]
Fix Math::BigInt::FastCalc build under Win32 with croak_xs_usage().
Nicholas Clark [Fri, 29 Oct 2010 20:40:18 +0000 (21:40 +0100)]
Merge B::COP::{cop_seq,hints,line} into the common B::OP accessor XS code.
On this platform, this saves almost 2.5K.
Keep IVp last in the switch values, as it's only used for ithreads. Otherwise
there would be an avoidable hole in the jump table for the non-ithreads object
code.
Nicholas Clark [Fri, 29 Oct 2010 20:01:08 +0000 (21:01 +0100)]
Merge B::PADOP::{gv,sv} using the ALIAS mechanism.
On this platform, this saves around 600 bytes.
Nicholas Clark [Fri, 29 Oct 2010 19:43:49 +0000 (20:43 +0100)]
Merge B::PADOP::padix into the common B::OP accessor XS code.
On this platform, this saves about 800 bytes.
Nicholas Clark [Fri, 29 Oct 2010 20:18:56 +0000 (22:18 +0200)]
Sort the MANIFEST (after change
1222f39eae03eee3)
Father Chrysostomos [Fri, 29 Oct 2010 19:55:22 +0000 (12:55 -0700)]
Add test for [perl #78674]
Nicholas Clark [Fri, 29 Oct 2010 19:30:23 +0000 (20:30 +0100)]
Merge B::SVOP::{gv,sv} into the common B::OP accessor XS code.
On this platform, this saves about 700 bytes.
Nicholas Clark [Fri, 29 Oct 2010 18:55:49 +0000 (19:55 +0100)]
In B.xs, move conditionally defined PMOP macros to their points of use.
Remove the definition for PMOP_pmflags, now unused.
Niko Tyni [Thu, 28 Oct 2010 20:52:17 +0000 (23:52 +0300)]
[perl #78674] Fix stack pointer corruption in pp_concat() with 'use encoding'
sv_utf8_upgrade_nomg() may reallocate the stack via sv_recode_to_utf8()
if 'use encoding' is in effect, causing stack pointer corruption.
Father Chrysostomos [Fri, 29 Oct 2010 16:28:57 +0000 (09:28 -0700)]
Use STDOUT in defout.t to suppress that ‘#foo’ under TEST/harness
Nicholas Clark [Fri, 29 Oct 2010 16:34:00 +0000 (17:34 +0100)]
Merge B::PMOP::precomp and B::PMOP::reflags, using the ALIAS mechanism.
Like B::PMOP::pmoffset, this needs to be controlled by C pre-processor symbols,
so can't be done with an ALIAS keyword.
This saves just over .5K on this platform.
Nicholas Clark [Fri, 29 Oct 2010 16:08:24 +0000 (17:08 +0100)]
Merge B::PMOP::pmoffset into the common B::OP accessor XS code.
Nicholas Clark [Fri, 29 Oct 2010 15:42:52 +0000 (16:42 +0100)]
Reorder parts of B.xs to reduce the amount of conditionally compiled code.
Some code with #ifdef guards on PERL_VERSION can be merged.
B::COP::label can have a C<const char *> return type on all perl versions.
Nicholas Clark [Thu, 28 Oct 2010 16:34:01 +0000 (17:34 +0100)]
Merge B::PMOP::pmflags into the common B::OP accessor XS code.
This saves about 800 bytes on this platform.
Nicholas Clark [Thu, 28 Oct 2010 10:29:21 +0000 (11:29 +0100)]
For B's OP accessors, encode the type and offset in the XS alias integer.
This allows most of the code for simple structure lookups to be merged into
one XS routine. Start by merging U8 and PADOFFSET lookups in struct op with
the existing common OP* accessor code. This saves over 2K of object code on
this platform.
Nicholas Clark [Wed, 27 Oct 2010 15:27:27 +0000 (16:27 +0100)]
Merge all B::OP::* accessors returning B::OP objects.
Use the ALIAS value to store the member's offset within the structure, and
perform explicit pointer arithmetic to read it. This reduces the object size
by about 5K on this platform.
Nicholas Clark [Thu, 28 Oct 2010 19:17:29 +0000 (20:17 +0100)]
Math::BigInt::FastCalc doesn't need to set $BASE or $BASE_LEN.
The variables are neither documented nor exported, and nothing on CPAN uses
them. Hence there is no need to set them, which means that the return list from
Math::BigInt::Calc::_base_len() can be passed directly into FastCalc's XS
bootstrap.
Nicholas Clark [Thu, 28 Oct 2010 18:10:17 +0000 (19:10 +0100)]
Math::BigInt::FastCalc doesn't need to override methods in a BEGIN block.
The BEGIN context of the code C<use>ing it will be early enough for the
subroutine assignments to take full effect.