Aaron Crane [Tue, 18 Mar 2014 18:51:54 +0000 (18:51 +0000)]
Fix minor inaccuracy in the release manager's guide
Aaron Crane [Tue, 18 Mar 2014 18:50:38 +0000 (18:50 +0000)]
Upgrade Digest-SHA from 5.87 to 5.88
[DELTA]
- added OUTPUT clause in SHA.xs to silence compiler warning
-- ref. shaclose()
- changed text file test (-T) to act on filehandles
-- ref. addfile portable mode
-- improves consistency when reading from STDIN
-- still acts on filenames for early Perls (< 5.6)
- added -M and -V options to shasum
-- undocumented: for development and testing use only
Karl Williamson [Tue, 18 Mar 2014 18:45:49 +0000 (12:45 -0600)]
Porting/todo.pod: Use F<> instead of C<>
A file path is supposed to be enclosed in F<>
Karl Williamson [Tue, 18 Mar 2014 18:17:16 +0000 (12:17 -0600)]
mktables: In-line defns for tables up to 3 ranges
eb0925341cc65ce6ce57503ec0ab97cdad39dc98 caused the definitions for
about 45% of the Unicode tables to be placed in-line in Heavy.pl instead
of them having to be read-in from disk. This new commit extends that so
that about 55% are in-lined, by in-lining tables which consist of up to
3 ranges.
This is a no-brainer to do, as the memory usage does not increase by
doing it, and disk accesses go down. I used the delta in the disk size
of Heavy.pl as a proxy for the delta in the memory size that it uses,
as what this commit does is to change various scalar strings in it.
Doing this measurement indicates that this commit results in a slightly
smaller Heavy.pl than what was there before
eb092534. The amounts will
vary between Unicode releases. I also checked for Unicode beta 7.0, and
the sizes are again comparable, with a slightly larger Heavy.pl for the
3-range version there.
For 4-, 5-, ... range tables, doing this results in slowly increasing
Heavy.pl size (and hence more and more memory use), and that is
something we may wish to look at in the future, trading memory for fewer
files and less disk start-up cost. But for the imminent v5.20, doing it
for 3-range tables doesn't cost us anything, and gains us fewer disk
files and accesses.
Karl Williamson [Tue, 18 Mar 2014 18:10:46 +0000 (12:10 -0600)]
mktables: Remove obsolete sort constraint
Zero-length tables are no longer expressed in terms of the Perl 'All'
property, so the sort no longer has to make sure the latter is processed
before the former.
Karl Williamson [Tue, 18 Mar 2014 18:09:25 +0000 (12:09 -0600)]
mktables: Add comments, reorder a gen'd file
This adds some clarifying comments, and reorders Heavy.pl so the array
referred to by two hashes occurs before both hashes in the output.
Karl Williamson [Tue, 18 Mar 2014 18:07:55 +0000 (12:07 -0600)]
mktables: White-space only
This indents code to conform to the new block created in the previous
commit
Karl Williamson [Tue, 18 Mar 2014 17:43:59 +0000 (11:43 -0600)]
utf8_heavy.pl: Change data structure for in-lined definitions
This commit puts the in-lined definitions introduced by
eb0925341cc65ce6ce57503ec0ab97cdad39dc98 into a separate array,
where each element is a unique definition. This can result in slightly
smaller current memory usage in utf8_heavy.pl, as the strings giving the
file names now only appear once, and what replaces them in the hash
values are strings of digits indices, which are shorter.
But doing this allows us in a later commit to increase the number of
ranges in the tables that get in-lined, without increasing memory usage.
This commit also changes the code that generates the definitions to be
more general, so that it becomes trivial to change things to generate
in-line definitions for tables with more than one range.
Karl Williamson [Tue, 18 Mar 2014 16:39:53 +0000 (10:39 -0600)]
mktables: Fix overlooked in-line table defns code
Commit
eb0925341cc65ce6ce57503ec0ab97cdad39dc98 introduced the idea of a
pseudo-directory as a way to store table definitions in-line in
Heavy.pl, but conform to the expectations of the code in regard to
objects being files within directories. This kept the needed changes to
a minimum. The code changed by the current commit was overlooked then
as something that also needed to change, because there are no current
instances of it needing to. But this could change with future Unicode
versions, or as in the next few commits, in extending the in-line
definitions.
Matthew Horsfall (via RT) [Thu, 13 Mar 2014 12:39:48 +0000 (05:39 -0700)]
Add support for test.valgrind parallel testing
# New Ticket Created by Matthew Horsfall
# Please include the string: [perl #121431]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=121431 >
This is a bug report for perl from wolfsage@gmail.com,
generated with the help of perlbug 1.39 running under perl 5.14.2.
-----------------------------------------------------------------
[Please describe your issue here]
The included patch allows test.valgrind to run tests in parallel.
Valgrind output for each test will be printed out after the test
completes, with the name of the test prefixing every line.
Example usage might be:
TEST_JOBS=8 make test.valgrind VALGRIND='valgrind -q' 2>&1 | tee out.txt
-q is needed to ensure only *errors* are captured, otherwise the output will
be much louder than it already is. (Perhaps this should be the default mode?)
[Please do not change anything below this line]
-----------------------------------------------------------------
Ricardo Signes [Tue, 18 Mar 2014 17:29:54 +0000 (13:29 -0400)]
Merge perllexwarn.pod into warnings.pm
Ricardo Signes [Tue, 18 Mar 2014 17:29:42 +0000 (13:29 -0400)]
regenerate warnings.pm
Ricardo Signes [Tue, 18 Mar 2014 17:24:50 +0000 (13:24 -0400)]
do not podcheck regen/warnings.pl
Ricardo Signes [Tue, 18 Mar 2014 17:16:08 +0000 (13:16 -0400)]
warnings.pm: improve awkward sentence in pod
Ricardo Signes [Fri, 14 Mar 2014 08:28:38 +0000 (09:28 +0100)]
bump the version of warnings.pm
(and of regen/warnings.pl)
Ricardo Signes [Fri, 14 Mar 2014 08:15:36 +0000 (09:15 +0100)]
replace links to perllexwarn with links to warnings
or, sometimes, simply remove them
Ricardo Signes [Fri, 14 Mar 2014 08:11:28 +0000 (09:11 +0100)]
remove references to perllexwarn from warnings.pm
Ricardo Signes [Fri, 14 Mar 2014 08:09:29 +0000 (09:09 +0100)]
regen/warnings.pl no longer touches perllexwarn
Ricardo Signes [Fri, 14 Mar 2014 08:09:09 +0000 (09:09 +0100)]
turn perllexwarn into a stub
Ricardo Signes [Fri, 14 Mar 2014 08:04:09 +0000 (09:04 +0100)]
merge most of perllexwarn into warnings
Ricardo Signes [Fri, 14 Mar 2014 07:51:31 +0000 (08:51 +0100)]
replace printTree with warningsTree
we return, rather than print, the warnings, so we can potentially
futz around with the string and put it where we like without
having to worry about C<select>
Ricardo Signes [Fri, 14 Mar 2014 07:45:06 +0000 (08:45 +0100)]
enclose warnings.h generation in a block
...to limit the number of variables visible everywhere and
make it a bit easier to see what I am doing as I refactor
regen/warnings.pl
Aaron Crane [Tue, 18 Mar 2014 17:17:54 +0000 (17:17 +0000)]
Fix uninitialized-value warnings in Thread::Queue
This involves a version bump, to 3.05.
Andy Dougherty [Thu, 13 Mar 2014 20:16:22 +0000 (16:16 -0400)]
Make sure the PWD environment variable points to the t directory.
runtests is typically run under /bin/sh. If the user uses a different
interactive shell (such as /bin/ksh) that maintains the PWD environment
variable, but /bin/sh does not, then the 'cd t' line in runtests ends
up changing the working directory without updating $PWD. Several tests
in t/io/fs.t rely on being able to change directories and then get back
to the original. The tests assume that if $PWD is set at all, then
it is set correctly. This fix changes runtests to ensure it is so.
Andy Dougherty [Thu, 13 Mar 2014 19:44:19 +0000 (15:44 -0400)]
Split file into parts with and without substitutions.
At this point, there are no functional changes. This just prepares
the way for future work.
Yves Orton [Sat, 1 Mar 2014 16:31:53 +0000 (17:31 +0100)]
Preallocate HvAUX() structures for large bucket arrays
The assumption is that the time/space tradeoff of not allocating
the HvAUX() structure goes away for a large bucket array where the
size of the allocated buffer is much larger than the nonallocated
HvAUX() "extension".
This should make keys() and each() on larger hashes faster, but
still preserve the essence of the original space conservation,
where the assumption is a lot of small hash based objects which
will never be traversed.
Yves Orton [Sat, 1 Mar 2014 14:49:28 +0000 (15:49 +0100)]
Split out part of hv_auxinit() so it can be reused
Changes nothing except that it introduces hv_auxinit_interal() which
does part of the job of hv_auxinit(), so that we can call it from
somewhere else in the next commit.
David Mitchell [Mon, 17 Mar 2014 16:44:48 +0000 (16:44 +0000)]
perlfunc: clarify kill()'s return value
David Mitchell [Mon, 17 Mar 2014 16:19:10 +0000 (16:19 +0000)]
tidy up kill0.t and kill0_child
The previous commit added some tests to kill0.t, and added the auxiliary
file kill0_child. Tidy up the new code to better match normal standards.
In particular, improve the format, grammar and clarity of the comments,
and replace q|...| with "..." where appropriate.
Also, make the temporary filename a variable, and prefix it with "tmp-",
so that if gets left around for any reason, it's more obvious that it's
just an extraneous temporary file.
(I haven't actually tested this commit on win32)
Daniel Dragan [Mon, 17 Mar 2014 15:29:52 +0000 (15:29 +0000)]
RT #121230, tests for process group kill on Win32
Add tests for
111f73b5d79, the fix for kill -SIG on win32, which was
broken in 5.18.0
(A follow-up commit will clean this code up a bit)
David Mitchell [Sun, 16 Mar 2014 18:51:07 +0000 (18:51 +0000)]
[MERGE] avoid calling pp_null().
Several 'empty' ops like OP_NULL and OP_SCOPE call pp_null() at run-time
(which just returns). Attempts are made to strip such empty ops from the
op_next execution chain, but this has not been not complete. In
particular, ops at the head or tail of a sub-chain, or ops that rpeep()
has itself nulled, weren't being eliminated.
This merge avoids all calls to pp_null() in the test suite, apart from
those called via the constant folder (which is called before null op
elimination), and OP_REGCMAYBE (which isn't addressed here).
David Mitchell [Wed, 5 Mar 2014 16:08:02 +0000 (16:08 +0000)]
elide "empty" ops at the head of op_next chains
Currently all OP_NULL/OP_SCOPE/OP_SCALAR/OP_LINESEQ ops (which all map at
run time to pp_null()) are eliminated from op_next chains *except* ones at
the head of a chain (e.g. pointed to by o->op_other).
The API of peep()/rpeep() makes it difficult to directly do this within
the function itself, as it has no return value - and thus
RPEEP(o->op_other) has no way to update op_other to skip the first op if
it happens to be a null or whatever.
Instead, we add a small helper function, S_prune_chain_head(), and
always call it after we call peep, e.g.
CALL_PEEP(PL_main_start);
finalize_optree(PL_main_root);
+S_prune_chain_head(aTHX_ &PL_main_start);
rpeep() is also complicated by its recursion reduction mechanism, where
it saves the addresses of several ops before recursing on them. I had to
change this so that it saves the addresses of the addresses of the ops
instead, so they can be updated: i.e. rather than saving o->op_other,
it saves &(o->op_other).
With this commit, nothing in the test suite triggers executing pp_null(),
execpt OP_REGCMAYBE and S_fold_constants(). I verified this with the
following hacky diff:
>>>>diff --git a/op.c b/op.c
>>>>index 716c684..819a717 100644
>>>>--- a/op.c
>>>>+++ b/op.c
>>>>@@ -3489,6 +3489,7 @@ S_op_integerize(pTHX_ OP *o)
>>>> return o;
>>>> }
>>>>
>>>>+int XXX_folding = 0;
>>>> static OP *
>>>> S_fold_constants(pTHX_ OP *o)
>>>> {
>>>>@@ -3504,6 +3505,7 @@ S_fold_constants(pTHX_ OP *o)
>>>> SV * const olddiehook = PL_diehook;
>>>> COP not_compiling;
>>>> dJMPENV;
>>>>+ int XXX_folding_old = XXX_folding;
>>>>
>>>> PERL_ARGS_ASSERT_FOLD_CONSTANTS;
>>>>
>>>>@@ -3583,11 +3585,13 @@ S_fold_constants(pTHX_ OP *o)
>>>> assert(IN_PERL_RUNTIME);
>>>> PL_warnhook = PERL_WARNHOOK_FATAL;
>>>> PL_diehook = NULL;
>>>>+ XXX_folding = 1;
>>>> JMPENV_PUSH(ret);
>>>>
>>>> switch (ret) {
>>>> case 0:
>>>> CALLRUNOPS(aTHX);
>>>>+ XXX_folding = XXX_folding_old;
>>>> sv = *(PL_stack_sp--);
>>>> if (o->op_targ && sv == PAD_SV(o->op_targ)) { /* grab pad temp? */
>>>> #ifdef PERL_MAD
>>>>@@ -3608,10 +3612,12 @@ S_fold_constants(pTHX_ OP *o)
>>>> case 3:
>>>> /* Something tried to die. Abandon constant folding. */
>>>> /* Pretend the error never happened. */
>>>>+ XXX_folding = XXX_folding_old;
>>>> CLEAR_ERRSV();
>>>> o->op_next = old_next;
>>>> break;
>>>> default:
>>>>+ XXX_folding = XXX_folding_old;
>>>> JMPENV_POP;
>>>> /* Don't expect 1 (setjmp failed) or 2 (something called my_exit) */
>>>> PL_warnhook = oldwarnhook;
>>>>diff --git a/pp_hot.c b/pp_hot.c
>>>>index 36eac2b..ccb582f 100644
>>>>--- a/pp_hot.c
>>>>+++ b/pp_hot.c
>>>>@@ -68,9 +68,16 @@ PP(pp_gvsv)
>>>> RETURN;
>>>> }
>>>>
>>>>+extern int XXX_folding;
>>>> PP(pp_null)
>>>> {
>>>> dVAR;
>>>>+ if (!XXX_folding && PL_op->op_type != OP_REGCMAYBE) {
>>>>+ sv_dump((SV*)find_runcv(0));
>>>>+ op_dump(PL_op);
>>>>+ op_dump((OP*)PL_curcop);
>>>>+ assert(0);
>>>>+ }
>>>> return NORMAL;
>>>> }
>>>>
David Mitchell [Wed, 5 Mar 2014 19:42:36 +0000 (19:42 +0000)]
rpeep(): elide just-nulled ops
Perl_rpeep() currently spots "empty" ops like OP_NULL, OP_SCOPE
and elides them from the op_next chain (by setting oldop->op_next to point
to the op following the current op). However, if rpeep() itself
op_null()'s the current op, then when the main loop is re-entered, that
mechanism is bypassed. Modify re-entry to the loop in this case so that
the just nulled op re-processed and thus elided.
(Also document what the OP_SASSIGN/OP_SUBSTR optimisation is doing;
studying that was what originally led me to this general fix.)
David Mitchell [Wed, 5 Mar 2014 19:42:02 +0000 (19:42 +0000)]
rpeep(): remove trailing OP_NULLs etc
Perl_rpeep() elides OP_NULLs etc in the middle of an op_next chain, but
not at the start or end. Doing it at the start is hard (and not addressed
here); doing it at the end is trivial, and it just looks like a mistake in
the original code (there since 1994) that was (incorrectly) worried about
following through a null pointer.
David Mitchell [Thu, 6 Mar 2014 13:32:56 +0000 (13:32 +0000)]
code following eval {} not always optimised
In something like this
eval { 1 while 1 };
$x = $a[0];
The optimising of the while loop makes Perl_rpeep() miss processing the
chain of ops from the OP_LEAVETRY onwards. So in the code above for
example, the alem wont be optimised into an alemfast.
Fix this by explicitly recursing into the entertry->op_other branch
(which actually points at the leavetry).
The infinite loop above can be broken by, for example, a signal handler
calling die.
David Mitchell [Wed, 5 Mar 2014 14:44:41 +0000 (14:44 +0000)]
OP_SORT: store start of block in null->op_next
When a sort with a code block, like sort { BLOCK } arg, ...
is compiled, it comes out like
sort
pushmark
null
scope
BLOCK
arg
...
(The 'scope' may be instead be 'ex-leave' depending on circumstances).
At run time, pp_sort() navigates its way down from the sort op to find the
start op of the BLOCK. We can shorten this process slightly by storing the
start of BLOCK in the otherwise unused op_next field of the OP_NULL.
Effectively we are using the null->op_next field as a surrogate op_other
field for the op_sort (which doesn't have a spare field we could store
the pointer in).
The main point of this commit however is not the slight speed up from
skipping a couple of pointer follows at run-time; rather that it will
shortly allow us to trim any null ops from the beginning of the BLOCK. We
can't do this directly, as that would involve changing the scope->op_first
pointer, which might confuse B:: type modules.
David Mitchell [Wed, 5 Mar 2014 14:19:33 +0000 (14:19 +0000)]
rpeep(): OP_SORT with code block has OPf_SPECIAL
In rpeep(), we check whether the OP_SORT has a code block as the first arg
(e.g. sort {BLOCK} ...) by testing for OPf_STACKED, then looking for
an OP_SCOPE or ex-OP_LEAVE. However, ck_sort() has already checked for
this situation and set the OPf_SPECIAL flag. So just just check for this
flag in rpeep(); leave in the OP_SCOPE/ex-OP_LEAVE checks as just
assertions.
Also, add some commentary to ck_sort() and S_simplify_sort().
David Mitchell [Sun, 16 Mar 2014 18:04:13 +0000 (18:04 +0000)]
[MERGE] more refactoring of re_intuit_start()
This is the second merge commit of work I've done on re_intuit_start().
This one mostly concentrates on the block of code that looks for a start
class. It does a lot of reorganisation of the ordering of the various
nested if/elses, and by doing do manages to eliminate three labels and
associated gotos.
It also audits that block for UTF8 correctness, either fixing or
documenting areas where byte rather than char arithmetic was being
performed. At this point I've now done a basic audit of the whole
function.
It also swaps the start class and 'update BmUSEFUL' blocks. This seems
more logical, and makes the code simpler.
Finally, it cleans up and updates a lot of comments in the function
generally.
This merge has mainly been simplifying, cleaning up and fixing work.
I still have a big list of stuff that *could* be done, including further
optimisations.
David Mitchell [Sun, 16 Mar 2014 16:25:59 +0000 (16:25 +0000)]
re_intuit_start(): re-comment head of function
The blurb above this function is a mess and contains lots of obsolete
stuff. Mostly rewrite it. Also sprinkle a few extra comments elsewhere.
David Mitchell [Sun, 16 Mar 2014 15:41:55 +0000 (15:41 +0000)]
re_intuit_start(): indent rest of check block
Most of the 'check' substring matching code is in its own scope;
move the last few bits into that scope too. This is purely cosmetic.
David Mitchell [Sun, 16 Mar 2014 15:40:00 +0000 (15:40 +0000)]
re_intuit_start(): add some general comments
David Mitchell [Sun, 16 Mar 2014 12:17:18 +0000 (12:17 +0000)]
re_intuit_start(): update comments in BmUSEFUL blk
David Mitchell [Sun, 16 Mar 2014 11:58:51 +0000 (11:58 +0000)]
re_intuit_start(): update comments in stclass code
Improve the description at the start of this code block, and move
some of the comments closer to where they apply (and explain why they're
probably wrong)
David Mitchell [Sun, 16 Mar 2014 11:36:43 +0000 (11:36 +0000)]
re_intuit_start(): improve main terminating cond
At the end of the failure block in the stclass code, it decides whether
rx_origin has been advanced too much for the match to ever succeed, and if
so, quits.
That test has a comment next to it about perhaps testing for this earlier.
It also does a byte rather than chars calculation.
This commit does the following.
It adds a proper chars-based termination test near the beginning of the
'check' code block. This test is essentially free, since at that point
we've just done the necessary HOPs. It also calculates start_point using
end_point rather the strend as the limit, so avoiding a bit of unnecessary
hopping when we're about to fail anyway. It introduces the new HOPMAYBE3
macro wrapper for this purpose.
It keeps the old bytes-based test at the end in stclass, with a note that
the simple bytes calculation errs on the side of re-entering the check
block where the accurate chars-based test is now done.
David Mitchell [Sat, 15 Mar 2014 15:08:46 +0000 (15:08 +0000)]
re_intuit_start(): update stclass code comments
Document instances where its safe to use bytes verses char length
arithmetic, and generally improve some of the commentary in this block of
code.
David Mitchell [Sat, 15 Mar 2014 15:00:48 +0000 (15:00 +0000)]
re_intuit_start(): remove an obsolete assert.
I added the assert a while ago while I was refactoring this code. It's
pretty obvious now that at this point, rx_origin > strpos. (It wasn't
back then, as strpos wasn't constant).
David Mitchell [Sat, 15 Mar 2014 14:27:47 +0000 (14:27 +0000)]
re_intuit_start(): fix byte/char calculation err
On failure to find stclass in float range, it currently does:
rx_origin = check_at - start_shift;
which should instead be
rx_origin = HOP3c(check_at, - start_shift, strbeg);
The second added test is an example of when this causes a false negative.
(The first test is just the analogue without a UTF8 string, so it already
passes).
Since we actually already calculate this value earlier as part of
determining endpos in the float case, assign the result of that calc to a
local var, then just reuse it.
David Mitchell [Mon, 10 Mar 2014 17:53:48 +0000 (17:53 +0000)]
re_intuit_start(): eliminate checked_upto var
This var is supposed to record the latest place that stclass
had rejected, so if we try again, we don't start any earlier than that.
However, an assert showed that nothing in the test suite ever left
checked_upto > rx_origin on re-entry, so we could always use rx_origin
directly.
On failure, checked_upto is reset to HOPBACKc(endpos, start_shift)
where endpoint is the highest char that find_byclass() was asked to search
to. Now, I think that this is a logical error; it should have been
HOPBACKc(endpos, cl_l) or similar; i.e. just hop back the number of chars
equal to the length of the character class; using start_shift just makes
checked_upto artificially too small.
But in either case, consider the following more formal analysis (the
arithmetic below is in terms of chars).
Assume initially at least, that checked_upto <= rx_origin. The question is
whether we can ever end up with checked_upto "overtaking" rx_origin.
Where there is an anchored substring or ml_anch, we have:
endpos = r_origin + cl_l;
on failure,
checked_upto = endpos - (start_shift or cl_l)
since start_shift should be => cl_l, in either case we end up with
checked_upto <= rx_origin.
Where there is only a floating substring, we have:
endpos = r_origin - start_shift + cl_l;
on failure,
checked_upto = endpos - (start_shift or cl_l)
again, since start_shift should be => cl_l, in either case we end up with
checked_upto <= rx_origin.
Where there are no substrings, we return on failure; so the updating
checked_upto is irrelevant.
On success we return, so again the updating of checked_upto is irrelevant.
David Mitchell [Mon, 10 Mar 2014 15:48:25 +0000 (15:48 +0000)]
re_intuit_start(): fix a comment about overlap
The comment said that we don't allow the anchored and floating substrings
to overlap. This is trivially wrong, e.g.
/aa+/ has an anchored of "aa" at 0 and a float of "a at 1..inf
Fix the comment to say what the assertion actually already tests for, i.e.
that the float doesn't start before the anchored.
David Mitchell [Sat, 8 Mar 2014 17:29:43 +0000 (17:29 +0000)]
re_intuit_start(): trivial reorg of stclass code
make all the actions on success follow the actions on failure,
rather than being partly before and partly after.
No functional changes.
David Mitchell [Sat, 8 Mar 2014 14:38:56 +0000 (14:38 +0000)]
re_intuit_start(): always initialise start_shift
The start_shift variable is usually initialised to prog->check_offset_min,
except for one code path where it is left at zero. It turns out that
in that code path, the value isn't (currently) used, so is safe. However,
that may change, so unconditionally initialise it.
David Mitchell [Tue, 18 Feb 2014 10:13:54 +0000 (10:13 +0000)]
re_intuit_start(): swap BmUSEFUL + stclass blocks
Currently the code that does BmUSEFUL()--, and which and frees the
substring if the count reaches zero, comes before the stclass code. This
is problematic, because by the time the stclass code is executed, the
check substrings may have been freed. The stclass code does have some
checks for this, but they are inadequate: I managed to produce code that
segfaulted. It's also hard to test - you have to run against the same
pattern 100 times to get the BmUSEFUL() count down to zero, then on the
101st attempt, do something that both triggers the decrement/free and
fails the st class.
By moving the BmUSEFUL()-- stuff to *after* the stclass code, it removes
this issue completely.
As to how it affects the BmUSEFUL() count: I think it makes it slightly
better. Before, a substring could match at rx_origin offset 0, triggering
BmUSEFUL()--, then the stclass could fail, triggering a new substring
match at at a non-zero offset, and thus doing BmUSEFUL()++. The overall
affect being neutral. Now, the overall effect is BmUSEFUL += 1, which
better reflects the fact that the substring *did* help us find a non-zero
offset.
David Mitchell [Mon, 17 Feb 2014 20:46:15 +0000 (20:46 +0000)]
re_intuit_start(): de-duplicate condition
Change
if (have_anchored && check_ix == 1) {
B;
}
if (!have_anchored) {
A;
}
C;
To:
if (have_anchored) {
if (check_ix == 1) {
B;
}
}
else {
A;
}
C;
This change should be functionally equivalent, but eliminates calculating
the have_anchored condition twice.
David Mitchell [Mon, 17 Feb 2014 20:37:13 +0000 (20:37 +0000)]
re_intuit_start(): swap two blocks, delete label
Change
if (!have_anchored) {
A;
goto hop_and_restart;
}
if (check_ix == 1) {
B;
}
hop_and_restart:
C;
To:
if (have_anchored && check_ix == 1) {
B;
}
if (!have_anchored) {
A;
}
C;
This change should be functionally equivalent, but eliminates a label.
David Mitchell [Mon, 17 Feb 2014 20:20:40 +0000 (20:20 +0000)]
re_intuit_start(): swap another if/else block
Change
{
...
if (has_anchored) {
A;
goto restart;
}
B;
goto hop_and_restart;
}
to
{
...
if (!has_anchored) {
B;
goto hop_and_restart;
}
A;
goto restart;
}
Functionally the same, but will allow simpler code shortly
David Mitchell [Mon, 17 Feb 2014 20:12:31 +0000 (20:12 +0000)]
re_intuit_start(): remove redundant assertion
assert(prog->substrs->check_ix) is within the block
if (prog->substrs->check_ix == 1)
so it's not needed any more.
David Mitchell [Mon, 17 Feb 2014 19:45:12 +0000 (19:45 +0000)]
re_intuit_start(): swap another if/else block
Change
{
if (cond)
goto x;
A;
goto y;
}
x:
into
{
if (!cond) {
A;
goto y;
}
}
x:
Functionally equivalent, but eliminates one 'goto'.
David Mitchell [Mon, 17 Feb 2014 19:39:44 +0000 (19:39 +0000)]
re_intuit_start(): swap if/else blocks
Change
{
if (cond) {
A;
goto x;
}
B;
goto y;
}
into
{
if (!cond) {
B;
goto y;
}
A;
goto x;
}
Should be functionally equivalent, but will allow for some further code
factorisation shortly.
David Mitchell [Mon, 17 Feb 2014 19:07:08 +0000 (19:07 +0000)]
re_intuit_start(): eliminate one label
Currently the code looks like:
if (rx_origin + start_shift >= check_at)
goto retry_floating_check;
....
retry_floating_check:
rx_origin = check_at - start_shift;
goto hop_and_restart;
But that conditional only kicks in when the floating substring (which was
the check substring) matched, so this condition always applies:
rx_origin + start_shift <= check_at
So the condition in the code will only ever be true when
rx_origin + start_shift == check_at
In this case, this assignment is a noop:
rx_origin = check_at - start_shift;
So skip it and jump directly to hop_and_restart. This eliminates the
retry_floating_check: label.
David Mitchell [Mon, 17 Feb 2014 18:51:48 +0000 (18:51 +0000)]
add test for a code path in intuit_start()
Nothing in the test suite currently triggers *not* taking this branch:
/* Have both, check_string is floating */
if (rx_origin + start_shift >= check_at) /* Contradicts floating=check */
So add something that does trigger it.
David Mitchell [Mon, 10 Feb 2014 19:56:08 +0000 (19:56 +0000)]
re_intuit_start(): eliminate debug-only var
'what' is only defined and assigned to in debugging builds.
Just calculate the value on the fly instead when printing debugging
output. Makes the code less messy.
David Mitchell [Mon, 10 Feb 2014 15:37:30 +0000 (15:37 +0000)]
re_intuit_start(): eliminate t from stclass code
The 't' variable now just contains a copy of rx_origin; so just use
rx_origin directly, and eliminate t.
David Mitchell [Mon, 10 Feb 2014 14:52:46 +0000 (14:52 +0000)]
re_intuit_start(): reduce use of s in stclass code
s is mainly acting as a stand-in for rx_origin; so just use rx_origin
directly.
David Mitchell [Mon, 10 Feb 2014 14:44:25 +0000 (14:44 +0000)]
re_intuit_start(): remove if(check)
It this point in the stclass block, we have already confirmed that an
anchored substring exists and that the check substring is anchored.
So check cannot be null at this point. So don't test for it being null.
David Mitchell [Mon, 10 Feb 2014 13:28:25 +0000 (13:28 +0000)]
re_intuit_start(): use check_ix for efficiency
David Mitchell [Mon, 10 Feb 2014 13:23:07 +0000 (13:23 +0000)]
re_intuit_start(): stclass: use rx_origin more
In the stclass code block, we do
s = rx_origin;
... stuff reading the value of s ...
s = find_byclass(...);
change that to
... stuff reading the value of rx_origin ...
s = find_byclass(...);
Nicholas Clark [Sun, 16 Mar 2014 15:18:09 +0000 (16:18 +0100)]
On OS X, allow Configure to override $ld with -Dld=...
Since it was added, hints/darwin.sh had been ignoring any user configuration
options and unconditionally setting ld='cc'. Instead, it should take a user
supplied value if one is given, otherwise defaulting to 'cc'.
The strange thing is that this was never noticed when commits
cb3fc4263509f28c
and
69625aa92a91bf4c (May 2003) which added code which was intended offer
alternative behaviour if ld contained MACOSX_DEVELOPMENT_TARGET.
H.Merijn Brand [Sun, 16 Mar 2014 08:59:44 +0000 (09:59 +0100)]
Configure misdetects strlcpy et al. with gcc -flto (RT#113022)
Aaron Crane [Sat, 15 Mar 2014 16:35:56 +0000 (16:35 +0000)]
Update perldelta for core changes to this point
This doesn't include module version updates.
Karl Williamson [Fri, 14 Mar 2014 20:51:50 +0000 (14:51 -0600)]
White-space only; properly indent newly formed blocks
The previous commit added braces forming blocks. This indents the
contents of those blocks.
Karl Williamson [Fri, 14 Mar 2014 20:23:21 +0000 (14:23 -0600)]
mktables: Inline short tables
mktables generates tables of Unicode properties. These are stored in
files to be loaded on-demand. This is because the memory cost of having
all of them loaded would be excessive, and many are rarely used. Hashes
are created in Heavy.pl which is read in by utf8_heavy.pl map the
Unicode property name to the file which contains its definition.
It turns out that nearly half of current Unicode properties are just a
single consecutive ranges of code points, and their definitions are
representable almost as compactly as the name of the files that contain
them.
This commit changes mktables so that the tables for single-range
properties are not written out to disk, but instead a special syntax is
used in Heavy.pl to indicate this and what their definitions are.
This does not increase the memory usage of Heavy.pl appreciably, as the
definitions replace the file names that are already there, but it lowers
the number of files generated by mktables from 908 (in Unicode 6.3) to
507. These files are probably each a disk block, so the disk savings is
not large. But it means that reading in any of these properties is much
faster, as once utf8_heavy gets loaded, no further disk access is needed
to get any of these properties. Most of these properties are obscure,
but not all. The Line and Paragraph separators, for example, are quite
commonly used.
Further, utf8_heavy.pl caches the files it has read in into hashes.
This is not necessary for these, as they are already in memory, so the
total memory usage goes down if a program uses any of these, but again,
since these are small, that amount is not large.. The major gain is not
having to read these files from disk at run time.
Tables that match no code points at all are also represented using this
mechanimsm. Previously, they were expressed as the complements of
\p{All}, which matches everything possible.
Karl Williamson [Wed, 12 Mar 2014 19:06:49 +0000 (13:06 -0600)]
lib/locale.t: Update $variable name
As of commit
b057411ddb1a3d8b6ab062d667c8e39f80cd7343, the meaning of
the variable is extended to beyond just being about 'folding', so change
the name to correspond.
Karl Williamson [Wed, 12 Mar 2014 19:03:22 +0000 (13:03 -0600)]
PATCH: [perl #121340] lib/locale.t noisy+complaining but passes on Win32
It turns out that these messages were not printed as one would expect
under TAP, but were output using warn().
Karl Williamson [Wed, 12 Mar 2014 18:54:45 +0000 (12:54 -0600)]
lib/locale.t: Fix broken test
The test that [:digit:] is a subset of [:xdigit:] failed in locales
where [:digit:] matches 2 blocks of 10 digits, but the second block
isn't considered part of [:xdigit:]. This happens in Thai on Windows.
The POSIX standard http://pubs.opengroup.org/onlinepubs/
9699919799/
does not use very clear language, but I'm taking it as meaning it is ok
for this to happen, so this revises the test to accept it.
Chris 'BinGOs' Williams [Thu, 13 Mar 2014 16:40:50 +0000 (16:40 +0000)]
Update ExtUtils-MakeMaker to CPAN version 6.92
[DELTA]
6.92 Thu Mar 13 16:18:32 GMT 2014
No changes from 6.91_01
6.91_01 Thu Mar 6 13:48:22 GMT 2014
Test fixes:
* Make meta tests more robust to changes in CPAN::Meta
Jerry D. Hedden [Tue, 11 Mar 2014 19:31:24 +0000 (15:31 -0400)]
Upgrade to Thread::Queue 3.04
Karl Williamson [Wed, 12 Mar 2014 20:11:58 +0000 (14:11 -0600)]
regcomp.c: Don't read past string-end
In doing an audit of regcomp.c, and experimenting using
Encode::_utf8_on(), I found this one instance of a regen/regcharclass.pl
macro that could read beyond the end of the string if given malformed
UTF-8. Hence we convert to use the 'safe' form. There are no other
uses of the non-safe version, so don't need to generate them.
David Mitchell [Wed, 12 Mar 2014 19:14:13 +0000 (19:14 +0000)]
sprinkle LIKELY() on pp_hot.c scope.c and some *.h
I've gone through pp_hot.c and scope.c and added LIKELY() or UNLIKELY()
to all conditionals where I understand the code well enough to know that
a particular branch is or isn't likely to be taken very often.
I also processed some of the .h files which contain commonly used macros.
Karl Williamson [Wed, 12 Mar 2014 19:15:44 +0000 (13:15 -0600)]
regcomp.c: Make SSC node clone safe
This just sets the ptr field in the Synthetic Start Class that will be
passed to regexec.c NULL, and clarifies the comments in regcomp.h. See
the thread starting at http://markmail.org/message/2txwaqnjco6zodeo
Karl Williamson [Tue, 11 Mar 2014 21:58:54 +0000 (15:58 -0600)]
regen/regcharclass.pl: Don't generate unused macros
Having these unused macros around just clutters up the header file
Karl Williamson [Tue, 11 Mar 2014 21:47:53 +0000 (15:47 -0600)]
regen/regcharclass.pl: Generate correct macro instead of skipping
It makes no sense to check for length safeness for The macros generated
by this program which take a single UV code point as a parameter. Prior
to this patch, it would skip trying to generate them if asked. But,
because of the way things are structured, that means that if you need
just this and the safe versions, you can't do it so easily. What this
commit does is generate the cp macro if requested even if the 'safe'
version of other macros are also requested.
Chris 'BinGOs' Williams [Wed, 12 Mar 2014 12:21:04 +0000 (12:21 +0000)]
Update ExtUtils-Install Changes file
Chris 'BinGOs' Williams [Wed, 12 Mar 2014 11:55:48 +0000 (11:55 +0000)]
Make the ExtUtils-Install tests parallelisable
H.Merijn Brand [Wed, 12 Mar 2014 10:00:00 +0000 (11:00 +0100)]
Backport/genererate work from cross-port
At the "Perl5 and beyond" hackathon early feb 2014 in Amsterdam, hugmeir
and I walked through all the changes and ended up with a serious warning
in metalint where we stopped. The warning proved to be a bug in metalint
that will be fixed in the future and has a rather easy workaround.
Porting/Glossary is not yet being generated correctly. Will take care of
that later.
Aristotle Pagaltzis [Tue, 11 Mar 2014 12:58:19 +0000 (13:58 +0100)]
perlfunc: layout getpw*&c return values as a table
Aristotle Pagaltzis [Tue, 11 Mar 2014 00:57:19 +0000 (01:57 +0100)]
perldiag: Clarify that lexicals do not trigger "used only once"
Chris 'BinGOs' Williams [Mon, 10 Mar 2014 15:25:22 +0000 (15:25 +0000)]
ExtUtils-Install-1.62 has been released to CPAN
Daniel Dragan [Mon, 10 Mar 2014 14:03:09 +0000 (14:03 +0000)]
remove a redundant SvTIED_mg from S_do_smartmatch
A non tied HV potentially could be checked twice for being tied. Move
HvUSEDKEYS part to avoid checking var tied twice. The redundant tied check
comes from day 1 of smart match in commit
0d863452f5 . IDK why HV sides
are swapped, but comment it.
Daniel Dragan [Mon, 10 Mar 2014 12:29:56 +0000 (12:29 +0000)]
don't repeatedly call HvUSEDKEYS
HvUSEDKEYS contains a function call nowadays. Don't call it repeatedly.
Craig A. Berry [Sun, 9 Mar 2014 00:35:49 +0000 (18:35 -0600)]
Handle "no versions" feature in fileify and tovmsspec.
This is a follow-up to
d5e61aaf9d7051b136, where we stopped
escaping semicolons in tovmsspec when they appeared to be the
beginning of a version specification but always escaped them
otherwise.
It turns out there is yet another CRTL feature logical name
(DECC$FILENAME_UNIX_NO_VERSION) that tells us a Unix-format
specification is not allowed to have a version number, so in
that case, always escape the semicolon since it can't be the
start of a version specification.
Also, don't add the version number when fileifying directory
specs if this "no versions" feature is in effect.
Chris 'BinGOs' Williams [Mon, 10 Mar 2014 11:55:45 +0000 (11:55 +0000)]
Don't rely on IPC::Cmd in ExtUtils-Install tests
Paul Johnson [Mon, 10 Mar 2014 07:31:32 +0000 (08:31 +0100)]
It is and always will be safe to delete the most recent key returned from each.
Chris 'BinGOs' Williams [Sat, 8 Mar 2014 13:45:29 +0000 (13:45 +0000)]
Incorporate changes from CPAN release of ExtUtils-CBuilder
Jerry D. Hedden [Thu, 6 Mar 2014 20:56:39 +0000 (15:56 -0500)]
Upgrade to Thread::Queue 3.03
David Mitchell [Fri, 7 Mar 2014 17:45:27 +0000 (17:45 +0000)]
make core safe against HvAUX() realloc
Since the HvAUX structure is just tacked onto the end of the HvARRAY()
struct, code like this can do bad things:
aux = HvAUX();
... something that might split hv ...
aux->foo = ...; /* SEGV! */
So I've visually audited core for places where HbAUX() is saved and then
re-used, and re-initialised the var if it looks like HvARRAY() could
have changed in the meantime.
I've been very conservative about what might be unsafe. For example,
destructors or __WARN__ handlers could call perl code that modifies the
hash.
David Mitchell [Fri, 7 Mar 2014 17:13:07 +0000 (17:13 +0000)]
sv.h: add some more flag usage commentary
Also, move SVphv_SHAREKEYS up to be closer to SVf_UTF8 - they are the same
flag bit, but it wasn't clear, since there was a big gap between them
Steffen Mueller [Fri, 7 Mar 2014 08:02:53 +0000 (09:02 +0100)]
Data::Dumper update/changelog and version bump
Steffen Mueller [Fri, 7 Mar 2014 07:44:06 +0000 (08:44 +0100)]
Filter::Simple update/changelog and version bump
Steffen Mueller [Fri, 7 Mar 2014 07:33:47 +0000 (08:33 +0100)]
Attribute::Handlers update/changelog and version bump
Craig A. Berry [Fri, 7 Mar 2014 00:39:18 +0000 (18:39 -0600)]
Smarter handling of escaped semicolons in vmsify.
In theory, a Unix-format filespec can contain a semicolon and thus
need to be escaped when converted to a VMS-format filespec. But
a much more common use case is a filespec that has a version
number despite being in Unix format.
So detect a semicolon that delimits a version specification and
pass it through but escape other semicolons. This is apparently
what decc$to_vms does, so we're being consistent with the CRTL.