perl.git
9 years agoIn Perl_do_op_dump(), reorder the ops within the if (o->op_private) clause.
Nicholas Clark [Fri, 28 May 2010 12:53:02 +0000 (13:53 +0100)] 
In Perl_do_op_dump(), reorder the ops within the  if (o->op_private) clause.

9 years agoIn Perl_do_sv_dump(), use append_flags() for PVCV, PVFM and PVGP flags.
Nicholas Clark [Fri, 28 May 2010 12:43:43 +0000 (13:43 +0100)] 
In Perl_do_sv_dump(), use append_flags() for PVCV, PVFM and PVGP flags.

9 years agoIn Perl_do_sv_dump(), for PVCV and PVFM, test for SvCOMPILED(sv) last.
Nicholas Clark [Fri, 28 May 2010 10:50:54 +0000 (11:50 +0100)] 
In Perl_do_sv_dump(), for PVCV and PVFM, test for SvCOMPILED(sv) last.

9 years agoIn Perl_do_op_dump(), move runs of op_private name tests to S_append_flags().
Nicholas Clark [Fri, 28 May 2010 10:26:16 +0000 (11:26 +0100)] 
In Perl_do_op_dump(), move runs of op_private name tests to S_append_flags().

9 years agoCreate S_append_flags() from a common code pattern in dump.c.
Nicholas Clark [Fri, 28 May 2010 09:56:21 +0000 (10:56 +0100)] 
Create S_append_flags() from a common code pattern in dump.c.

Convert repetitive sequences of "if this bit is set, append that string" into
structures and a function call. Use a custom macro append_flags() to make
calling it easer.

This makes the object code slightly smaller.

9 years agoInPerl_boot_core_UNIVERSAL() use a data structure for calls to newXS{,proto}
Nicholas Clark [Tue, 5 Jan 2010 13:06:52 +0000 (13:06 +0000)] 
InPerl_boot_core_UNIVERSAL() use a data structure for calls to newXS{,proto}

Replacing the longhand list of calls to newXS{,proto} with loop over a data
structure reduces the object size by over 1K.

9 years agoNaif calls segfault T_PRTOBJ of the stock typemap
Salvador Ortiz Garcia [Fri, 28 May 2010 08:25:52 +0000 (10:25 +0200)] 
Naif calls segfault T_PRTOBJ of the stock typemap

The T_PTROBJ INPUT in stock typemap only uses 'sv_derived_from' for
input validation, that cause a segfault when the argument passed match
the class name.

9 years agoAdd simple_bitmask and varies_bitmask to globvar.sym.
Nicholas Clark [Fri, 28 May 2010 06:58:19 +0000 (07:58 +0100)] 
Add simple_bitmask and varies_bitmask to globvar.sym.

global.sym is generated; is there a way to automate globvar.sym?

9 years agoConvert REGNODE_{SIMPLE,VARIES} to a bitmask lookup, from a strchr() lookup.
Nicholas Clark [Wed, 17 Mar 2010 17:16:24 +0000 (17:16 +0000)] 
Convert REGNODE_{SIMPLE,VARIES} to a bitmask lookup, from a strchr() lookup.

This is O(1) with no branching, instead of O(n) with branching.
Deprecate the old implementation's externally visible variables
PL_simple and PL_varies. Google codesearch suggests that nothing outside the
core regexp code was using these.

9 years agoChange regcomp.pl to 0-based indexing for its arrays and loops.
Nicholas Clark [Wed, 17 Mar 2010 16:41:27 +0000 (16:41 +0000)] 
Change regcomp.pl to 0-based indexing for its arrays and loops.

9 years agoEncapsulate lookups in PL_{varies,simple} within macros REGNODE_{VARIES,SIMPLE}
Nicholas Clark [Wed, 17 Mar 2010 13:58:25 +0000 (13:58 +0000)] 
Encapsulate lookups in PL_{varies,simple} within macros REGNODE_{VARIES,SIMPLE}

This allows the implementation of the lookup mechanism to change.

9 years agoGenerate PL_simple[] and PL_varies[] with regcomp.pl, rather than hard-coding.
Nicholas Clark [Wed, 17 Mar 2010 13:33:48 +0000 (13:33 +0000)] 
Generate PL_simple[] and PL_varies[] with regcomp.pl, rather than hard-coding.

Add a new flags column to regcomp.sym, with V if the node type is in PL_varies,
S if it is in PL_simple, and . if a placeholder is needed because subsequent
optional columns are present.

