Shlomi Fish [Fri, 21 Sep 2012 08:36:00 +0000 (11:36 +0300)]
[perl5db] Test o AutoTrace .
It appears to work fine now. Strange.
Shlomi Fish [Fri, 21 Sep 2012 08:31:29 +0000 (11:31 +0300)]
[perl5db] Add a test for the 't' command.
Apparently, the 'o AutoTrace' command is broken since perl-5.16.x and I
want to get a good output for 't' first before fixing it.
Shlomi Fish [Thu, 20 Sep 2012 14:28:39 +0000 (17:28 +0300)]
[perl5db] Add a test for warnLevel=1.
Shlomi Fish [Wed, 19 Sep 2012 13:33:22 +0000 (16:33 +0300)]
[perl5db] Add test for dieLevel option.
Shlomi Fish [Tue, 18 Sep 2012 14:24:14 +0000 (17:24 +0300)]
[perl5db] Test the recallCommand option.
Shlomi Fish [Sat, 15 Sep 2012 14:18:37 +0000 (17:18 +0300)]
[perl5db] Test the M command.
Shlomi Fish [Sat, 15 Sep 2012 14:10:13 +0000 (17:10 +0300)]
Test more for the m staetement.
Shlomi Fish [Sat, 15 Sep 2012 13:54:24 +0000 (16:54 +0300)]
Test the m command.
Shlomi Fish [Sat, 15 Sep 2012 13:46:35 +0000 (16:46 +0300)]
[perl5db] Test the = command.
Shlomi Fish [Sat, 15 Sep 2012 13:29:55 +0000 (16:29 +0300)]
Correct the test blurbs.
Shlomi Fish [Sat, 15 Sep 2012 12:40:21 +0000 (15:40 +0300)]
Add a test for the H command.
Shlomi Fish [Sat, 15 Sep 2012 12:35:07 +0000 (15:35 +0300)]
[perl5db] Add a test for H -7.
Shlomi Fish [Thu, 13 Sep 2012 14:08:58 +0000 (17:08 +0300)]
[perl5db] Fix source cmd from typeahead.
With a test.
Shlomi Fish [Thu, 13 Sep 2012 13:52:54 +0000 (16:52 +0300)]
Add a test for the source command.
Shlomi Fish [Thu, 13 Sep 2012 11:41:59 +0000 (14:41 +0300)]
Extract a common subroutine.
Shlomi Fish [Thu, 13 Sep 2012 11:34:18 +0000 (14:34 +0300)]
Rename to something more meaningful.
Shlomi Fish [Thu, 13 Sep 2012 11:32:41 +0000 (14:32 +0300)]
Convert to DebugWrap.
Shlomi Fish [Thu, 13 Sep 2012 11:26:55 +0000 (14:26 +0300)]
Convert more to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 14:13:32 +0000 (17:13 +0300)]
Convert the 61222 test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 14:08:40 +0000 (17:08 +0300)]
Extract _calc_threads_wrapper.
Shlomi Fish [Wed, 12 Sep 2012 14:06:27 +0000 (17:06 +0300)]
Remove some no-longer used code.
Shlomi Fish [Wed, 12 Sep 2012 14:04:49 +0000 (17:04 +0300)]
Prepend with an underscore.
To make it an internally-used subroutine.
Shlomi Fish [Wed, 12 Sep 2012 14:03:48 +0000 (17:03 +0300)]
Convert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 14:01:16 +0000 (17:01 +0300)]
Convert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:54:30 +0000 (16:54 +0300)]
Convert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:51:50 +0000 (16:51 +0300)]
Convert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:29:46 +0000 (16:29 +0300)]
Extract a constructor.
This will help in converting the other instances to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:08:16 +0000 (16:08 +0300)]
Convert a test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 12:59:12 +0000 (15:59 +0300)]
Convert a perl5db.t test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 10:35:43 +0000 (13:35 +0300)]
Add a test for l -num.
Shlomi Fish [Wed, 12 Sep 2012 09:56:51 +0000 (12:56 +0300)]
Test the ! command.
Shlomi Fish [Wed, 12 Sep 2012 07:56:54 +0000 (10:56 +0300)]
Test the { * command.
Shlomi Fish [Wed, 12 Sep 2012 07:52:12 +0000 (10:52 +0300)]
Convert to a different quoting.
This was done so gvim won't be confused with the bracket-matching.
I'll report the problem to the perl.vim project.
Shlomi Fish [Wed, 12 Sep 2012 07:47:19 +0000 (10:47 +0300)]
Test for the { and { ? commands.
Shlomi Fish [Wed, 12 Sep 2012 07:22:26 +0000 (10:22 +0300)]
Add a test for the < and > commands together.
Daniel Dragan [Mon, 12 Nov 2012 05:04:00 +0000 (00:04 -0500)]
rmv context from Perl_croak_no_modify and Perl_croak_xs_usage
Remove the context/pTHX from Perl_croak_no_modify and Perl_croak_xs_usage.
For croak_no_modify, it now has no parameters (and always has been
no return), and on some compilers will now be optimized to a conditional
jump. For Perl_croak_xs_usage one push asm opcode is removed at the caller.
For both funcs, their footprint in their callers (which probably are hot
code) is smaller, which means a tiny bit more room in the cache. My text
section went from 0xC1A2F to 0xC198F after apply this. Also see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/11/msg195233.html .
David Mitchell [Mon, 12 Nov 2012 10:36:55 +0000 (10:36 +0000)]
PADRANGE: don't assume targs are contiguous
Normally in something like my($x,$y,$z), the 3 targs are contiguous;
however eternal modules like Function::Parameters can break that
assumption, so don't assume it.
Yves Orton [Mon, 12 Nov 2012 08:35:57 +0000 (09:35 +0100)]
fix hash order dependency bug in new Module::Corelist::deprecated_in()
The code was doing
$version= List::Util::min(keys %$versions);
which introduces a hash order dependency as min() returns either the first or last
(i didnt check which) of the lowest items in the list, and considers 5.011000 and
5.011 to be equivalent. Depending on the hash order it would return
either one. Hash randomization revealed this bug immediately.
Changing the function to use List::Util::minstr() eliminates the
dependency.
$version= List::Util::minstr(keys %$versions);
Father Chrysostomos [Mon, 12 Nov 2012 06:16:35 +0000 (22:16 -0800)]
[perl #43077] Make goto &sub leave @_ alone
It is a little tricky, as we have to hang on to @_ while unwinding the
effects of local @_.
Father Chrysostomos [Sun, 11 Nov 2012 08:36:33 +0000 (00:36 -0800)]
leakfinder.pl: Many more exceptions
Father Chrysostomos [Fri, 9 Nov 2012 20:50:59 +0000 (12:50 -0800)]
Env.pm: Fix splice in list context
It was passing an extra argument to splice, causing splice @PATH, 0, 0
to append ":0" to the environment variable.
Father Chrysostomos [Fri, 9 Nov 2012 20:47:39 +0000 (12:47 -0800)]
Increase $Env::VERSION to 1.04
Father Chrysostomos [Fri, 9 Nov 2012 14:14:49 +0000 (06:14 -0800)]
Even more regexp charclass leaks
Karl Williamson [Sun, 11 Nov 2012 22:07:14 +0000 (15:07 -0700)]
toke.c: White-space only; no code changes
This indents a newly formed block, and changes one other line to line up
better.
Karl Williamson [Sun, 11 Nov 2012 21:47:53 +0000 (14:47 -0700)]
toke.c: Don't force \N{} into utf8 unnecessarily
regcomp.c no longer requires everything containing \N{} to be in UTF-8.
I'm not sure of the exact commit; it might even have been in 5.16. But
it was done by the time
86e88272fdabc40e3b168a3cc43af5e86284d01b was
done.
Therefore we can remove the temporary code that forced utf8, and replace
it with code that handles the non-utf8 case.
Note that outside patterns, \N{} still forces utf8. This is so that
Unicode semantics will be imposed on the string it resides in, no matter
how it is used. Patterns have a flag that indicates Unicode semantics,
so don't need to be in utf8.
Karl Williamson [Sun, 11 Nov 2012 21:45:19 +0000 (14:45 -0700)]
toke.c: Remove redundant checks
This code is redundant, as the whole string has been checked earlier for
valid utf8ness, or we assume that the internal Perl handler, charnames,
is correctly returning valid utf8.
Karl Williamson [Sun, 11 Nov 2012 21:28:17 +0000 (14:28 -0700)]
toke.c: Reorder declaration
This is in preparation for the next commit.
Karl Williamson [Thu, 8 Nov 2012 19:02:29 +0000 (12:02 -0700)]
toke.c: Use UTF-8 macros for portability
I noticed this code in toke.c that hand-rolled its own UTF-8 handling,
and is assuming an ASCII platform. There are macros that do the same
thing that this code does, and are portable.
Karl Williamson [Thu, 8 Nov 2012 19:04:34 +0000 (12:04 -0700)]
utf8.h: Add macro that handled malformed 2-byte UTF-8
The macro used traditionally to see if there is a two-byte UTF-8
sequence doesn't make sure that there actually is a second byte
available; it only checks if the first byte indicates that there is.
This adds a macro that is safe in the face of malformed UTF-8.
I inspected the existing calls in the core to the unsafe macro, and I
believe that none of them need to be converted to the safe version.
Karl Williamson [Thu, 8 Nov 2012 18:11:41 +0000 (11:11 -0700)]
util.c: Add some asserts()
These functions improperly have a signed parameter, when the value
should always be at least 0. We have a field report that one of them is
getting called with a negative value. Add asserts to catch this
condition (if compiling assertions is on) earlier.
Karl Williamson [Tue, 30 Oct 2012 16:15:38 +0000 (10:15 -0600)]
utf8.c: Remove redundant unlikely branches
The 2 lines removed in each function provide an early exit if the input
is malformed UTF-8. Other code executed later makes the same test.
But most inputs are going to be well-formed, so the test will almost
always fail, so will slow things up.
Karl Williamson [Fri, 9 Nov 2012 17:18:17 +0000 (10:18 -0700)]
Validate above-Latin1 characters in \N{} aliases
This completes the process of allowing users to define their own aliases
for \N{} in any language they choose. Names have some validation
applied so that they can't, for example, begin with something that is a
digit in some Unicode script. Tests and documentation are included in
this patch. The loop in toke.c that does the validation for
user-supplied translators is revamped, and the messages that are output
when there is an error are fixed to work with UTF-8.
Karl Williamson [Fri, 9 Nov 2012 16:46:37 +0000 (09:46 -0700)]
embed.fnc: Allow toke.c to call core_swash_init()
This internal function is allowed to just a few core functions
by #ifdef's in embed.fnc. Expand the list to include toke.c, as it will
be needed in a future commit.
Karl Williamson [Thu, 1 Nov 2012 18:06:32 +0000 (12:06 -0600)]
toke.c: Fail on malformed UTF-8 in \N{} input
The handler for \N{} can be user-supplied and charnames itself
shouldn't have to worry about malformed input. This changes toke.c to
check for malformed input before calling the \N{} handler.
Karl Williamson [Sun, 28 Oct 2012 16:29:10 +0000 (10:29 -0600)]
toke.c: Remove no-longer needed {...} and outdent correspondingly
No code changes
Brian Fraser [Sun, 28 Oct 2012 16:23:35 +0000 (10:23 -0600)]
toke.c: [RT#73022] Make \N{...} UTF-8 clean.
Karl Williamson [Sun, 28 Oct 2012 15:53:05 +0000 (09:53 -0600)]
toke.c Refactor S_get_and_check_backslash_N_name()
This code was recently factored out into a separate subroutine, and was
originally designed for a non-fatal deprecated warning. This
refactoring just goes immediately to failure when an illegal character
is found.
(It also changes the code to use Perl standard coding practices)
Karl Williamson [Fri, 26 Oct 2012 17:23:51 +0000 (11:23 -0600)]
perldiag: Add entry for unknown charname
Karl Williamson [Fri, 26 Oct 2012 17:06:18 +0000 (11:06 -0600)]
toke.c: Don't validate core charnames output
charnames now refuses to allow invalid aliases to be installed, so we
only need to validate those that come from a custom translator.
Karl Williamson [Fri, 26 Oct 2012 16:48:48 +0000 (10:48 -0600)]
charnames: Don't accept illegal :aliases
Now that improper names for characters are an error, we can forbid them
at definition time. For the time being allow a colon in the check that
continues to be run in toke.c. This will be removed in a future commit.
Karl Williamson [Thu, 8 Nov 2012 18:01:38 +0000 (11:01 -0700)]
regen/mk_PL_charclass.pl: Use mktables table for charname
This commit uses the mktables defined table for whether or not a
character is a legitimate charname continuation. This will allow it to
be kept in sync with other code that needs the definition.
The only change this makes is to delete "colon" from being a legitimate
continuation character. A colon was only accepted because it was used
in the paradigm for like "Greek: Alpha", and is not part of any
actual character name.
Karl Williamson [Thu, 8 Nov 2012 17:59:11 +0000 (10:59 -0700)]
mktables: Create tables for charname beginning and follow-on
mktables is changed to add two new tables, one that matches the first
character in a character names, and one that matches continuation
characters.
Karl Williamson [Fri, 26 Oct 2012 02:12:04 +0000 (20:12 -0600)]
Make \N{alias} deprecations fatal.
Since v5.12, using some non-name like characters, like commas, have
generated a deprecation warning. The required 2 releases have been
made, and they are now being made fatal.
Karl Williamson [Fri, 26 Oct 2012 02:06:17 +0000 (20:06 -0600)]
charnames: Correct pod misstatement
Character names can contain Latin1 currently, not just ASCII.
Karl Williamson [Fri, 26 Oct 2012 01:10:03 +0000 (19:10 -0600)]
toke.c: Extract part of \N{} processing to new function
This is in preparation for making fatal the deprecations that this code
covers.
This code combines the first and final portions of the code that handles
\N{names}, leaving the middle intact. There are no intentional logic
changes. The code is moved and outdented as appropriate for not being
within nested "if's", and the comments are reflowed to fill 79 columns.
One declaration had a const added.
This causes the logic that checks for input name validity to be moved
from after everything is computed to doing it beforehand. Since invalid
names are not currently fatal, there was no problem with checking them
after computing things, but a future commit will make them fatal, so
this saves the work of computing something that is erroneous.
Karl Williamson [Thu, 25 Oct 2012 04:06:48 +0000 (22:06 -0600)]
utf8n_to_uvuni() pod: Add clarifications
Karl Williamson [Thu, 25 Oct 2012 04:05:47 +0000 (22:05 -0600)]
charnames pod: Nits
Karl Williamson [Thu, 25 Oct 2012 03:56:27 +0000 (21:56 -0600)]
charnames.t: Make EXPECTs more robust
We can use OPTIONS regex in test.pl to avoid tieing to a spcific line.
The random option is no longer needed, as the messages that were coming
out in random order have been removed by another commit. The Execution
aborted messages also can be omitted, and the tests pass.
Craig A. Berry [Sun, 11 Nov 2012 14:55:41 +0000 (08:55 -0600)]
Preserve filename case on VMS.
VMS systems of the last decade or so have the ability, when
operating on an ODS-5 volume, to preserve filename case. In order
for CRTL calls to make use of this capability, the feature setting
DECC$EFS_CASE_PRESERVE must be explicitly enabled. We now do that
for Perl at start-up time, which depends on latent support that
has been in the core since 5.10 but not quite working until
recently.
Note that case preservation of command-line arguments is not
included in this feature. That's a different setting and is not
entirely under Perl's control as the command line is parsed by
DCL before the CRTL sees it.
Craig A. Berry [Sun, 11 Nov 2012 14:50:47 +0000 (08:50 -0600)]
Move VMS feature-setting function to an appropriate place.
It was in the middle of the includes at the top of the file. Move
it close to its only use and, more importantly, after the includes,
some of which it now depends on.
Craig A. Berry [Sun, 11 Nov 2012 14:45:28 +0000 (08:45 -0600)]
Set feature logical names in VMS init code.
When setting a CRTL feature, also record the setting in a user-mode
logical name since historically checking the environment is the only
way a Perl program can check a particular setting (otherwise we'd
need the currently vaporware VMS::Feature extension).
Craig A. Berry [Sun, 11 Nov 2012 14:18:56 +0000 (08:18 -0600)]
Normalize VMS case handling in ExtUtils::Manifest.
Both manifind and maniread were not completely matching filesystem
behavior when downcasing filenames.
Craig A. Berry [Sun, 11 Nov 2012 14:09:28 +0000 (08:09 -0600)]
Fix VMS-specific case nit in File::Glob's basic.t.
t/TEST may appear in upper or lower case and with or without a
trailing dot depending on various Unix compatibility settings.
Craig A. Berry [Sun, 11 Nov 2012 14:02:31 +0000 (08:02 -0600)]
Remove an inadvertent case sensitivity from find.t.
The extension of a VMS directory may be presented as .DIR or .dir
depending on various settings and its actual name on disk.
James E Keenan [Sat, 10 Nov 2012 14:05:06 +0000 (09:05 -0500)]
Amplify diagnostic about in-place editing.
An uneditable directory is a "special file" from the point of view of 'perl
-wne'.
For RT #72284. Thanks to frank.wiegand for report.
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 23:57:07 +0000 (23:57 +0000)]
Update IO-Compress to CPAN version 2.057
[DELTA]
2.057 10 November 2012
* IO::Compress::Zip
Allow member name & Zip Comment to be "0"
* IO::Compress::Base::Common
Remove "-r" test - the file open will catch this.
RT# 80855: IO::Compress::Base::Common returns that it cannot read readable files in NFS
* RT# 79820: Install to 'site' instead of 'perl' when perl version is 5.11+
* General Performance improvements.
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 23:53:54 +0000 (23:53 +0000)]
Update Compress-Raw-Bzip2 to CPAN version 2.057
[DELTA]
2.057 10 November 2012
* Compress::Raw::Bzip2 needs to use PERL_NO_GET_CONTEXT
[#80318]
* Install to 'site' instead of 'perl' when perl version is 5.11+
[#79811]
* update to ppport.h that includes SvPV_nomg_nolen
[#78080]
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 23:48:16 +0000 (23:48 +0000)]
Update Compress-Raw-Zlib to CPAN version 2.057
[DELTA]
2.057 10 November 2012
* Compress::Raw::Zlib needs to use PERL_NO_GET_CONTEXT
[#80319]
* Install to 'site' instead of 'perl' when perl version is 5.11+
[#79812]
* update to ppport.h that includes SvPV_nomg_nolen
[#78079]
David Mitchell [Sun, 11 Nov 2012 00:01:21 +0000 (00:01 +0000)]
make MULTICALL safe across cxstack reallocs
[perl #115602]
MUTLICALL sets a local var, cx, to point to the current context stack
frame. When a function is called, the context stack might be realloc()ed,
in which case cx would point to freed memory.
David Mitchell [Sat, 10 Nov 2012 22:39:03 +0000 (22:39 +0000)]
README: add pointer to super-quick patch quide
David Mitchell [Sat, 10 Nov 2012 17:43:53 +0000 (17:43 +0000)]
fix NAME of perl5125delta.pod
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 15:37:00 +0000 (15:37 +0000)]
Module-CoreList updated to 2.77
- Documented decprecated_in() function
- Updated with v5.16.2 data
- Updated with v5.12.5 data
- Updated POD to reflect included perl data
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 15:16:24 +0000 (15:16 +0000)]
The v5.16.2 updates had disappeared (if they were there in the first place) reinstate
Dominic Hargreaves [Sat, 10 Nov 2012 15:16:41 +0000 (15:16 +0000)]
add 5.12.5 to perlhist
Dominic Hargreaves [Sat, 10 Nov 2012 15:13:35 +0000 (15:13 +0000)]
Add the 5.12.5 perldelta
Dominic Hargreaves [Sat, 10 Nov 2012 14:26:22 +0000 (14:26 +0000)]
add 5.12.5 epigraph
David Mitchell [Sat, 10 Nov 2012 11:35:46 +0000 (11:35 +0000)]
[MERGE] add PADRANGE op and $B::overlay
This commit implements three optimisations and one new feature.
The new feature is $B::overlay, which can be set to a hash ref, indexed by
op address, that allows you to override the values returned by the various
B::*OP methods for a particular op. This specifically allows Deparse to be
tricked into seeing a pre-optimisation view of the optree, and so makes
adding new optimisations (like the one in this commit) a lot easier.
As regards optimisations: first, a new save type is added:
SAVEt_CLEARPADRANGE, which is like SAVEt_CLEARSV but specifies a range of
targs to be cleared. The save type, target base and range all fit within a
single integer pushed on the save stack.
Second, a pushmark followed by one or more pad[ahs]v ops (and possibly
some mixed-in null, list and nextstate ops) will sometimes be replaced by
a single padrange op. Like other pad ops, this specifies a targ, but in
addition the bottom 7 bits of op_private indicate a target range.
pp_padrange has two main actions: with OPpLVAL_INTRO, it pushes a
SAVEt_CLEARPADRANGE onto the save stack and turns off SvPADSTALE on all
the lexicals; and in non-void context, it pushes all the lexicals onto the
stack.
Third, for the specific case of the construct my(...) = @_, the
ops to push @_ onto the stack (pushmark/gv[*_]/rv2sv) are skipped,
and the OPf_SPECIAL flag on the padrange op is set: this tells
pp_padrange to push @_ directly.
Note that not sequences of pad ops are consolidated into a single
padrange op; the chief constraints are that:
* they must form a list (i.e. start with pushmark);
* the targs must form a contiguous range;
* the flags of the ops must all be similar; e.g. all INTRO or all not,
all void or all not, etc;
* only a subset of flags are allowed; e.g. we don't optimise with
OPpPAD_STATE or OPpMAYBE_LVSUB present.
For the specific case of void/INTRO, we consolidate across nextstate
boundaries (keeping only the last nextstate); i.e.
my ($a,$b); my @c; my (%d,$e,$f)
becomes a single padrange op. Note that the padrange optimisation is
particularly efficient for the void/INTRO combination: formerly,
my($a,$b,@c,%d); would be compiled as
pushmark; padsv[$a]; padsv[$b]; padav[@c]; padhv[%d]; list; nextstate
which would have the effect of pushing $a, $b onto the stack, then
pushing the (non-existent) elements of @c, then pushing the %d HV; then
pp_list would pop all the elements except the last, %h; finally, nextstate
would pop %h. Instead, padrange skips all the pushing and popping in void
context. Note that this means that there is one user-visible change caused
by this optimisation:
f();
my @a;
sub f { tie @a, ...; push @a, .... }
Here, @a is tied and already has elements by the time the 'my @a' is
executed; formerly, FETCH would be called repeatedly to push the elements
of @a onto the stack, then they would all be popped again at the end of the
'my @a' statement; now FETCH is never called.
The optimisation itself is implemented by converting the initial pushmark
op into a padrange, and updating its op_next. The skipped ops are *not*
cleared; this makes it easier for S_find_uninit_var() and Deparse.pm to do
their stuff. Deparse is implemented by using the new $B::overlay facility
to make the padrange op look like a pushmark op again; the rest of the
Deparse code just sees the original unoptimised optree and so doesn't
require any knowledge of the padrange op.
David Mitchell [Mon, 5 Nov 2012 13:54:51 +0000 (13:54 +0000)]
ext/B/t/OptreeCheck.pm: fix hint stripping
The code that strips hints from a nextstate couldn't handle
the 'next' pointer being '-', e.g. v:>,<,% ->-
David Mitchell [Mon, 5 Nov 2012 13:06:38 +0000 (13:06 +0000)]
fix optree_misc.t test after smoke
Some of the unicode setting in a smoke environment sets the open hints
output on nextstate lines.
David Mitchell [Fri, 2 Nov 2012 16:18:20 +0000 (16:18 +0000)]
Consolidate any single pad ops after a padrange
Given something like
my ($a,$b); my $c; my $d;
then after having detected that we can create a padrange op for $a,$b,
extend it to include $c,$d too.
Together with the previous commit that consolidates adjacent padrange
ops, this means that any contiguous sequence of void 'my' declarations
that starts with a list (i.e. my ($x,..) rather than my $x) will
all be compressed into a single padrange op. For example
my ($a,$b);
my @c;
my %d;
my ($e,@f);
becomes the two ops
padrange[$a;$b;@c;%d;$e;@f]
nextstate
The restriction on the first 'my' being a list is that we only ever
convert pushmarks into padranges, to keep things manageable (both for
compiling and for Deparse). This simply means that
my $x; my ($a,$b); my @c; my %d; my ($e,@f)
becomes
padsv[$x]
nextstate
padrange[$a;$b;@c;%d;$e;@f]
nextstate
David Mitchell [Fri, 2 Nov 2012 14:37:29 +0000 (14:37 +0000)]
Consolidate adjacent padrange ops
In something like
my ($a,$b);
my ($c,$d);
when converting $c,$d into a padrange op, check first whether we're
immediately preceded by a similar padrange (and nextstate) op,
and if so re-use the existing padrange op (by increasing the count).
Also, skip the first nextstate and only use the second nextstate.
So
pushmark;
padsv[$a]; padsv[$b]; list;
nextstate 1;
pushmark;
padsv[$c]; padsv[$c]; list;
nextstate 2;
becomes
padrange[$a,$b]
nextstate 1;
pushmark;
padsv[$c]; padsv[$c]; list;
nextstate 2;
which then becomes
padrange[$a,$b,$c,$d];
nextstate 2;
David Mitchell [Tue, 30 Oct 2012 15:10:06 +0000 (15:10 +0000)]
padrange: handle @_ directly
In a construct like
my ($x,$y) = @_
the pushmark/padsv/padsv is already optimised into a single padrange
op. This commit makes the OPf_SPECIAL flag on the padrange op indicate
that in addition, @_ should be pushed onto the stack, skipping an
additional pushmark/gv[*_]/rv2sv combination.
So in total (including the earlier padrange work), the above construct
goes from being
3 <0> pushmark s
4 <$> gv(*_) s
5 <1> rv2av[t3] lK/1
6 <0> pushmark sRM*/128
7 <0> padsv[$x:1,2] lRM*/LVINTRO
8 <0> padsv[$y:1,2] lRM*/LVINTRO
9 <2> aassign[t4] vKS
to
3 <0> padrange[$x:1,2; $y:1,2] l*/LVINTRO,2 ->4
4 <2> aassign[t4] vKS
David Mitchell [Sun, 28 Oct 2012 12:58:22 +0000 (12:58 +0000)]
reindent block in leave_scope
The previous commit added a loop round a block of code; now increase
the indent of the body of the loop.
David Mitchell [Wed, 17 Oct 2012 18:45:38 +0000 (19:45 +0100)]
add SAVEt_CLEARPADRANGE
Add a new save type that does the equivalent of multiple SAVEt_CLEARSV's
for a given target range. This makes the new padange op more efficient.
David Mitchell [Mon, 24 Sep 2012 12:50:22 +0000 (13:50 +0100)]
add padrange op
This single op can, in some circumstances, replace the sequence of a
pushmark followed by one or more padsv/padav/padhv ops, and possibly
a trailing 'list' op, but only where the targs of the pad ops form
a continuous range.
This is generally more efficient, but is particularly so in the case
of void-context my declarations, such as:
my ($a,@b);
Formerly this would be executed as the following set of ops:
pushmark pushes a new mark
padsv[$a] pushes $a, does a SAVEt_CLEARSV
padav[@b] pushes all the flattened elements (i.e. none) of @a,
does a SAVEt_CLEARSV
list pops the mark, and pops all stack elements except the last
nextstate pops the remaining stack element
It's now:
padrange[$a..@b] does two SAVEt_CLEARSV's
nextstate nothing needing doing to the stack
Note that in the case above, this commit changes user-visible behaviour in
pathological cases; in particular, it has always been possible to modify a
lexical var *before* the my is executed, using goto or closure tricks.
So in principle someone could tie an array, then could notice that FETCH
is no longer being called, e.g.
f();
my ($s, @a); # this no longer triggers two FETCHES
sub f {
tie @a, ...;
push @a, 1,2;
}
But I think we can live with that.
Note also that having a padrange operator will allow us shortly to have
a corresponding SAVEt_CLEARPADRANGE save type, that will replace multiple
individual SAVEt_CLEARSV's.
David Mitchell [Tue, 25 Sep 2012 11:47:51 +0000 (12:47 +0100)]
pad_free(): don't clear SVs_PADSTALE
pad_free() clears the SVs_PADTMP bit. Since that bit is now shared
with SVs_PADSTALE, that gets cleared on state vars. It didn't matter up
till now, but the next commit will start optimising away pad ops, and
op_null() will call pad_free() which would clear the SVs_PADSTALE bit.
So only clear SVs_PADTMP/SVs_PADSTALE for non-lexical var ops.
David Mitchell [Tue, 23 Oct 2012 20:39:10 +0000 (21:39 +0100)]
add $B::overlay feature
This allows you to alter the read-only "view" of an optree, by making
particular B::*OP methods on particular op nodes return customised values.
Intended to be used by B::Deparse to "undo" optimisations, thus making it
easier to add new optree optimisations without breaking Deparse.
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 12:31:46 +0000 (12:31 +0000)]
Update CGI to CPAN version 3.62
[DELTA]
Version 3.62, Nov 9th, 2012
[INTERNALS]
- Changed how the deprecated endform function was defined for compatibilty
with the development version of Perl.
- Fix failures in t/tmpdir.t when run as root
https://github.com/markstos/CGI.pm/issues/22, RT#80659)
- Made it possible to force a sorted order for things like hash
attributes so that tests are not dependent on a particular hash
ordering. This will be required in modern perls which will
change the ordering per process. (Yves, RT#80659)
Chris 'BinGOs' Williams [Sat, 10 Nov 2012 12:29:21 +0000 (12:29 +0000)]
Update Term-UI to CPAN version 0.32
[DELTA]
Changes for 0.32 Sat Nov 10 11:00:31 GMT 2012
=====================================================
* Add a delimiter to a prompt that doesn't have a default
(Tommy Stanton)
Steve Hay [Fri, 9 Nov 2012 15:04:35 +0000 (15:04 +0000)]
Restore non-DEBUGGING build on Win32, broken in
28e70dfacc