CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 27 Jul 2025 04:01:38 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20141109041110
location: https://web.archive.org/web/20141109041110/https://perl5.git.perl.org/perl.git/log
server-timing: captures_list;dur=0.702275, exclusion.robots;dur=0.024496, exclusion.robots.policy;dur=0.010272, esindex;dur=0.012303, cdx.remote;dur=15.900386, LoadShardBlock;dur=265.302418, PetaboxLoader3.datanode;dur=144.486936, PetaboxLoader3.resolve;dur=89.459484
x-app-server: wwwb-app203
x-ts: 302
x-tr: 317
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app203; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 27 Jul 2025 04:01:39 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Sun, 09 Nov 2014 04:11:09 GMT
x-archive-orig-server: Apache/2.2.15 (CentOS)
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 09 Nov 2014 04:11:10 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 25 Dec 2008 07:04:25 GMT", ; rel="prev memento"; datetime="Tue, 12 Jan 2010 22:44:31 GMT", ; rel="memento"; datetime="Sun, 09 Nov 2014 04:11:10 GMT", ; rel="next memento"; datetime="Wed, 17 Dec 2014 17:28:21 GMT", ; rel="last memento"; datetime="Tue, 01 Aug 2017 20:37:22 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: alexa20141109-19/51_43_20141109041034_crawl102.arc.gz
server-timing: captures_list;dur=0.720661, exclusion.robots;dur=0.026885, exclusion.robots.policy;dur=0.012252, esindex;dur=0.014924, cdx.remote;dur=44.248572, LoadShardBlock;dur=721.825732, PetaboxLoader3.datanode;dur=750.837611, load_resource;dur=132.898070, PetaboxLoader3.resolve;dur=66.142047
x-app-server: wwwb-app203
x-ts: 200
x-tr: 1092
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
perl5.git.perl.org Git - perl.git/log
op.c:scalarvoid: Remove redundant scalar(o)
op.c:ck_sassign: Simplify freeing of sassign op
Instead of detaching both the rhs and lhs and then freeing the assign-
ment and the lhs, just detach the rhs and free the assignment. This
results in smaller machine code.
Instead of detaching both the rhs and lhs and then freeing the assign-
ment and the lhs, just detach the rhs and free the assignment. This
results in smaller machine code.
Don’t use OP_SIBLING(o) in op.c:ck_sassign
When this is called, the op is not part of a larger tree yet, so its
sibling is always NULL.
When this is called, the op is not part of a larger tree yet, so its
sibling is always NULL.
Shrink PL_op_private_bitdefs
It doesn’t matter whether things in this table are ordered by opcode,
because the indices into it are stored in PL_op_private_bitdef_ix.
If we have multiple ops with exactly the same private flags, we don’t
need multiple entries in PL_op_private_bitdefs.
One practical advantage is that patches are less likely to conflict,
which will make rebasing easier. (I hope.)
It doesn’t matter whether things in this table are ordered by opcode,
because the indices into it are stored in PL_op_private_bitdef_ix.
If we have multiple ops with exactly the same private flags, we don’t
need multiple entries in PL_op_private_bitdefs.
One practical advantage is that patches are less likely to conflict,
which will make rebasing easier. (I hope.)
[Merge] More OA_DANGEROUS stuff
The OA_DANGEROUS op type flag indicates that an op might return a
value referenced elsewhere, so list assignment should make tempor-
ary copies.
Some ops had this flag needlessly. Some lacked it erroneously,
resulting in bugs.
The OA_DANGEROUS op type flag indicates that an op might return a
value referenced elsewhere, so list assignment should make tempor-
ary copies.
Some ops had this flag needlessly. Some lacked it erroneously,
resulting in bugs.
values and each are OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
values and each can both return scalars that are referenced elsewhere,
causing list assignment to behave erratically if temporary copies
are not made.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
values and each can both return scalars that are referenced elsewhere,
causing list assignment to behave erratically if temporary copies
are not made.
smartkve.t doesn’t need to disable dep warnings
kill is not OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
kill only ever returns a target unused elsewhere, so it does not
necessitate temp copies in list assignment.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
kill only ever returns a target unused elsewhere, so it does not
necessitate temp copies in list assignment.
exec is not OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
When exec fails, it only ever returns a target unused elsewhere, so it
does not necessitate temp copies in list assignment.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
When exec fails, it only ever returns a target unused elsewhere, so it
does not necessitate temp copies in list assignment.
enterwrite is not OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
‘write’ only ever returns a read-only true or false, so temp copies
are not necessary for its sake.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
‘write’ only ever returns a read-only true or false, so temp copies
are not necessary for its sake.
Fix ext/B/t tests after OA_DANGEROUS removals
tied is OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
tied returns the same scalar that the tied variables uses to hold a
reference to the object (so weaken(tied(...)) works). tie uses the
very scalar that TIESCALAR (or TIEWHATEVER) returns and attaches it to
the tied variable by magic. That returned scalar could be referenced
elsewhere. That means
($a, $b) = ($c, tied $d)
could have common vars on either side, if the tie constructor for $d
happened to return $a or $b. (Normally it would have to be an XSUB or
an lvalue sub for its return value not to have been copied.)
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
tied returns the same scalar that the tied variables uses to hold a
reference to the object (so weaken(tied(...)) works). tie uses the
very scalar that TIESCALAR (or TIEWHATEVER) returns and attaches it to
the tied variable by magic. That returned scalar could be referenced
elsewhere. That means
($a, $b) = ($c, tied $d)
could have common vars on either side, if the tie constructor for $d
happened to return $a or $b. (Normally it would have to be an XSUB or
an lvalue sub for its return value not to have been copied.)
Remove OA_DANGEROUS from exit
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
exit usually doesn’t return. When it fails, it returns a read-only
undef, so we don’t need temp copies for its sake.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
exit usually doesn’t return. When it fails, it returns a read-only
undef, so we don’t need temp copies for its sake.
Remove OA_DANGEROUS from loopctl-type ops
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
These operators never return, so they shouldn’t necessitate
temp copies.
(This could probably apply to dump, too, but I don’t fully under-
stand dump.)
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
These operators never return, so they shouldn’t necessitate
temp copies.
(This could probably apply to dump, too, but I don’t fully under-
stand dump.)
Remove OA_DANGEROUS from die
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
die never returns, so it shouldn’t necessitate temp copies.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
die never returns, so it shouldn’t necessitate temp copies.
Remove OA_DANGEROUS from cond_expr
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
?: always returns one of its arguments. Since aassign_common_vars,
which does the danger check, also checks the kids of the cond_expr op,
it is not necessary for cond_expr to be flagged this way.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
?: always returns one of its arguments. Since aassign_common_vars,
which does the danger check, also checks the kids of the cond_expr op,
it is not necessary for cond_expr to be flagged this way.
Remove OA_DANGEROUS from grep and map
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
grep returns its arguments, while map returns the results of its first
expression. Since aassign_common_vars, which does the danger check,
will also check the kids of the mapstart/grepstart ops, it is not nec-
essary for grep and map themselves to be flagged this way.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
grep returns its arguments, while map returns the results of its first
expression. Since aassign_common_vars, which does the danger check,
will also check the kids of the mapstart/grepstart ops, it is not nec-
essary for grep and map themselves to be flagged this way.
Remove OA_DANGEROUS from sort
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_sort returns its arguments. aassign_common_vars will check its kid
ops for danger as well, so it’s not necessary for sort itself to be
flagged this way. This will allow cases like ($a,$b) = sort($c,$d) to
forego the temp copy.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_sort returns its arguments. aassign_common_vars will check its kid
ops for danger as well, so it’s not necessary for sort itself to be
flagged this way. This will allow cases like ($a,$b) = sort($c,$d) to
forego the temp copy.
Don’t copy VMS hints to cop->op_private
Commit d5ec29879 in 2006 started storing all the hints in COPs. Some
VMS-specific hints have nonetheless still been copied from PL_hints to
cop->op_private, though that is no longer necessary.
Commit d5ec29879 in 2006 started storing all the hints in COPs. Some
VMS-specific hints have nonetheless still been copied from PL_hints to
cop->op_private, though that is no longer necessary.
FV_ISFINITE, not FV_ISINITE.
Remove OA_DANGEROUS from non-integer postdec/inc
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
While pp_postinc may return a lexical scalar, that only happens when
the OPpTARGET_MY optimisation is happening; and aassign_common_vars in
op.c checks specifically for that.
Otherwise, it only returns a mortal or target, so it is not
OA_DANGEROUS.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
While pp_postinc may return a lexical scalar, that only happens when
the OPpTARGET_MY optimisation is happening; and aassign_common_vars in
op.c checks specifically for that.
Otherwise, it only returns a mortal or target, so it is not
OA_DANGEROUS.
Allow OPpTARGET_MY on non-integer postdec/inc
I don’t know why this was not done to begin with. The previous two
commits fixed the only outstanding problems I am aware of.
I don’t know why this was not done to begin with. The previous two
commits fixed the only outstanding problems I am aware of.
Make pp_postinc call set-magic on its target
Its target may be a lexical scalar (under ‘use integer’ currently, and
soon even outside of ‘use integer’). The assignment in $lex = $foo++
currently gets optimised away and ++ writes directly to $lex.
Its target may be a lexical scalar (under ‘use integer’ currently, and
soon even outside of ‘use integer’). The assignment in $lex = $foo++
currently gets optimised away and ++ writes directly to $lex.
Fix $lex = $ref++ under use integer
Operators generally have targets, that is, scalars in the pad that are
used to return values. The same scalar is used again and again for
efficiency.
If the value assigned to a target is a reference, that can be bad,
because the referent will last longer than expected, even forever.
$ref++ used to have this problem (bug #9466).
So commit v5.13.4-148-g7dcb9b9 fixed it by returning a new mortal if
the return value was a reference.
However, under ‘use integer’, the OPpTARGET_MY optimisation is per-
mitted on postdec and postinc (why only under ‘use integer’ I don’t
know). Under that optimisation, $lexicalvariable = <some op> has the
assignment optimised away and the lexical variable becomes the operat-
or’s target.
If we skip assigning to the target and it is a lexical variable, then
the assignment never happens:
$ perl5.14.4 -le 'my $x=7; $_={}; $x = $_++; print $x'
HASH(0x7ff4a8806d00)
$ perl5.14.4 -Minteger -le 'my $x=7; $_={}; $x = $_++; print $x'
7
Operators generally have targets, that is, scalars in the pad that are
used to return values. The same scalar is used again and again for
efficiency.
If the value assigned to a target is a reference, that can be bad,
because the referent will last longer than expected, even forever.
$ref++ used to have this problem (bug #9466).
So commit v5.13.4-148-g7dcb9b9 fixed it by returning a new mortal if
the return value was a reference.
However, under ‘use integer’, the OPpTARGET_MY optimisation is per-
mitted on postdec and postinc (why only under ‘use integer’ I don’t
know). Under that optimisation, $lexicalvariable = <some op> has the
assignment optimised away and the lexical variable becomes the operat-
or’s target.
If we skip assigning to the target and it is a lexical variable, then
the assignment never happens:
$ perl5.14.4 -le 'my $x=7; $_={}; $x = $_++; print $x'
HASH(0x7ff4a8806d00)
$ perl5.14.4 -Minteger -le 'my $x=7; $_={}; $x = $_++; print $x'
7
Using bignum needs skip_if_miniperl().
skip_all, not skip, if only miniperl.
Wrong (non-existent) Config var name.
Fix one test message, add two tests.
undef the temp variables between tests.
This way a failing result doesn't carry over between subtests.
This way a failing result doesn't carry over between subtests.
Perl_isfinitel is not necessarily always there.
Drop uselongdouble unless it really gives longer doubles.
Remove OA_DANGEROUS from subst(cont)
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_subst and pp_substcont only push new mortal scalars or read-only
values on to the stack. Hence they are not OA_DANGEROUS.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_subst and pp_substcont only push new mortal scalars or read-only
values on to the stack. Hence they are not OA_DANGEROUS.
Remove OA_DANGEROUS from match
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_match pushes new mortals on to the stack in list context (or a
read-only boolean; read-only values don’t matter), so they can’t
occur elsewhere. Hence it is not OA_DANGEROUS.
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
pp_match pushes new mortals on to the stack in list context (or a
read-only boolean; read-only values don’t matter), so they can’t
occur elsewhere. Hence it is not OA_DANGEROUS.
Fix up f_map.t following "\L$_" optimisation
Make B constants depend on perl headers
Making the Makefile depend on the headers where the constants are
found will force Makefile.PL to be re-run, and it is Makefile.PL that
generates the constants.
Making the Makefile depend on the headers where the constants are
found will force Makefile.PL to be re-run, and it is Makefile.PL that
generates the constants.
Optimise stringify away for "\Q$_" "\u$_" etc.
Allow OPpTARGET_MY optimisation for split
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This is safe to extend to split. split only uses its target in this
code at the end:
GETTARGET;
PUSHi(iters);
so there is no danger of modifying its argument before reading it.
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This is safe to extend to split. split only uses its target in this
code at the end:
GETTARGET;
PUSHi(iters);
so there is no danger of modifying its argument before reading it.
Fix Deparse OPpLVAL_INTRO handling in lists
The renumbering of private flags a few commits ago caused an exist-
ing Deparse bug to occur more often. It was assuming that the
OPpLVAL_INTRO and OPpOUR_INTRO flags could occur on any ops for which
it did not have explicit exceptions.
This commit changes it to check for only those ops known to use those
flags, thus fixing bug #119815.
The renumbering of private flags a few commits ago caused an exist-
ing Deparse bug to occur more often. It was assuming that the
OPpLVAL_INTRO and OPpOUR_INTRO flags could occur on any ops for which
it did not have explicit exceptions.
This commit changes it to check for only those ops known to use those
flags, thus fixing bug #119815.
Renumber op flags so TARGET_MY and OUR_INTRO differ
I need split to be able to take both flags. Renumbering OUR_INTRO
sets off a chain reaction requiring that various other flags be renum-
bered. These are the affected ops:
gvsv rv2sv rv2av rv2hv enteriter split rv2gv padsv aelem helem entersub padav padhv lvavref lvref refassign pushmark rv2cv
----------------------------------------------------------------------------------------------------------------------------------
0 inargs
1 strct strct strct strct strct strct
2 slicw silcw reversed noinit targ slicw slicw elem elem targ
3 lvsub lvsub def lvsub lvsub lvsub amper lvsub lvsub iter iter amper
4 our our our our our our fake state defer defer dbg state state state state state state dbg
5-6 dref bool dref dref dref dref dref bool type type const(6)
7 intro intro intro intro intro implim intro intro intro intro intro intro intro intro intro intro intro nopar
If we use 6 for OUR_INTRO and shift 5-6 down to 4-5, that frees up 4
(aka OPpTARGET_MY) for use on split.
op.c:scalarvoid was testing the OPpOUR_INTRO flag on ops that don’t
take it, so it needed adjustment.
I need split to be able to take both flags. Renumbering OUR_INTRO
sets off a chain reaction requiring that various other flags be renum-
bered. These are the affected ops:
gvsv rv2sv rv2av rv2hv enteriter split rv2gv padsv aelem helem entersub padav padhv lvavref lvref refassign pushmark rv2cv
----------------------------------------------------------------------------------------------------------------------------------
0 inargs
1 strct strct strct strct strct strct
2 slicw silcw reversed noinit targ slicw slicw elem elem targ
3 lvsub lvsub def lvsub lvsub lvsub amper lvsub lvsub iter iter amper
4 our our our our our our fake state defer defer dbg state state state state state state dbg
5-6 dref bool dref dref dref dref dref bool type type const(6)
7 intro intro intro intro intro implim intro intro intro intro intro intro intro intro intro intro intro nopar
If we use 6 for OUR_INTRO and shift 5-6 down to 4-5, that frees up 4
(aka OPpTARGET_MY) for use on split.
op.c:scalarvoid was testing the OPpOUR_INTRO flag on ops that don’t
take it, so it needed adjustment.
op_private: Remove incorrect OPpLVREF_TYPE comment
At the time, I was trying to rearrange the magic flags so that
OPpLVREF_TYPE could be copied into mg->mg_flags for lvref magic. Then
I saw that mg_private was available and gave up on the whole idea; but
this comment remained.
At the time, I was trying to rearrange the magic flags so that
OPpLVREF_TYPE could be copied into mg->mg_flags for lvref magic. Then
I saw that mg_private was available and gave up on the whole idea; but
this comment remained.
optimize Perl_boot_core_UNIVERSAL and Perl_nextargv
Perl_nextargv fuse 2 tests into 1
Perl_boot_core_UNIVERSAL reorder instructions to avoid using a non-vol
registers (save cv across the Safefree), not reread CV body * after
Safefree. Compute address of CvFILE once.
for Perl_boot_core_UNIVERSAL on VC 2003 before 0x66 bytes of 32 bit x86
machine code, after 0x61.
Perl_nextargv fuse 2 tests into 1
Perl_boot_core_UNIVERSAL reorder instructions to avoid using a non-vol
registers (save cv across the Safefree), not reread CV body * after
Safefree. Compute address of CvFILE once.
for Perl_boot_core_UNIVERSAL on VC 2003 before 0x66 bytes of 32 bit x86
machine code, after 0x61.
add xs_handshake API
This API elevates the amount of ABI compatibility protection between XS
modules and the interp. It also makes each boot XSUB smaller in machine
code by removing function calls and factoring out code into the new
Perl_xs_handshake and Perl_xs_epilog functions.
sv.c :
- revise padlist duping code to reduce code bloat/asserts on DEBUGGING
ext/DynaLoader/dlutils.c :
- disable version checking so interp startup is faster, ABI mismatches are
impossible because DynaLoader is never available as a shared library
ext/XS-APItest/XSUB-redefined-macros.xs :
- "" means dont check the version, so switch to " " to make the test in
xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION
is CPP defined but "", mow what?"
ext/re/re.xs :
- disable API version checking until #123007 is resolved
ParseXS/Utilities.pm :
109-standard_XS_defs.t :
- remove context from S_croak_xs_usage similar to core commit cb077ed296 .
CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and
by then core's croak_xs_uage API has been long available and this
backport doesn't need to account for newer perls
- fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
This API elevates the amount of ABI compatibility protection between XS
modules and the interp. It also makes each boot XSUB smaller in machine
code by removing function calls and factoring out code into the new
Perl_xs_handshake and Perl_xs_epilog functions.
sv.c :
- revise padlist duping code to reduce code bloat/asserts on DEBUGGING
ext/DynaLoader/dlutils.c :
- disable version checking so interp startup is faster, ABI mismatches are
impossible because DynaLoader is never available as a shared library
ext/XS-APItest/XSUB-redefined-macros.xs :
- "" means dont check the version, so switch to " " to make the test in
xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION
is CPP defined but "", mow what?"
ext/re/re.xs :
- disable API version checking until #123007 is resolved
ParseXS/Utilities.pm :
109-standard_XS_defs.t :
- remove context from S_croak_xs_usage similar to core commit cb077ed296 .
CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and
by then core's croak_xs_uage API has been long available and this
backport doesn't need to account for newer perls
- fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
Update B::Deparse for last two commits
Allow OPpTARGET_MY optimisation for x
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This can be extended to x. Despite what the comment in op_private
says, list return values do not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in scalar context. And
the scalar code paths use TARG and push TARG on to the stack.
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This can be extended to x. Despite what the comment in op_private
says, list return values do not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in scalar context. And
the scalar code paths use TARG and push TARG on to the stack.
Allow OPpTARGET_MY optimisation for vec
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This can be extended to vec(). Despite what the comment in op_pri-
vate says, lvalue usage does not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in rvalue context. And
the rvalue code paths use TARG and push TARG on to the stack.
Many operators have a special SV allocated in the pad which is used
for return values (the target). If we make that pad offset point to
a lexical variable, then we can optimise, say, $lexical = "$foo" into
just "$foo", where $lexical is stringify’s ‘target’. And pp_stringify
doesn’t need to know any better. We already do that for many ops.
This can be extended to vec(). Despite what the comment in op_pri-
vate says, lvalue usage does not matter here, because the OPpTARGET_MY
optimisation only happens when the operator is in rvalue context. And
the rvalue code paths use TARG and push TARG on to the stack.
remove obsolete PL_apiversion
Commit 0e42d607f5 made PL_apiversion unused. Remove it to save memory in
interp struct.
Commit 0e42d607f5 made PL_apiversion unused. Remove it to save memory in
interp struct.
remove cargo culted redundant PL_perldb test
Inseperable changes commit 8490252049 and specifically ML post
"Perldb rehaul" by Ilya Zakharevich added a completely redundant
"if(PL_perldb)" test. This was probably cargo culted from the code prior
to that patch where PL_perldb was a (I think) a bool. Neither GCC 4.6.3
nor VC 2003 optimized away the test. Before this patch, .text section in
perl521.dll compiled with VC 2003 was 0xc62d3 bytes of machine code long,
after 0xc6203.
Inseperable changes commit 8490252049 and specifically ML post
"Perldb rehaul" by Ilya Zakharevich added a completely redundant
"if(PL_perldb)" test. This was probably cargo culted from the code prior
to that patch where PL_perldb was a (I think) a bool. Neither GCC 4.6.3
nor VC 2003 optimized away the test. Before this patch, .text section in
perl521.dll compiled with VC 2003 was 0xc62d3 bytes of machine code long,
after 0xc6203.
Update Test-Harness to CPAN version 3.34
[DELTA]
3.34 2014-11-02
- Enable printing CPU times spent per test (Jarkko Hietaniemi)
[DELTA]
3.34 2014-11-02
- Enable printing CPU times spent per test (Jarkko Hietaniemi)
Update Test-Simple to CPAN version 1.001009
Update Encode to CPAN version 2.64
[DELTA]
$Revision: 2.64 $ $Date: 2014/10/29 15:37:54 $
! t/utf8warnings.t MANIFEST
Retouch pull #26 so it works with perl < 5.14
! Encode.pm
+ t/utf8warnings.t
Pulled: Catch and re-issue utf8 warnings at a higher level
https://github.com/dankogai/p5-encode/pull/26
+ Encode.xs
Pulled: Validate continuations in the incremental UTF-X decoder
https://github.com/dankogai/p5-encode/pull/25
[DELTA]
$Revision: 2.64 $ $Date: 2014/10/29 15:37:54 $
! t/utf8warnings.t MANIFEST
Retouch pull #26 so it works with perl < 5.14
! Encode.pm
+ t/utf8warnings.t
Pulled: Catch and re-issue utf8 warnings at a higher level
https://github.com/dankogai/p5-encode/pull/26
+ Encode.xs
Pulled: Validate continuations in the incremental UTF-X decoder
https://github.com/dankogai/p5-encode/pull/25
Revert "t/TEST: move our @found out to its real scope"
This reverts commit 448bc2e91e255b2610f23d9fe8092c9143dac28e.
This reverts commit 448bc2e91e255b2610f23d9fe8092c9143dac28e.
Revert "t/TEST: $failure doesnt need to use defined"
This reverts commit 861a58daef615e7ade791b887911ef3caba8c539.
This reverts commit 861a58daef615e7ade791b887911ef3caba8c539.
Revert "t/TEST: add a common timestamp"
This reverts commit 3c8571535150a64cf1163a15106d0f9e57fdd6a7.
This reverts commit 3c8571535150a64cf1163a15106d0f9e57fdd6a7.
Revert "t/TEST: comment some of the <$results> loop vars"
This reverts commit 861aa4195fddf02db2d2d1412c83a273daae9f05.
This reverts commit 861aa4195fddf02db2d2d1412c83a273daae9f05.
Revert "t/TEST: move do_nothing test after option-handling code"
This reverts commit 922487b2e3c980db625829f57958aac6a3e33552.
This reverts commit 922487b2e3c980db625829f57958aac6a3e33552.
Revert "t/TEST: add -lxperf option to run tests under linux's perf stat"
This reverts commit 02a483e9608abd0f822d7c8ec6d64c07c4689e55.
This reverts commit 02a483e9608abd0f822d7c8ec6d64c07c4689e55.
Revert "t/TEST: simplify <$results> processing loop. - TAP13.1+"
This reverts commit b8059a1db50cef0ea798275144b6d2f54a288946.
This reverts commit b8059a1db50cef0ea798275144b6d2f54a288946.
Revert "t/TEST: change timings Storable key: perf -> times, a better description"
This reverts commit ba369d6f39f2f98f9e999dc978baeba4d4efba25.
This reverts commit ba369d6f39f2f98f9e999dc978baeba4d4efba25.
Revert "t/TEST: suppress 2 uninitialized envars under make test.valgrind"
This reverts commit e28ec392de528ba135a100709ce789a168286f86.
This reverts commit e28ec392de528ba135a100709ce789a168286f86.
Revert "t/TEST: RFC start to separate out valgrind test support."
This reverts commit 08ac0af6a0260a3939c4904c299200adee71010d.
This reverts commit 08ac0af6a0260a3939c4904c299200adee71010d.
Deparse Devel::Peek::Dump
I’m not sure how or where to test this. Maybe we should document this
‘accidental’ plug-in interface for B::Deparse and custom ops.
I’m not sure how or where to test this. Maybe we should document this
‘accidental’ plug-in interface for B::Deparse and custom ops.
Better B::Deparse warning for custom ops
Update B::Deparse docs about BEGIN blocks
Spell optimise consistently in Deparse pod
also add a missing hyphen.
also add a missing hyphen.
Mention Data::Dump::Streamer in B::Deparse docs
[perl #77452] Deparse BEGIN blocks in the right place
In the op tree, a statement consists of a nextstate/dbstate op (of
class cop) followed by the contents of the statement. This cop is
created after the statement has been parsed. So if you have nested
statements, the outermost statement has the highest sequence number
(cop_seq). Every sub (including BEGIN blocks) has a sequence number
indicating where it occurs in its containing sub.
So
BEGIN { } #1
# seq 2
{
# seq 1
...
}
is indistinguishable from
# seq 2
{
BEGIN { } #1
# seq 1
...
}
because the sequence number of the BEGIN block is 1 in both examples.
By reserving a sequence number at the start of every block and using
it once the block has finished parsing, we can do this:
BEGIN { } #1
# seq 1
{
# seq 2
...
}
# seq 1
{
BEGIN { } #2
# seq 2
...
}
and now B::Deparse can tell where to put the blocks.
PL_compiling.cop_seq was unused, so this is where I am stashing
the pending sequence number.
In the op tree, a statement consists of a nextstate/dbstate op (of
class cop) followed by the contents of the statement. This cop is
created after the statement has been parsed. So if you have nested
statements, the outermost statement has the highest sequence number
(cop_seq). Every sub (including BEGIN blocks) has a sequence number
indicating where it occurs in its containing sub.
So
BEGIN { } #1
# seq 2
{
# seq 1
...
}
is indistinguishable from
# seq 2
{
BEGIN { } #1
# seq 1
...
}
because the sequence number of the BEGIN block is 1 in both examples.
By reserving a sequence number at the start of every block and using
it once the block has finished parsing, we can do this:
BEGIN { } #1
# seq 1
{
# seq 2
...
}
# seq 1
{
BEGIN { } #2
# seq 2
...
}
and now B::Deparse can tell where to put the blocks.
PL_compiling.cop_seq was unused, so this is where I am stashing
the pending sequence number.
Increase $B::Concise::VERSION to 0.995
Adjust Peek.t for SEQ dumping
dump.c: Use same code for cops and ex-cops
This also allows ex-dbstate ops to have their cop fields dumped, which
was not the case before.
This also allows ex-dbstate ops to have their cop fields dumped, which
was not the case before.
dump.c: Dump seq field of nextstate ops
This is very useful for debugging.
This is very useful for debugging.
Remove Mac Classic code from B::Concise
Fix perldiag typo
spotted by Lukas Mai.
spotted by Lukas Mai.
perldiag: rewrap an entry for better splain output
sort perldiag
simplify Perl_xs_apiversion_bootcheck
We control both strings. Perl API versions are not old decimal or alphas
versions. Maints dont increase Perl API ver. Just do a memcmp. Faster and
less machine code. Before 0xA6 bytes of machine code on VC 2003 32b,
after 0x35. This patch is related to [perl #123136].
We control both strings. Perl API versions are not old decimal or alphas
versions. Maints dont increase Perl API ver. Just do a memcmp. Faster and
less machine code. Before 0xA6 bytes of machine code on VC 2003 32b,
after 0x35. This patch is related to [perl #123136].
[perl #108276] re-indent the loop body
move the closing ) out of the #ifdef USE_ITHREADS to avoid confusing tools
emacs, in my case
emacs, in my case
[perl #108276] avoid deep scalarvoid() self-recursion
This fixes the original test case from the ticket.
It may be possible for code that alternates recursion between
scalarvoid() and scalar() to cause deep recursion, but I haven't seen
an example that does it.
This doesn't indent the scalarvoid() loop, which will be done in another
change.
This fixes the original test case from the ticket.
It may be possible for code that alternates recursion between
scalarvoid() and scalar() to cause deep recursion, but I haven't seen
an example that does it.
This doesn't indent the scalarvoid() loop, which will be done in another
change.
manisort
t/TEST: RFC start to separate out valgrind test support.
This patch creates an empty t/TestValgrind.pm file, and requires it
from t/TEST when ENV{PERL_VALGRIND} is set. As such its seeks to
reinterpret the comments at the top of t/TEST.
I propose that the "no require allowed" rule appply to code reached
from "make test" without options.
Code used only for special case testing, like "make test.valgrind", or
with options passed in via $ENV{TEST_OPTS}, need not be constrained
like this.
A broken require is not something seen until the statement is executed
and throws an error. There is nothing special about require at
parse-time that must be avoided, unless we're more than typically
paranoid.
make test.valgrind
/bin/sh -e ./runtests choose
./perl TEST
sh -c valgrind --log-fd=3 --suppressions=perl.supp --leak-check=yes --leak-resolution=high --show-reachable=yes --num-callers=50 --track-origins=yes ./perl -I.. -MTestInit porting/podcheck.t 3>podcheck.t.valgrind-current
valgrind --log-fd=3 --suppressions=perl.supp --leak-check=yes --leak-resolution=high --show-reachable=yes --num-callers=50 --track-origins=yes ./perl -I.. -MTestInit porting/podcheck.t
If this argument is accepted, it looks simple to move the VALGRIND
related code blocks into new subroutines in the now-empty
TestValgrind.pm file, and call them appropriately.
This patch creates an empty t/TestValgrind.pm file, and requires it
from t/TEST when ENV{PERL_VALGRIND} is set. As such its seeks to
reinterpret the comments at the top of t/TEST.
I propose that the "no require allowed" rule appply to code reached
from "make test" without options.
Code used only for special case testing, like "make test.valgrind", or
with options passed in via $ENV{TEST_OPTS}, need not be constrained
like this.
A broken require is not something seen until the statement is executed
and throws an error. There is nothing special about require at
parse-time that must be avoided, unless we're more than typically
paranoid.
make test.valgrind
/bin/sh -e ./runtests choose
./perl TEST
sh -c valgrind --log-fd=3 --suppressions=perl.supp --leak-check=yes --leak-resolution=high --show-reachable=yes --num-callers=50 --track-origins=yes ./perl -I.. -MTestInit porting/podcheck.t 3>podcheck.t.valgrind-current
valgrind --log-fd=3 --suppressions=perl.supp --leak-check=yes --leak-resolution=high --show-reachable=yes --num-callers=50 --track-origins=yes ./perl -I.. -MTestInit porting/podcheck.t
If this argument is accepted, it looks simple to move the VALGRIND
related code blocks into new subroutines in the now-empty
TestValgrind.pm file, and call them appropriately.
t/TEST: suppress 2 uninitialized envars under make test.valgrind
Recent addition of -w on shebang exposed 2 uninitialized vars, due to
VG_OPTS envar added in commit 11b1a7c9, which added glue to reuse
t/TEST's support for make test.valgrind to run linux perf. The 2
use-cases are:
1. make test.valgrind
2. export VG_OPTS='stat -o perf-stat --append --'
export VALGRIND=/usr/bin/perf
export VG_TEST=--help
make test.valgrind
Since 2 is rather non-obvious, clarify with comment here and in code.
TODO: this patch is old, and either needs to be revalidated, or
perhaps rethought; use-case 2 is mostly obsoleted by -lxperf option,
but case 1 still holds.
Recent addition of -w on shebang exposed 2 uninitialized vars, due to
VG_OPTS envar added in commit 11b1a7c9, which added glue to reuse
t/TEST's support for make test.valgrind to run linux perf. The 2
use-cases are:
1. make test.valgrind
2. export VG_OPTS='stat -o perf-stat --append --'
export VALGRIND=/usr/bin/perf
export VG_TEST=--help
make test.valgrind
Since 2 is rather non-obvious, clarify with comment here and in code.
TODO: this patch is old, and either needs to be revalidated, or
perhaps rethought; use-case 2 is mostly obsoleted by -lxperf option,
but case 1 still holds.
t/TEST: change timings Storable key: perf -> times, a better description
Commit 8e03ad8f6c wrote the tests' timing data to a Storable file
using 'perf' as the storage key, but now that we can capture real perf
stat data during make test, the old name is misleading - change it to
"times" to better describe its origin and character.
Commit 8e03ad8f6c wrote the tests' timing data to a Storable file
using 'perf' as the storage key, but now that we can capture real perf
stat data during make test, the old name is misleading - change it to
"times" to better describe its origin and character.
t/TEST: simplify <$results> processing loop. - TAP13.1+
Support use of the --repeat=3 option of linux's perf stat. This
basically means extending the TAPv13 spec (or t/TEST's implementation)
to allow repeated (ie R) plan executions (ie R occurrences of "1..N"
plus the preceding or following N * "ok"s), as long as all R plans
have the same N.
When a test script is run (under linux perf with --repeat=N), the
value of R is unavailable in the output; it is transparent other than
the repetition itself. But we woundnt want it anyway; TAP readers
dont need to handle a new kind of input. If we just allow R
repetitions of 1..N tests, we get loose coupling and dont care if
--repeat=5 were given.
Current legal TAP is essentially either:
print "ok $_\n" for 1..N; # 1A
print "1..N\n";
# OR [1]
print "1..N\n"; # 1B
print "ok $_\n" for 1..N;
The big simplification here is that under --repeat, leading vs
trailing "1..N"s are an irrelevant detail.
- "1..N" plans are only allowed before any tests, or after all of
them, ie ($next==0 or $next==$plan). We just verify this when
"1..N" is seen in test output.
- $plan = undef initially, updated to N when "1..N" is 1st seen.
- $next=0 when "1..N" is seen [2].
- when 2nd+ "1..N" plans are seen, they are allowed if they agree on N.
- The change to if (defined $plan) accepts "1..0" as legal (ie SKIPs).
- $seen_leader and $trailing_leader are thus obsolete, replaced where
needed by "if ($plan)", which is set only when "1..N" is seen.
- $seen_ok was used with $seen_leader to reset $next (test-count).
now handled in [2]
- $max is also taken right from "1..N", replaced with <some-expr>($plan)
NOTES:
[1]: this patch allows BOTH 1A then 1B to run successfully, but not 1B
followed by 1A; the latter would fail on N+1 th test, because the
now-trailing "1..N" failed to reset $next. This is an unimportant
corner case and doesnt warrant cluttering details in the code.
We are running maintained regression tests here, not logic bombs.
- On "1..N" occurrences:
$Reps++ to count repeats (tested at end)
reset $next = 0 after validating it [1]
$nextreps++, like $next w/o reset.
- post-loop tests:
change ($next == $max) test to ($nextreps == $Reps * $plan),
which avoids the now resetting $next.
TODO:
This patch supports --repeat N in t/TEST only; harness is strict wrt
"only 1 plan", ala TAPv13, so make test_harness complains as follows,
and fails the tests.
comp/use.t ........................................................ All 84 subtests passed
comp/retainedlines.t .............................................. All 75 subtests passed
comp/cmdopt.t ..................................................... All 44 subtests passed
Sort whats reported in summary data; unique tests or repeated tests ?
Reduce $totmax vs $max vs $Reps a bit, extra/redundant state is not helpful.
Support use of the --repeat=3 option of linux's perf stat. This
basically means extending the TAPv13 spec (or t/TEST's implementation)
to allow repeated (ie R) plan executions (ie R occurrences of "1..N"
plus the preceding or following N * "ok"s), as long as all R plans
have the same N.
When a test script is run (under linux perf with --repeat=N), the
value of R is unavailable in the output; it is transparent other than
the repetition itself. But we woundnt want it anyway; TAP readers
dont need to handle a new kind of input. If we just allow R
repetitions of 1..N tests, we get loose coupling and dont care if
--repeat=5 were given.
Current legal TAP is essentially either:
print "ok $_\n" for 1..N; # 1A
print "1..N\n";
# OR [1]
print "1..N\n"; # 1B
print "ok $_\n" for 1..N;
The big simplification here is that under --repeat, leading vs
trailing "1..N"s are an irrelevant detail.
- "1..N" plans are only allowed before any tests, or after all of
them, ie ($next==0 or $next==$plan). We just verify this when
"1..N" is seen in test output.
- $plan = undef initially, updated to N when "1..N" is 1st seen.
- $next=0 when "1..N" is seen [2].
- when 2nd+ "1..N" plans are seen, they are allowed if they agree on N.
- The change to if (defined $plan) accepts "1..0" as legal (ie SKIPs).
- $seen_leader and $trailing_leader are thus obsolete, replaced where
needed by "if ($plan)", which is set only when "1..N" is seen.
- $seen_ok was used with $seen_leader to reset $next (test-count).
now handled in [2]
- $max is also taken right from "1..N", replaced with <some-expr>($plan)
NOTES:
[1]: this patch allows BOTH 1A then 1B to run successfully, but not 1B
followed by 1A; the latter would fail on N+1 th test, because the
now-trailing "1..N" failed to reset $next. This is an unimportant
corner case and doesnt warrant cluttering details in the code.
We are running maintained regression tests here, not logic bombs.
- On "1..N" occurrences:
$Reps++ to count repeats (tested at end)
reset $next = 0 after validating it [1]
$nextreps++, like $next w/o reset.
- post-loop tests:
change ($next == $max) test to ($nextreps == $Reps * $plan),
which avoids the now resetting $next.
TODO:
This patch supports --repeat N in t/TEST only; harness is strict wrt
"only 1 plan", ala TAPv13, so make test_harness complains as follows,
and fails the tests.
comp/use.t ........................................................ All 84 subtests passed
comp/retainedlines.t .............................................. All 75 subtests passed
comp/cmdopt.t ..................................................... All 44 subtests passed
Sort whats reported in summary data; unique tests or repeated tests ?
Reduce $totmax vs $max vs $Reps a bit, extra/redundant state is not helpful.
t/TEST: add -lxperf option to run tests under linux's perf stat
With this patch, TEST can run each test-script under linux's perf
stat. Since previous patch honors options for $do_nothing / requires,
harness can use perf stat too.
t]$ ./perl -I../lib TEST -lxperf
t]$ ./perl harness -lxperf
"perf stat" output is comparable to that of "valgrind --tool=cachegrind"
but it takes very little extra CPU to run:
export TEST_OPTS=-lxperf
time make test time make test
-------------- --------------
real 25m41.122s real 26m30.719s
user 18m28.773s user 18m43.286s
sys 1m12.705s sys 1m33.398s
Given this small runtime cost, porters might be inclined to use it and
inspect the data. There may be some core regression tests that are
useful for benchmarking purposes.
EXAMPLES:
Performance counter stats for './perl base/cond.t':
2.077911 task-clock # 0.640 CPUs utilized
2 context-switches # 0.963 K/sec
1 cpu-migrations # 0.481 K/sec
519 page-faults # 0.250 M/sec
2,753,978 cycles # 1.325 GHz
1,725,265 stalled-cycles-frontend # 62.65% frontend cycles idle
2,405,122 stalled-cycles-backend # 87.33% backend cycles idle
3,278,429 instructions # 1.19 insns per cycle
# 0.73 stalled cycles per insn [52.13%]
<not counted> branches
<not counted> branch-misses
0.003244748 seconds time elapsed
perf stat --repeat N also computes std-deviation for each measurement
it does, so this patch makes that feature available. Std-dev will
tell us when performance differences are lost in the noise.
./perl TEST -v -lxperf=10 re/pat_rt_report.t
perf stat --repeat 10 -- ./perl -I.. -MTestInit re/pat_rt_report.t
./perl -I.. -MTestInit re/pat_rt_report.t
Performance counter stats for './perl -I.. -MTestInit re/pat_rt_report.t' (10 runs):
98.749506 task-clock # 0.001 CPUs utilized ( +- 23.68% )
68 context-switches # 0.686 K/sec ( +- 82.04% )
10 cpu-migrations # 0.097 K/sec ( +- 17.44% )
2,956 page-faults # 0.030 M/sec ( +- 23.22% )
254,477,657 cycles # 2.577 GHz ( +- 26.02% ) [50.43%]
75,556,485 stalled-cycles-frontend # 29.69% frontend cycles idle ( +- 19.50% ) [50.93%]
62,921,965 stalled-cycles-backend # 24.73% backend cycles idle ( +- 25.21% ) [51.50%]
241,522,257 instructions # 0.95 insns per cycle
# 0.31 stalled cycles per insn ( +- 34.07% ) [50.96%]
53,147,072 branches # 538.201 M/sec ( +- 31.19% ) [50.18%]
2,451,318 branch-misses # 4.61% of all branches ( +- 11.32% ) [49.95%]
141.101988701 seconds time elapsed ( +- 99.91% )
The patch has 3 parts:
An addition to TEST:_cmd() which wraps the test invocation inside a
"perf stat ..." as shown above, using a %cmdwrap template.
Option-parsing code, which handles several option forms:
1) -lxperf
writes file "$tstamp.perf" into ./t (after `cd $t && ...`)
2) -lxperf=4
adds "--repeat 4" to perf stat invocation.
3) -lxperf=(key=val) pairs
known key=value pairs (with =defaults given)
- tool=perf # path to tool
- cmd=stat # todo try others, perf record, etc
- reps=1 #
- rptdir # write reports to a separate data-repo, safe from git clean -dxf
- name # to convey branch-name and/or config-info, tstamp is prefixed,
- opts # passthru options to perf-stat
$ENV{TEST_OPTS} is split on /;/ and prepended to @ARGV before option
handling, so the following export will affect both make jobs.
export TEST_OPTS="-v;-lxperf=reps=3:rptdir=$HOME/perl/perfdata"
make test
make test_harness
NOTES:
Test script output under perf stat --repeat 4 violates the "plan just
once" rule of TAPv13 spec. It could be extended:
"The plan cannot appear in the middle of the output, only at
beginning or end. Multiple sets of (plan + tests) are allowed, if
all plans agree"
perf stat --repeat N causes perf to compute std-deviation(s) for each
measure. 1st example below is w/o repeat, 2nd with it, corresponding
to the TEST and harness examples above. I dont know how to read into
the numbers, but theres value in having them; they provide some
estimate of "noise-floor" on performance for a given test.
The -opts option passthru to perf stat allows "-x," to cause perf stat
to emit CSV output. This is easier to parse than the human readable
output, but doesnt include the computed/normalized values, nor the
name that the "Performance counter stats" (see examples) are for.
TODO
Probable rework of -lxperf option parsing
- no way now to get output to STDOUT, only to file. maybe not worth having
- keep (k=v:)+ form
- use name="%B-%G-%T.perf" by default "$branch-$sha1st6-$timestamp.perf"
- use wr=1 to save file
- dir=$HOME/perfruns (shorten rptdir)
Using reps=2 yields "FAILED--seen duplicate leader" on every test.
Fixing this requires changes to TEST's <results> processing loop. The
reps handling sub-option code is in this patch because it serves as a
test-case for further changes to optional behavior.
The command wrapper template is pretty minimal and constrained; the
output file name is "$dir/$timestamp$name.perfstat", chosen to match
with $timestamp.ttimes so that both file-types are browsable as a pair.
TEST_OPTS is split on ';', -lxperf is split on ':' into k=v pairs.
There may be scenarios where these delimiters are inconvenient, or the
simplistic parse is brittle.
Performance counter stats for './perl base/cond.t' (3 runs):
With this patch, TEST can run each test-script under linux's perf
stat. Since previous patch honors options for $do_nothing / requires,
harness can use perf stat too.
t]$ ./perl -I../lib TEST -lxperf
t]$ ./perl harness -lxperf
"perf stat" output is comparable to that of "valgrind --tool=cachegrind"
but it takes very little extra CPU to run:
export TEST_OPTS=-lxperf
time make test time make test
-------------- --------------
real 25m41.122s real 26m30.719s
user 18m28.773s user 18m43.286s
sys 1m12.705s sys 1m33.398s
Given this small runtime cost, porters might be inclined to use it and
inspect the data. There may be some core regression tests that are
useful for benchmarking purposes.
EXAMPLES:
Performance counter stats for './perl base/cond.t':
2.077911 task-clock # 0.640 CPUs utilized
2 context-switches # 0.963 K/sec
1 cpu-migrations # 0.481 K/sec
519 page-faults # 0.250 M/sec
2,753,978 cycles # 1.325 GHz
1,725,265 stalled-cycles-frontend # 62.65% frontend cycles idle
2,405,122 stalled-cycles-backend # 87.33% backend cycles idle
3,278,429 instructions # 1.19 insns per cycle
# 0.73 stalled cycles per insn [52.13%]
<not counted> branches
<not counted> branch-misses
0.003244748 seconds time elapsed
perf stat --repeat N also computes std-deviation for each measurement
it does, so this patch makes that feature available. Std-dev will
tell us when performance differences are lost in the noise.
./perl TEST -v -lxperf=10 re/pat_rt_report.t
perf stat --repeat 10 -- ./perl -I.. -MTestInit re/pat_rt_report.t
./perl -I.. -MTestInit re/pat_rt_report.t
Performance counter stats for './perl -I.. -MTestInit re/pat_rt_report.t' (10 runs):
98.749506 task-clock # 0.001 CPUs utilized ( +- 23.68% )
68 context-switches # 0.686 K/sec ( +- 82.04% )
10 cpu-migrations # 0.097 K/sec ( +- 17.44% )
2,956 page-faults # 0.030 M/sec ( +- 23.22% )
254,477,657 cycles # 2.577 GHz ( +- 26.02% ) [50.43%]
75,556,485 stalled-cycles-frontend # 29.69% frontend cycles idle ( +- 19.50% ) [50.93%]
62,921,965 stalled-cycles-backend # 24.73% backend cycles idle ( +- 25.21% ) [51.50%]
241,522,257 instructions # 0.95 insns per cycle
# 0.31 stalled cycles per insn ( +- 34.07% ) [50.96%]
53,147,072 branches # 538.201 M/sec ( +- 31.19% ) [50.18%]
2,451,318 branch-misses # 4.61% of all branches ( +- 11.32% ) [49.95%]
141.101988701 seconds time elapsed ( +- 99.91% )
The patch has 3 parts:
An addition to TEST:_cmd() which wraps the test invocation inside a
"perf stat ..." as shown above, using a %cmdwrap template.
Option-parsing code, which handles several option forms:
1) -lxperf
writes file "$tstamp.perf" into ./t (after `cd $t && ...`)
2) -lxperf=4
adds "--repeat 4" to perf stat invocation.
3) -lxperf=(key=val) pairs
known key=value pairs (with =defaults given)
- tool=perf # path to tool
- cmd=stat # todo try others, perf record, etc
- reps=1 #
- rptdir # write reports to a separate data-repo, safe from git clean -dxf
- name # to convey branch-name and/or config-info, tstamp is prefixed,
- opts # passthru options to perf-stat
$ENV{TEST_OPTS} is split on /;/ and prepended to @ARGV before option
handling, so the following export will affect both make jobs.
export TEST_OPTS="-v;-lxperf=reps=3:rptdir=$HOME/perl/perfdata"
make test
make test_harness
NOTES:
Test script output under perf stat --repeat 4 violates the "plan just
once" rule of TAPv13 spec. It could be extended:
"The plan cannot appear in the middle of the output, only at
beginning or end. Multiple sets of (plan + tests) are allowed, if
all plans agree"
perf stat --repeat N causes perf to compute std-deviation(s) for each
measure. 1st example below is w/o repeat, 2nd with it, corresponding
to the TEST and harness examples above. I dont know how to read into
the numbers, but theres value in having them; they provide some
estimate of "noise-floor" on performance for a given test.
The -opts option passthru to perf stat allows "-x," to cause perf stat
to emit CSV output. This is easier to parse than the human readable
output, but doesnt include the computed/normalized values, nor the
name that the "Performance counter stats" (see examples) are for.
TODO
Probable rework of -lxperf option parsing
- no way now to get output to STDOUT, only to file. maybe not worth having
- keep (k=v:)+ form
- use name="%B-%G-%T.perf" by default "$branch-$sha1st6-$timestamp.perf"
- use wr=1 to save file
- dir=$HOME/perfruns (shorten rptdir)
Using reps=2 yields "FAILED--seen duplicate leader" on every test.
Fixing this requires changes to TEST's <results> processing loop. The
reps handling sub-option code is in this patch because it serves as a
test-case for further changes to optional behavior.
The command wrapper template is pretty minimal and constrained; the
output file name is "$dir/$timestamp$name.perfstat", chosen to match
with $timestamp.ttimes so that both file-types are browsable as a pair.
TEST_OPTS is split on ';', -lxperf is split on ':' into k=v pairs.
There may be scenarios where these delimiters are inconvenient, or the
simplistic parse is brittle.
Performance counter stats for './perl base/cond.t' (3 runs):
t/TEST: move do_nothing test after option-handling code
As explained in commit c537bcda1, $do_nothing's purpose is to prevent
TEST from actually running the tests, so that it can be required by
harness, and its routines reused.
This patch moves TEST's $do_nothing check after its option-handling
code, allowing those options to be used to alter the behavior of the
TEST subroutines when called by harness, the same as when they're
called from TEST::main.
TODO: With TEST's option handling done even for $do_nothing cases, it
consumes all options before harness sees them, so harness options -v
and -torture are broken. There are multiple ways to handle it, all
needing some consensus:
- harness does selective option scanning before requiring TEST. It
could either consume its options or pass them thru once it handles
them.
- both -v and -torture are implemented by TEST and harness, and mean
qualitatively the same thing. OTOH, any consumers of the respective
outputs may care about differences. Simply, could rename one of
each option to avoid the conflict.
- use of $TEST::verbose (or are namespaces also to be avoided?)
As explained in commit c537bcda1, $do_nothing's purpose is to prevent
TEST from actually running the tests, so that it can be required by
harness, and its routines reused.
This patch moves TEST's $do_nothing check after its option-handling
code, allowing those options to be used to alter the behavior of the
TEST subroutines when called by harness, the same as when they're
called from TEST::main.
TODO: With TEST's option handling done even for $do_nothing cases, it
consumes all options before harness sees them, so harness options -v
and -torture are broken. There are multiple ways to handle it, all
needing some consensus:
- harness does selective option scanning before requiring TEST. It
could either consume its options or pass them thru once it handles
them.
- both -v and -torture are implemented by TEST and harness, and mean
qualitatively the same thing. OTOH, any consumers of the respective
outputs may care about differences. Simply, could rename one of
each option to avoid the conflict.
- use of $TEST::verbose (or are namespaces also to be avoided?)
t/TEST: comment some of the <$results> loop vars
Add comments to var declarations, to help clarify loop operation.
Add comments to var declarations, to help clarify loop operation.
t/TEST: add a common timestamp
Commit 0978c4bed computed a timestamp string as part of an output
filename, make it available for others.
Commit 0978c4bed computed a timestamp string as part of an output
filename, make it available for others.
t/TEST: $failure doesnt need to use defined
$failure handling in <$results> processing loop does not need extra
subtlety of defined-ness checks - just give it an initial (false)
value, and check for truth.
$failure handling in <$results> processing loop does not need extra
subtlety of defined-ness checks - just give it an initial (false)
value, and check for truth.
t/TEST: move our @found out to its real scope
commit c96083ea8213 added our @found inside sub _find_tests,
but testing with strict exposes probs:
$ perl -cw -Ilib -Mstrict t/TEST
Variable "@found" is not imported at t/TEST line 198.
Variable "@found" is not imported at t/TEST line 202.
Global symbol "@found" requires explicit package name at t/TEST line 198.
Global symbol "@found" requires explicit package name at t/TEST line 202.
No point in arguing, hoist decl out to file scope.
commit c96083ea8213 added our @found inside sub _find_tests,
but testing with strict exposes probs:
$ perl -cw -Ilib -Mstrict t/TEST
Variable "@found" is not imported at t/TEST line 198.
Variable "@found" is not imported at t/TEST line 202.
Global symbol "@found" requires explicit package name at t/TEST line 198.
Global symbol "@found" requires explicit package name at t/TEST line 202.
No point in arguing, hoist decl out to file scope.
t/TEST: add -w to shebang, fix a used-once warning
Adding -w should be ok, despite peculiar code style; it avoids
require, unlike "use strict". Added risk of perl brokenness seems
vanishingly small. Fix one used-once warning thus exposed, and one
test in FileHandle.t surprised by t/TEST's new '-w' in the shebang.
Adding -w should be ok, despite peculiar code style; it avoids
require, unlike "use strict". Added risk of perl brokenness seems
vanishingly small. Fix one used-once warning thus exposed, and one
test in FileHandle.t surprised by t/TEST's new '-w' in the shebang.
[perl #108276] avoid deep recursion in Perl_op_free()
Based on a patch by Niels Thykier, with the following changes:
- the stack is allocated dynamically, rather than with a fixed depth
of 10
- reordered the loop to avoid pushing the argument and immediately
popping it. This wasn't a big deal with the auto stack, but avoids
a Newx() call for freeing leaf nodes
Based on a patch by Niels Thykier, with the following changes:
- the stack is allocated dynamically, rather than with a fixed depth
of 10
- reordered the loop to avoid pushing the argument and immediately
popping it. This wasn't a big deal with the auto stack, but avoids
a Newx() call for freeing leaf nodes
Optimise ‘return’ away at end of lv sub
Optimise substr assignment at sub exit
The assignment in substr(...) = ... gets optimised away in void con-
text. We can also optimise it away at sub exit as long as this is not
an lvalue sub and pp_substr returns the replacement when optimised.
The assignment in substr(...) = ... gets optimised away in void con-
text. We can also optimise it away at sub exit as long as this is not
an lvalue sub and pp_substr returns the replacement when optimised.
Add optional GCC-only support for using long doubles on Win32
op.c: Skip pushmark for (...)x... in scalar cx
(...)x... is marked as a list at compile time and given a pushmark,
before the context is known. If it turns out to be called in scalar
or void context after all, then pp_repeat has to handle the mark that
has been pushed on to the markstack.
When the scalar context is applied, there is no reason not to undo
the listification, as long as there is only one left-hand argument.
That way we don’t have to execute a pushmark op and do the extra stack
fiddling at run time.
(...)x... is marked as a list at compile time and given a pushmark,
before the context is known. If it turns out to be called in scalar
or void context after all, then pp_repeat has to handle the mark that
has been pushed on to the markstack.
When the scalar context is applied, there is no reason not to undo
the listification, as long as there is only one left-hand argument.
That way we don’t have to execute a pushmark op and do the extra stack
fiddling at run time.
[perl #121827] Fix repeat stack bugs
(...)x... is marked as a list at compile time and given a pushmark,
before the context is known. If it turns out to be called in scalar
or void context after all, then pp_repeat has to handle the mark that
has been pushed on to the markstack.
It was not handling the mark for overloading. Nor was it handling
void context correctly at all. (The stack may have an empty list, in
which case we call FETCH on a potentially tied stack item that has
nothing to do with us.)
I tested it in void context, because I plan to undo the listification
when scalar context is applied, for speed.
(...)x... is marked as a list at compile time and given a pushmark,
before the context is known. If it turns out to be called in scalar
or void context after all, then pp_repeat has to handle the mark that
has been pushed on to the markstack.
It was not handling the mark for overloading. Nor was it handling
void context correctly at all. (The stack may have an empty list, in
which case we call FETCH on a potentially tied stack item that has
nothing to do with us.)
I tested it in void context, because I plan to undo the listification
when scalar context is applied, for speed.