9 years agoRe-work the regcomp.sym to remove use of hard tabs. No data change.
Nicholas Clark [Tue, 16 Mar 2010 10:22:04 +0000 (10:22 +0000)] 
Re-work the regcomp.sym to remove use of hard tabs. No data change.

The tab separating name and type is replaced with whitespace, the tab marking
the start of the description is replaced by a semicolon.

9 years agoCorrect the node numbers in comments.
Nicholas Clark [Tue, 16 Mar 2010 09:50:29 +0000 (09:50 +0000)] 
Correct the node numbers in comments.

Really, should we be maintaining these manually?

9 years agoRemove stray tab character in definition for VERB.
Nicholas Clark [Tue, 16 Mar 2010 09:48:35 +0000 (09:48 +0000)] 
Remove stray tab character in definition for VERB.

As VERB is "Used only for the type field of verbs" this is only a cosmetic
change, causing that correct description to appear in the comment in
regnodes.h. The change to regarglen doesn't affect anything, as the VERB type
is never actually used for compiled nodes.

9 years agoFix clang "incompatible operand types" error in ternary expressions.
George Greer [Thu, 27 May 2010 01:12:37 +0000 (21:12 -0400)] 
Fix clang "incompatible operand types" error in ternary expressions.

9 years agoPATCH: user defined special casing for non utf8
Karl Williamson [Fri, 14 May 2010 14:56:46 +0000 (08:56 -0600)] 
PATCH: user defined special casing for non utf8

Users can define their own case changing mappings to replace the
standard ones.  Prior to this patch, any mappings on characters whose
ordinals are 0-222, 224-255 that resulted in multiple characters were
ignored.

Note that there still is a deficiency in that the mappings will be
applied only to strings in utf8 format.

9 years agoChange a few tests to use new test.pl EBCDIC stuff
Karl Williamson [Mon, 24 May 2010 17:01:10 +0000 (11:01 -0600)] 
Change a few tests to use new test.pl EBCDIC stuff

A few .t's are delivered here which use the new conversion functions in
test.pl.  Obviously, this commit doesn't have to be incorporated, but it
does simplify those tests.

9 years agoAdd functions to test.pl for easier EBCDIC testing
Karl Williamson [Mon, 24 May 2010 16:50:13 +0000 (10:50 -0600)] 
Add functions to test.pl for easier EBCDIC testing

This patch adds functions native_to_latin1($) and latin1_to_native($) to
test.pl.  Use of these in test scripts allows for less special case code
(or deciding to blow it off and just skip EBCDIC platforms).  If a
string is all ASCII, one has always been able to just use it and not
worry about EBCDIC.  But non-ASCII, latin1 characters have been a
different matter.  This allows one to wrap those characters in a
function call and get automatic EBCDIC compatibility.

The functions do not handle UTF-8/UTF-EBCDIC conversions.  This is more
complicated, and I was worried that that part was not appropriate for
test.pl which should use the bare minimum of Perl functionality.  These
functions use tr///, beyond what other parts of test.pl use.

9 years agoFix CLONE/weakref bug revealed by adf8f095c5881bce.
Nicholas Clark [Tue, 25 May 2010 16:23:10 +0000 (17:23 +0100)] 
Fix CLONE/weakref bug revealed by adf8f095c5881bce.

The AV unreferenced in the clone_params needs to be reference counted, rather
than not referenced counted, because the fixup to ensure that all otherwise
0-reference count scalars have a reference (on the temps stack) happens after
CLONE is run, and CLONE can run Perl code that causes their reference counts
to increase from then return to zero, which prematurely triggers sv_free().

9 years agoUpdate rsync sources in perlhack
H.Merijn Brand [Tue, 25 May 2010 16:26:37 +0000 (18:26 +0200)] 
Update rsync sources in perlhack

9 years agoAdd the perl equivalent for av_make.
Shlomi Fish [Mon, 24 May 2010 20:40:48 +0000 (23:40 +0300)] 
Add the perl equivalent for av_make.

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoAdd the Perl equivalent for av_len.
Shlomi Fish [Wed, 19 May 2010 17:11:03 +0000 (20:11 +0300)] 
Add the Perl equivalent for av_len.

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoAdd a missing comma in the av_fill() docs.
Shlomi Fish [Wed, 19 May 2010 14:46:43 +0000 (17:46 +0300)] 
Add a missing comma in the av_fill() docs.

Minor, but still good enough for a commit.

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoClarify the av_fetch() documentation.
Shlomi Fish [Tue, 18 May 2010 14:42:52 +0000 (17:42 +0300)] 
Clarify the av_fetch() documentation.

