This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
13 years agoreginclass: Rename variable for clarity
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

13 years agoregcomp.h: Clean up some comments
Karl Williamson [Sun, 31 Oct 2010 18:07:43 +0000 (12:07 -0600)]
regcomp.h: Clean up some comments

13 years agoANYOF_LARGE is now the same as ANYOF_CLASS
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

13 years agoregexec.c: reorder statements for speed
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.

13 years agoregexec.c: Add clarifying comment
Karl Williamson [Sun, 31 Oct 2010 17:20:43 +0000 (11:20 -0600)]
regexec.c: Add clarifying comment

13 years agoreginclass: add some consts to prototype
Karl Williamson [Sun, 31 Oct 2010 16:37:55 +0000 (10:37 -0600)]
reginclass: add some consts to prototype

13 years agoregexec.c: Remove redundant line.
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.

13 years agoreginclass: Return matched length even if not utf8
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

13 years agoreginclass: Change variable name for clarity.
Karl Williamson [Sun, 31 Oct 2010 15:20:41 +0000 (09:20 -0600)]
reginclass: Change variable name for clarity.

13 years agoregexec.c: Document existing reginclass behavior
Karl Williamson [Sun, 31 Oct 2010 15:11:39 +0000 (09:11 -0600)]
regexec.c: Document existing reginclass behavior

13 years agoperldelta up to 7cb18e1b02
Father Chrysostomos [Sun, 31 Oct 2010 21:35:59 +0000 (14:35 -0700)]
perldelta up to 7cb18e1b02

13 years agoMerge Storable::{is_storing,is_retrieving} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 21:20:08 +0000 (21:20 +0000)]
Merge Storable::{is_storing,is_retrieving} using ALIAS.

13 years agoStorable::{last_op_in_netorder,is_storing,is_retrieving} are all boolean.
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.

13 years agoMerge Storable::{,net_}pstore and Storable::{,net_}mstore using ALIAS.
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%)

13 years agoAdd l1_char_class_tab.h to Make dependencies
Karl Williamson [Sat, 30 Oct 2010 21:35:00 +0000 (15:35 -0600)]
Add l1_char_class_tab.h to Make dependencies

13 years agoregcomp.c: No longer need _C_C_T_ and variant macro
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

13 years ago[:posix:] now works under /u
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.

13 years agol1_char_class_tab.h: Wrong for ALNUMC
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

13 years agoNits in re pods
Karl Williamson [Sat, 30 Oct 2010 21:23:11 +0000 (15:23 -0600)]
Nits in re pods

13 years agoDOCs: Clarify that \w matches marks and \Pc
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.

13 years agoAdd consistent synonyms for \p{PosxFOO}
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.

13 years agoRevert "Add consistent synonyms for \p{PosxFOO}"
Father Chrysostomos [Sun, 31 Oct 2010 17:23:39 +0000 (10:23 -0700)]
Revert "Add consistent synonyms for \p{PosxFOO}"

This reverts commit d5944336d74c819152158dabfd806d49ad0ecb21.

13 years agoMerge the XS implementation of all B::MG accessors using ALIAS.
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.

13 years agoBump Safe's version to 2.29
Rafael Garcia-Suarez [Sun, 31 Oct 2010 13:17:20 +0000 (14:17 +0100)]
Bump Safe's version to 2.29

13 years agoAdd &version::vxs::VCMP to Safe's default share
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.

13 years agoAdd consistent synonyms for \p{PosxFOO}
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.

13 years agoperlrecharclass: Nits
Karl Williamson [Sat, 30 Oct 2010 16:13:35 +0000 (10:13 -0600)]
perlrecharclass: Nits

13 years agomktables: Clarify \d description for perluniprops
Karl Williamson [Sat, 30 Oct 2010 15:53:06 +0000 (09:53 -0600)]
mktables: Clarify \d description for perluniprops

13 years agomktables: Add tests for wrong equivalence attempts
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.

13 years agoRT 75082: recv() with MSG_TRUNC flag SEGV
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.

13 years agoMerge the implementation of B::{main_root,main_start} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 12:42:52 +0000 (12:42 +0000)]
Merge the implementation of B::{main_root,main_start} using ALIAS.

13 years agoRT 72246: rcatline memory leak on bad $/
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.

13 years agoadjust output of -Dm
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

13 years agoUpdate Unicode-Collate to CPAN version 0.64
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).

13 years agoMerge the implementation of B::{dowarn,sub_generation} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 11:39:53 +0000 (11:39 +0000)]
Merge the implementation of B::{dowarn,sub_generation} using ALIAS.

13 years agoMerge the implementation of B::{minus_c,save_BEGINSs} 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.

13 years agoRemove the conditional #define of OPpPAD_STATE from the BOOT block in B.xs
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

13 years agoRemove the variables stash and export_ok from the BOOT block in B.xs
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.

13 years agoMerge the implementation of B::HE::{VAL,SVKEY_force} using ALIAS.
Nicholas Clark [Sun, 31 Oct 2010 08:35:14 +0000 (08:35 +0000)]
Merge the implementation of B::HE::{VAL,SVKEY_force} using ALIAS.

13 years agoMerge the implementation of B::CV::{XSUB,XSUBANY} 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.

13 years agoTests for [perl #77358]
Father Chrysostomos [Sun, 31 Oct 2010 01:32:22 +0000 (18:32 -0700)]
Tests for [perl #77358]

13 years ago[perl #77358] ISA warnings after aliasing packages
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?)

13 years agoSet stash names before calling mro_isa_changed_in3
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.

13 years agoMake B::HV::NAME an ALIAS of B::GV::NAME, as both convert HEKs to SVs.
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.

13 years agoMerge B::BM::PREVIOUS, B::BM::RARE and B::BM::USEFUL into the common accessor.
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.

13 years agoMerge branch 'blead' of perl5.git.perl.org:/gitroot/perl into blead
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

13 years agoMerge B::HV::MAX and B::HV::KES into the common accessor.
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

13 years agoRT #63790: &{PL_sv_yes} corrupted mark stack
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

13 years agoMerge all B::CV structure accesses into the common accessor code.
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)

13 years agoMerge B::AV::MAX and B::FM::LINES into the common accessor.
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

13 years agoMerge all B::IO structure accesses into the common accessor code.
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)

13 years agoComment typo
Father Chrysostomos [Sat, 30 Oct 2010 16:48:44 +0000 (09:48 -0700)]
Comment typo

13 years agoMove the meta->isa code from UNIVERSAL::isa to mro_get_linear_isa
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.)

13 years agoMerge B::GV::{STASH,GvFLAGS} into the common accessor.
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.

13 years agoSwitch UNIVERSAL::isa over to HvENAME
Father Chrysostomos [Sat, 30 Oct 2010 13:52:24 +0000 (06:52 -0700)]
Switch UNIVERSAL::isa over to HvENAME

13 years agoSuppress warning from gv.t
Father Chrysostomos [Sat, 30 Oct 2010 13:52:00 +0000 (06:52 -0700)]
Suppress warning from gv.t

13 years agoA plethora of isarev tests
Father Chrysostomos [Sat, 30 Oct 2010 13:51:33 +0000 (06:51 -0700)]
A plethora of isarev tests

13 years agoCorrect reference to get_linear_isa in get_isarev’ description
Father Chrysostomos [Sat, 30 Oct 2010 12:48:41 +0000 (05:48 -0700)]
Correct reference to get_linear_isa in get_isarev’ description

13 years agoTo-do tests for isarev (more to come)
Father Chrysostomos [Sat, 30 Oct 2010 12:46:47 +0000 (05:46 -0700)]
To-do tests for isarev (more to come)

13 years agoIncrease mro’s version
Father Chrysostomos [Sat, 30 Oct 2010 12:15:36 +0000 (05:15 -0700)]
Increase mro’s version

13 years agoMerge the direct structure lookup for B::{PV,PVMG,PVLV} to the common routine.
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.

13 years agoMerge the direct structure lookup for B::IV:: and B::NV:: into 1 routine.
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.

13 years agoMerge the implementation of B::IV::{needs64bits,packiv} using ALIAS.
Nicholas Clark [Sat, 30 Oct 2010 11:09:26 +0000 (12:09 +0100)]
Merge the implementation of B::IV::{needs64bits,packiv} using ALIAS.

13 years ago257e0650 used the "wrong" croak() - correct B::GV:SV to use Perl_croak().
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.

13 years agoMerge B::GV::{file,name} using ALIAS.
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.

13 years agoFor B's GP accessors, encode the type and offset in the XS alias integer.
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.

13 years agoIn B.xs, move the direct COP access for stash and file into the common code.
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.

13 years agoMacros are not called with aTHX_
Father Chrysostomos [Sat, 30 Oct 2010 06:11:51 +0000 (23:11 -0700)]
Macros are not called with aTHX_

13 years agoSwitch S_mro_get_linear_isa_c3 to HvENAME
Father Chrysostomos [Sat, 30 Oct 2010 05:55:07 +0000 (22:55 -0700)]
Switch S_mro_get_linear_isa_c3 to HvENAME

13 years agoRemove the #ifdef PERL_CORE surrounding the HvENAME* macros
Father Chrysostomos [Sat, 30 Oct 2010 05:51:13 +0000 (22:51 -0700)]
Remove the #ifdef PERL_CORE surrounding the HvENAME* macros

13 years agoAdd HvENAME_HEK
Father Chrysostomos [Sat, 30 Oct 2010 05:26:34 +0000 (22:26 -0700)]
Add HvENAME_HEK

13 years agoAdd docs for hv_ename_*
Father Chrysostomos [Sat, 30 Oct 2010 05:17:44 +0000 (22:17 -0700)]
Add docs for hv_ename_*