Thanks to LeoNerd and Zefram on #p5p on IRC for some insights and
suggesting versions for the modified text. I ended up using Zefram's
version.

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoAdd Perl equivalent for av_exists().
Shlomi Fish [Tue, 18 May 2010 12:31:41 +0000 (15:31 +0300)] 
Add Perl equivalent for av_exists().

This mentions that it's equivalent to exists($myarray[$key]).

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoAdd a Perl equivalent to av_delete().
Shlomi Fish [Sat, 15 May 2010 19:13:59 +0000 (22:13 +0300)] 
Add a Perl equivalent to av_delete().

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoAdd the Perl equivalent example to av_clear.
Shlomi Fish [Sat, 15 May 2010 18:44:58 +0000 (21:44 +0300)] 
Add the Perl equivalent example to av_clear.

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoLink from GIMME_V to perlcall for a usage example.
Shlomi Fish [Sat, 15 May 2010 18:37:46 +0000 (21:37 +0300)] 
Link from GIMME_V to perlcall for a usage example.

Added a link from the GIMME_V entry to perlcall for a usage example.

Signed-off-by: David Golden <dagolden@cpan.org>
9 years agoPATCH: correct misstatement, formats in perlunicode
Karl Williamson [Mon, 24 May 2010 14:08:51 +0000 (08:08 -0600)] 
PATCH: correct misstatement, formats in perlunicode

This is suitable for 5.12.2, but not many people use this feature.

9 years agoFix for typo in 0824d66743a706cd, in the expected output with threads.
Nicholas Clark [Tue, 25 May 2010 15:30:43 +0000 (16:30 +0100)] 
Fix for typo in 0824d66743a706cd, in the expected output with threads.

9 years agoadd OPpDEREFed flag to avoid double mg_get()
David Mitchell [Tue, 25 May 2010 10:38:35 +0000 (11:38 +0100)] 
add OPpDEREFed flag to avoid double mg_get()

    The previous commit made various ops such as rv2av unconditionally do
    an SvGETMAGIC(). Under some circumstances this could cause a double
    mg_get() (and hence double FETCH etc). In particular, when the
    proceeding op was something like aelem with OPpDEREF, the aelem would
    call vivify_ref(), which would call magic. So in peep(), mark
    OP_RV2[SAH]V ops with the new OPpDEREFed flag if the preceding op was
    OPpDEREF. Then use this flag to avoid a second dose of magic.

    Note that RV2GV probably needs this flag too, but there weren't any
    spare private flag bits left for that op (I think).

9 years agoDeref ops ignore get-magic when SvROK(sv)
Father Chrysostomos (via RT) [Sun, 17 Jan 2010 22:32:24 +0000 (14:32 -0800)] 
Deref ops ignore get-magic when SvROK(sv)

This is just like bug 68192, except in this case it’s a different set
of operators that have had this problem for much longer.

9 years agoJust the tests from a proposed fix for 68192
Father Chrysostomos [Mon, 24 May 2010 10:56:25 +0000 (11:56 +0100)] 
Just the tests from a proposed fix for 68192

The bug was fixed in a different way by davem, but the tests
are needed as the base for a commit to follow

9 years agoReplace wrong tr/// table in perlebcdic.pod
Karl Williamson [Tue, 18 May 2010 14:43:31 +0000 (08:43 -0600)] 
Replace wrong tr/// table in perlebcdic.pod

perlebcdic.pod contains a helpful table to use in tr/// to convert
between EBCDIC and Latin1/ASCII.  Unfortunately, the table is the
inverse of the one it describes, as I discovered in following the
directions on how it was extracted.

The actual code that uses the table uses it in the inverse way, so it
actually works correctly, but if you follow the instructions to get the
tables corresponding to the other recognized code pages, you will get
the inverse of the ones you wanted, and things won't work out.

This patch changes the table to its inverse, and changes the sample code
to correspond, as this is easier for the person trying to follow the
instructions since deriving the old table is somewhat more complicated.

I also changed the table to hex from octal, as that is more the norm
these days, and I changed to recipes in the pod to print out leading
zeros to make all the values the same length, as the table that they can
generate has them.

9 years agoRemove unused, wrong #define in utf8.h
Karl Williamson [Tue, 18 May 2010 16:02:26 +0000 (10:02 -0600)] 
Remove unused, wrong #define in utf8.h

is unused in the code, and is wrong for EBCDIC platforms, as there can
be invariants there that aren't ASCII.  I simply removed it.

9 years agoFix build warnings introduced by v5.13.0-139-ge0fa7e2
Jerry D. Hedden [Fri, 7 May 2010 16:14:05 +0000 (12:14 -0400)] 
Fix build warnings introduced by v5.13.0-139-ge0fa7e2

9 years agoAdd Perl_clone_params_{del,new} and Perl_sv_dup to the "no threads" exclusions.
Nicholas Clark [Mon, 24 May 2010 20:01:29 +0000 (21:01 +0100)] 
Add Perl_clone_params_{del,new} and Perl_sv_dup to the "no threads" exclusions.

9 years agoSet PADSTALE on all lexicals at the end of sub creation.
Nicholas Clark [Fri, 26 Feb 2010 09:18:44 +0000 (09:18 +0000)] 
Set PADSTALE on all lexicals at the end of sub creation.

The PADSTALEness of lexicals between the 0th and 1st call to a subroutine is now
consistent with the state between the nth and (n + 1)th call.

This permits a work around in Perl_padlist_dup() to avoid leaking active pad
data into a new thread, whilst still correctly bodging the external references
needed by the current ?{} implementation. Fix that, and this can be removed.

9 years agoDon't clone the contents of lexicals in pads.
Nicholas Clark [Thu, 25 Feb 2010 21:35:39 +0000 (21:35 +0000)] 
Don't clone the contents of lexicals in pads.

This stops the values of lexicals in active stack frames in the parent leaking
into the lexicals in the child thread.

With an exception for lexicals with a reference count of > 1, to cope with the
implementation of ?{{ ... }} blocks in regexps. :-(

9 years agoIn Perl_pad_tidy(), merge the SvPADTMP_on() loops for padtidy_SUB and _FORMAT.
Nicholas Clark [Thu, 25 Feb 2010 16:56:53 +0000 (16:56 +0000)] 
In Perl_pad_tidy(), merge the SvPADTMP_on() loops for padtidy_SUB and _FORMAT.

9 years agoIn Perl_padlist_dup() don't duplicate @_ or pads caused by recursion.
Nicholas Clark [Thu, 25 Feb 2010 14:21:18 +0000 (14:21 +0000)] 
In Perl_padlist_dup() don't duplicate @_ or pads caused by recursion.

CvDEPTH() is 0 in a new thread, so duplicating pads beyond the always-present
first level is a waste of effort and memory.

9 years agoConvert PAD_DUP to a function Perl_padlist_dup().
Nicholas Clark [Wed, 10 Feb 2010 09:57:23 +0000 (09:57 +0000)] 
Convert PAD_DUP to a function Perl_padlist_dup().

assert() that pads are never AvREAL().

9 years agoWhen deleting CLONE_PARAMS, push any unreferenced SVs onto the temps stack.
Nicholas Clark [Thu, 25 Feb 2010 11:12:03 +0000 (11:12 +0000)] 
When deleting CLONE_PARAMS, push any unreferenced SVs onto the temps stack.

Effectively this leaves the cloned-into interpreter in a consistent state.
In the cloned-from interpreter, the SV targets of non-reference owning pointers
*are* referenced and managed by other pointers. SvREFCNT() == 0 SVs in the
cloned-into interpreter result from the non-reference owning pointers being
found and followed, but the reference owning and managing pointers not being
part of the subsection of interpreter state cloned over. Hence, this change
creates reference owning pointers to this SVs on the temps stack, which ensures
that they are correctly cleaned up, and don't "leak" until interpreter
destruction. (Which might be some time away, in a persistent process.)

9 years agoBetter ithreads cloning - add all SVs with a 0 refcnt to the temps stack.
Nicholas Clark [Wed, 24 Feb 2010 17:15:41 +0000 (17:15 +0000)] 
Better ithreads cloning - add all SVs with a 0 refcnt to the temps stack.

Track all SVs created by sv_dup() that have a 0 reference count. If they still
have a 0 reference count at the end of cloning, assign a reference to each to
the temps stack. As the temps stack is cleared at thread exit, SVs book keeping
will be correct and consistent before perl_destruct() makes its check for
leaked scalars.

Remove special case code for checking each @_ and the parent's temp stack.

9 years agoCleaner implementations for Perl_clone_params_{new,del}
Nicholas Clark [Mon, 24 May 2010 14:48:06 +0000 (15:48 +0100)] 
Cleaner implementations for Perl_clone_params_{new,del}

Not source or binary compatible with maint-5.12.

9 years agoAbstract *correct* initialisation of CLONE_PARAMS into Perl_clone_params_new().
Nicholas Clark [Wed, 24 Feb 2010 11:47:08 +0000 (11:47 +0000)] 
Abstract *correct* initialisation of CLONE_PARAMS into Perl_clone_params_new().

As it allocates memory dynamically, add Perl_clone_params_del(). This will
allow CLONE_PARAMS to be expand in future in a source and binary compatible
fashion.

These implementations of Perl_clone_params_new()/Perl_clone_params_del() jump
through hoops to remain source and binary compatible, in particular, by not
assuming that the structure member is present and correctly initialised. Hence
they should be suitable for inclusion into Devel::PPPort.

Convert threads.xs to use them, resolving RT #73046.

9 years agoConvert Perl_sv_dup_inc() from a macro to a real function.
Nicholas Clark [Tue, 23 Feb 2010 14:48:17 +0000 (14:48 +0000)] 
Convert Perl_sv_dup_inc() from a macro to a real function.

9 years agoIn perl_clone_using(), turn off AvREAL() on param->stashes.
Nicholas Clark [Wed, 24 Feb 2010 15:07:51 +0000 (15:07 +0000)] 
In perl_clone_using(), turn off AvREAL() on param->stashes.

This is an optimisation, not a bug fix.

9 years agoAdd package block syntax to perldelta
Zefram [Mon, 24 May 2010 11:38:24 +0000 (07:38 -0400)] 
Add package block syntax to perldelta

9 years agoAdd perldelta entry for non-destructive substitution
David Golden [Mon, 24 May 2010 00:04:38 +0000 (20:04 -0400)] 
Add perldelta entry for non-destructive substitution

9 years agoChange the API documentation from sv_2nv to sv_2nv_flags.
Nicholas Clark [Sun, 23 May 2010 20:09:13 +0000 (21:09 +0100)] 
Change the API documentation from sv_2nv to sv_2nv_flags.

Addendum to 39d5de13bc6d138b.

9 years agofix MAD handling of package block syntax
Zefram [Sat, 22 May 2010 22:10:16 +0000 (23:10 +0100)] 
fix MAD handling of package block syntax

There was a broken TOKEN_GETMAD attempting to handle the label preceding a
package-block statement, where no label is actually possible.  The correct
behaviour for no label is a no-op, so just remove the TOKEN_GETMAD.

9 years agoadd perldelta entry for overload fixes
David Mitchell [Sun, 23 May 2010 14:04:37 +0000 (15:04 +0100)] 
add perldelta entry for overload fixes

9 years agoFormat perlhist consistently by maint/dev track
David Golden [Sun, 23 May 2010 11:51:04 +0000 (07:51 -0400)] 
Format perlhist consistently by maint/dev track

9 years agocreate perl5132delta
David Golden [Sun, 23 May 2010 11:22:32 +0000 (07:22 -0400)] 
create perl5132delta

9 years agoRephrase perlop for non-destructive substitution
David Golden [Sun, 23 May 2010 02:46:50 +0000 (22:46 -0400)] 
Rephrase perlop for non-destructive substitution

9 years agoAdd David Caldwell to AUTHORS
David Golden [Sun, 23 May 2010 02:31:38 +0000 (22:31 -0400)] 
Add David Caldwell to AUTHORS

9 years agoAdd s///r (non-destructive substitution).
David Caldwell [Tue, 24 Nov 2009 01:24:25 +0000 (17:24 -0800)] 
Add s///r (non-destructive substitution).

This changes s/// so that it doesn't act destructively on its target.
Instead it returns the result of the substitution (or the original string if
there was no match).

In addition this patch:

  * Adds a new warning when s///r happens in void context.
  * Adds a error when you try to use s///r with !~
  * Makes it so constant strings can be bound to s///r with =~
  * Adds documentation.
  * Adds some tests.
  * Updates various debug code so it knows about the /r flag.
  * Adds some new 'r' words to B::Deparse.

9 years agoRestore strict refs on stashes, removed by ce10b5d1ec5b5f68b0811018a415bc37.
Nicholas Clark [Tue, 17 Nov 2009 10:17:11 +0000 (10:17 +0000)] 
Restore strict refs on stashes, removed by ce10b5d1ec5b5f68b0811018a415bc37.

Strictures on stashes were special-cased, because the lexer was special-cased
to avoid autovivifying stashes (in adc51b978ed1b2e9d4512c9bfa80386ac917d05a,
now reverted), to keep the behaviour of defined %stash:: consistent.

defined %stash:: is deprecated.

Keep the new regression tests from ce10b5d1ec5b5f68b0811018a415bc37bb6bfe5e.

9 years agoRe-instate the use of gv_stashpvn_flags(), and the correct non-boolean argument.
Nicholas Clark [Sat, 24 Oct 2009 11:22:01 +0000 (12:22 +0100)] 
Re-instate the use of gv_stashpvn_flags(), and the correct non-boolean argument.

This restores the change of 9bde8eb087a2c05d4c8b0394a59d28a09fe5f529.

9 years agoRemove the tokeniser hack that prevents compile-time vivification of %stash::
Nicholas Clark [Sat, 24 Oct 2009 10:36:06 +0000 (11:36 +0100)] 
Remove the tokeniser hack that prevents compile-time vivification of %stash::

This was put in to ensure that defined %stash:: continued to return false after
the implementation of hashes was changed, such that stashes were always defined.
defined %stash:: is deprecated.

This reverts the tokeniser changes of adc51b978ed1b2e9d4512c9bfa80386ac917d05a,
76138434928a968a390c791aec92e5f00017d01d,
d6069db2e52f58ef65bf59f2fd453604270d2205 and part of
9bde8eb087a2c05d4c8b0394a59d28a09fe5f529, and updates the tests added with those
commits to reflect the restored (but as yet unreleased) behaviour.

I don't think that this should be merged to blead until after 5.12.0 ships,
with the enabled deprecation warnings on defined %hash, as it changes subtle
behaviour that all current released stable perls accept without warning.

9 years agoPL_in_load_module only has values 0 and 1, so can be a bool instead of int.
Nicholas Clark [Fri, 21 May 2010 19:32:28 +0000 (20:32 +0100)] 
PL_in_load_module only has values 0 and 1, so can be a bool instead of int.

9 years agoPerl_hv_fill(), count empty chains down, rather than used chains up.
Nicholas Clark [Sat, 13 Mar 2010 11:23:46 +0000 (11:23 +0000)] 
Perl_hv_fill(), count empty chains down, rather than used chains up.

The assumption is that most chains of a hash are in use.

Suggestion and initial patch by Ruslan Zakirov.

9 years agoEliminate xhv_fill from struct xpvhv.
Nicholas Clark [Sun, 24 Jan 2010 15:39:53 +0000 (15:39 +0000)] 
Eliminate xhv_fill from struct xpvhv.

9 years agoMake HvFILL() count the allocated buckets, instead of reading a stored value.
Nicholas Clark [Sun, 24 Jan 2010 15:07:50 +0000 (15:07 +0000)] 
Make HvFILL() count the allocated buckets, instead of reading a stored value.

Add a function Perl_hv_fill to perform the count. This will save 1 IV per hash,
and on some systems cause struct xpvhv to become cache aligned.

9 years agoReplace boolean use of HvFILL(hv) with HvTOTALKEYS(hv), which is equivalent.
Nicholas Clark [Sun, 24 Jan 2010 10:50:02 +0000 (10:50 +0000)] 
Replace boolean use of HvFILL(hv) with HvTOTALKEYS(hv), which is equivalent.

9 years agofollowup to magic/overload fix
David Mitchell [Fri, 21 May 2010 16:07:40 +0000 (17:07 +0100)] 
followup to magic/overload fix

6f1401dc2acd2a2b85df22b0a74e5f7e6e0a33aa was over-enthusiastic
on removing redundant code in the comparison ops. This code was only used
on 64-bit #ifdef branches which is why I failed to spot it earlier.
So restore that code!

9 years agomake overload respect get magic
David Mitchell [Fri, 21 May 2010 13:18:21 +0000 (14:18 +0100)] 
make overload respect get magic

In most places, ops checked their args for overload *before* doing
mg_get(). This meant that, among other issues, tied vars that
returned overloaded objects wouldn't trigger calling the
overloaded method.  (Actually, for tied and arrays and hashes, it
still often would since mg_get gets called beforehand in rvalue
context).

This patch does the following:

Makes sure get magic is called first.

Moves most of the overload code formerly included by macros at the
start of each pp function into the separate helper functions
Perl_try_amagic_bin, Perl_try_amagic_un, S_try_amagic_ftest,
with 3 new wrapper macros:
tryAMAGICbin_MG, tryAMAGICun_MG, tryAMAGICftest_MG.
This made the code 3800 bytes smaller.

Makes sure that FETCH is not called multiple times. Much of this
bit was helped by some earlier work from Father Chrysostomos.

Added new functions and macros sv_inc_nomg(), sv_dec_nomg(),
dPOPnv_nomg, dPOPXiirl_ul_nomg, dPOPTOPnnrl_nomg, dPOPTOPiirl_ul_nomg
dPOPTOPiirl_nomg, SvIV_please_nomg, SvNV_nomg (again, some of
these were based on Father Chrysostomos's work).

Fixed the list version of the repeat operator (x): it now only
calls overloaded methods for the scalar version:
    (1,2,$overloaded) x 10
no longer erroneously calls
    x_method($overloaded,10))

The only thing I haven't checked/fixed yet is overloading the
iterator operator, <>.

9 years agoRemove union _xivu from _XPVCV_COMMON, and hence structs xpvcv and xpvfm
Nicholas Clark [Tue, 26 Jan 2010 17:03:41 +0000 (17:03 +0000)] 
Remove union _xivu from _XPVCV_COMMON, and hence structs xpvcv and xpvfm

Replaced with xcv_depth and xfm_lines respectively. Both structures might
benefit from some field re-ordering.

Update the descriptive comments in the definition of union _xivu.

9 years agoRemove union _xivu from struct regexp - replace it with a non-union paren_names.
Nicholas Clark [Tue, 26 Jan 2010 16:28:59 +0000 (16:28 +0000)] 
Remove union _xivu from struct regexp - replace it with a non-union paren_names.

This was the only user of xivu_hv in union _xivu, so remove that too.

9 years agoRemove union _xivu from struct xpvhv - replace it with a non-union xav_keys.
Nicholas Clark [Mon, 25 Jan 2010 14:28:30 +0000 (14:28 +0000)] 
Remove union _xivu from struct xpvhv - replace it with a non-union xav_keys.

9 years agoRemove union _xivu from struct xpvav - replace it with a non-union xav_alloc.
Nicholas Clark [Mon, 25 Jan 2010 13:55:28 +0000 (13:55 +0000)] 
Remove union _xivu from struct xpvav - replace it with a non-union xav_alloc.

This was the only user of xivu_p1 in union _xivu, so remove that too.

9 years agoReinstate space optimisations to SV body structures.
Nicholas Clark [Mon, 25 Jan 2010 13:30:16 +0000 (13:30 +0000)] 
Reinstate space optimisations to SV body structures.

9 years agoIn the SV body, exchange the positions of the NV and stash/magic.
Nicholas Clark [Mon, 25 Jan 2010 09:27:56 +0000 (09:27 +0000)] 
In the SV body, exchange the positions of the NV and stash/magic.

9 years agoRemove all space optimisations from SV body structures.
Nicholas Clark [Fri, 22 Jan 2010 15:31:49 +0000 (15:31 +0000)] 
Remove all space optimisations from SV body structures.

9 years agoThe size of a character in C is per definition 1
H.Merijn Brand [Fri, 21 May 2010 06:01:54 +0000 (08:01 +0200)] 
The size of a character in C is per definition 1

9 years agoFix CCINCDIR and CCLIBDIR for mingw64 cross compiler
Sisyphus [Fri, 21 May 2010 00:56:07 +0000 (17:56 -0700)] 
Fix CCINCDIR and CCLIBDIR for mingw64 cross compiler

When building perl with the mingw64 x64 cross-compiler 'incpath', 'libpth',
'ldflags', 'lddlflags' and 'ldflags_nolargefiles' values in Config.pm and
Config_heavy.pl are not being set correctly because, with that compiler, the
include and lib directories are not immediately below $(CCHOME).

9 years agofully test package-version-block syntax
Zefram [Thu, 20 May 2010 20:48:03 +0000 (21:48 +0100)] 
fully test package-version-block syntax

Extend the exhaustive package-version tests in t/op/packagev.t
to test each case using package-block syntax in addition to the
package-declaration syntax.

9 years agoadditional tests for package block syntax
Zefram [Sat, 1 May 2010 16:51:21 +0000 (17:51 +0100)] 
additional tests for package block syntax

Test that __PACKAGE__ propagates into string eval correctly.  Test that
__LINE__ is correct.  Test that goto into and out of package blocks
works correctly.

9 years agofix SEGV with eval("package Foo {")
Zefram [Sat, 1 May 2010 16:30:26 +0000 (17:30 +0100)] 
fix SEGV with eval("package Foo {")

OPs relating to the package name and version were subject to double
freeing during error recovery from an incomplete package block.  Fixed by
using the op_latefree mechanism to shift the op free time.

9 years agosupport "package Foo { ... }"
Zefram [Mon, 19 Apr 2010 19:37:25 +0000 (20:37 +0100)] 
support "package Foo { ... }"

Package block syntax limits the scope of the package declaration to the
attached block.  It's cleaner than requiring the declaration to come
inside the block.

9 years agoPL_endav can be NULL, so in S_ithread_create() no need to set it to newAV().
Nicholas Clark [Tue, 23 Feb 2010 20:35:29 +0000 (20:35 +0000)] 
PL_endav can be NULL, so in S_ithread_create() no need to set it to newAV().

9 years agoRemove redundant hv_exists() calls from ithread_create()'s spec parser.
Nicholas Clark [Sat, 13 Feb 2010 09:05:18 +0000 (09:05 +0000)] 
Remove redundant hv_exists() calls from ithread_create()'s spec parser.

hv_fetch(..., 0) won't create the element if it doesn't exist, returning a NULL
pointer, so hv_exists() and hv_fetch() is doing two hash lookups where one would
suffice.

On this machine, reduces the object code by 3K, about 7%. Everyone's a winner.

9 years agoChange S_ithread_create() params from a single AV* to a pair of SV** pointers.
Nicholas Clark [Sat, 13 Feb 2010 08:31:55 +0000 (08:31 +0000)] 
Change S_ithread_create() params from a single AV* to a pair of SV** pointers.

This saves creating, duplicating and freeing and AV, which is only ever used for
an internal calling convention.

9 years agoIn threads.xs, convert thread->params from RV to AV.
Nicholas Clark [Sat, 13 Feb 2010 08:01:45 +0000 (08:01 +0000)] 
In threads.xs, convert thread->params from RV to AV.

Pass around and store the array directly, rather than creating, holding and
dereferencing a reference to it.

9 years agoSvIVX() isn't valid on SVt_REGEXP
Nicholas Clark [Tue, 26 Jan 2010 12:00:56 +0000 (12:00 +0000)] 
SvIVX() isn't valid on SVt_REGEXP

9 years agoIn sv.c, _all_ {new,del}_X* macros can be *_body_allocated.
Nicholas Clark [Mon, 25 Jan 2010 10:53:33 +0000 (10:53 +0000)] 
In sv.c, _all_ {new,del}_X* macros can be *_body_allocated.

Previously those where bodies_by_type[sv_type].offset was zero were using
{new,del}_body_typed. However, the optimiser can spot this, and generates the
same object code. This allows simplification of the C code, and more
flexibility to rearrange the structures without generating bugs.

9 years agoupdate Ricardo Signes's email
Ricardo Signes [Thu, 20 May 2010 14:14:39 +0000 (10:14 -0400)] 
update Ricardo Signes's email

9 years agoDo not try to load a feature bundle when doing "no VERSION"
Rafael Garcia-Suarez [Wed, 19 May 2010 18:36:12 +0000 (20:36 +0200)] 
Do not try to load a feature bundle when doing "no VERSION"

9 years agodo not check for deprecation of removed lib v5.13.1
Ricardo Signes [Thu, 20 May 2010 12:29:40 +0000 (08:29 -0400)] 
do not check for deprecation of removed lib

9 years agoadd the v5.13.1 epigraph
Ricardo Signes [Thu, 20 May 2010 11:49:35 +0000 (07:49 -0400)] 
add the v5.13.1 epigraph

9 years agoremove =over/=back from epigraphs.pod, add empty sections
Ricardo Signes [Thu, 20 May 2010 11:47:09 +0000 (07:47 -0400)] 
remove =over/=back from epigraphs.pod, add empty sections

...even though they are *totally legal* and the suggested way to make a
blockquote-like paragraph.  Pod::Checker doesn't like them.

9 years agoadd new release to perlhist
Ricardo Signes [Thu, 20 May 2010 11:25:47 +0000 (07:25 -0400)] 
add new release to perlhist

9 years agoupdate MANIFEST, remove delta for uninstalled file
Ricardo Signes [Thu, 20 May 2010 11:24:16 +0000 (07:24 -0400)] 
update MANIFEST, remove delta for uninstalled file

9 years agofurther updates to CoreList
Ricardo Signes [Thu, 20 May 2010 11:18:17 +0000 (07:18 -0400)] 
further updates to CoreList

Who knew there was a helper to do this, now!

9 years agoUpdate META.yml
Ricardo Signes [Thu, 20 May 2010 11:06:16 +0000 (07:06 -0400)] 
Update META.yml

Notice the glorious deletion of Switch from the manifest!

9 years agobump CoreList version
Ricardo Signes [Thu, 20 May 2010 11:01:43 +0000 (07:01 -0400)] 
bump CoreList version

9 years agoadd vertical space to CoreList.pm
Ricardo Signes [Thu, 20 May 2010 11:00:42 +0000 (07:00 -0400)] 
add vertical space to CoreList.pm

This makes it easy to move through the file with { and } in vi.
Yes, this really helps.

9 years agoremove empty perldelta section
Ricardo Signes [Thu, 20 May 2010 04:50:55 +0000 (00:50 -0400)] 
remove empty perldelta section