13 years agoperlmroapi: suggest HvNAME as a fallback
Father Chrysostomos [Sat, 30 Oct 2010 05:12:55 +0000 (22:12 -0700)]
perlmroapi: suggest HvNAME as a fallback

13 years agoAdd test for the crashes fixed in 00169e2
Father Chrysostomos [Sat, 30 Oct 2010 05:07:32 +0000 (22:07 -0700)]
Add test for the crashes fixed in 00169e2

13 years agoSwitch the core MRO code over to HvENAME
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.

13 years agoAdd HvENAME
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.

13 years agoIn S_hv_delete_common, call mro_package_moved after the deletion
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

13 years agoFix Math::BigInt::FastCalc build under Win32 with croak_xs_usage().
George Greer [Sat, 30 Oct 2010 00:39:33 +0000 (20:39 -0400)]
Fix Math::BigInt::FastCalc build under Win32 with croak_xs_usage().

13 years agoMerge B::COP::{cop_seq,hints,line} into the common B::OP accessor XS code.
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.

13 years agoMerge B::PADOP::{gv,sv} using the ALIAS mechanism.
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.

13 years agoMerge B::PADOP::padix into the common B::OP accessor XS code.
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.

13 years agoSort the MANIFEST (after change 1222f39eae03eee3)
Nicholas Clark [Fri, 29 Oct 2010 20:18:56 +0000 (22:18 +0200)]
Sort the MANIFEST (after change 1222f39eae03eee3)

13 years agoAdd test for [perl #78674]
Father Chrysostomos [Fri, 29 Oct 2010 19:55:22 +0000 (12:55 -0700)]
Add test for [perl #78674]

13 years agoMerge B::SVOP::{gv,sv} into the common B::OP accessor XS code.
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.

13 years agoIn B.xs, move conditionally defined PMOP macros to their points of use.
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.

13 years ago[perl #78674] Fix stack pointer corruption in pp_concat() with 'use encoding'
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.

13 years agoUse STDOUT in defout.t to suppress that ‘#foo’ under TEST/harness
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

13 years agoMerge B::PMOP::precomp and B::PMOP::reflags, using the ALIAS mechanism.
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.

13 years agoMerge B::PMOP::pmoffset into the common B::OP accessor XS code.
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.

13 years agoReorder parts of B.xs to reduce the amount of conditionally compiled 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.

13 years agoMerge B::PMOP::pmflags into the common B::OP accessor XS code.
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.

13 years agoFor B's OP accessors, encode the type and offset in the XS alias integer.
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.

13 years agoMerge all B::OP::* accessors returning B::OP objects.
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.

13 years agoMath::BigInt::FastCalc doesn't need to set $BASE or $BASE_LEN.
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.

13 years agoMath::BigInt::FastCalc doesn't need to override methods in a BEGIN block.
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.

13 years agoRefactor FastCalc to initialise BASE and BASE_LEN as part of bootstrap.
Nicholas Clark [Thu, 28 Oct 2010 13:57:13 +0000 (14:57 +0100)]
Refactor FastCalc to initialise BASE and BASE_LEN as part of bootstrap.

This avoids the need for a separate, special, one-shot _set_XS_BASE routine.
We take advantage of the fact that all arguments to XSLoader::load() are passed
on to the module's bootstrap routine.

13 years agoReorder the list return of Math::BigInt::Calc::_base_len().
Nicholas Clark [Thu, 28 Oct 2010 13:15:01 +0000 (14:15 +0100)]
Reorder the list return of Math::BigInt::Calc::_base_len().

A search of CPAN shows that this private function is only used internally
between Math::BigInt::Calc, Math::BigInt::FastCalc and their test suites.

13 years agoFix NAMECOUNT output format in dump.c
Father Chrysostomos [Fri, 29 Oct 2010 05:34:10 +0000 (22:34 -0700)]
Fix NAMECOUNT output format in dump.c

Remove quotation marks and, as a bonus, eliminate a compiler warning.

13 years agohv_ename_delete should not delete the HvNAME
Father Chrysostomos [Fri, 29 Oct 2010 05:22:10 +0000 (22:22 -0700)]
hv_ename_delete should not delete the HvNAME

This is something that 78b79c7758 missed.

When xhv_name is a HEK *, it is both the regular name and the effect-
ive name at the same time. Only when xhv_name_count is negative is the
regular name not also the effective name.

hv_ename_delete needs to take the HEK that xhv_name points to and
put it in a new HEK * array in xhv_name. This array will just have
one element.

When xhv_name_count is negative, effective names start with the second
element. So we set xhv_name_count to -1 so there isn’t one.

13 years agoB::GV::is_empty and B::GV::isGV_with_GP can be merged using ALIAS.
Nicholas Clark [Fri, 29 Oct 2010 11:41:10 +0000 (12:41 +0100)]
B::GV::is_empty and B::GV::isGV_with_GP can be merged using ALIAS.

This saves about 700 bytes on this platform.