| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This belongs in the category of "I can't believe I did that." Commit
613abc6d16e99bd9834fe6afd79beb61a3a4734d introduced warning messages
when a multi-byte character is operated on in a single byte locale. But
the two macros introduced fail to suppress said messages when in a
multi-byte locale where the operation is perfectly valid.
This partially solves v5.22 blocker [perl #123527]. But it could still
fail if the test files are called from within a non-UTF-8 locale. I
will issue a pull request for fixing that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An empty cpan/.dir-locals.el stops Emacs using the core defaults for
code imported from CPAN.
Committer's work:
To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed
to be incremented in many files, including throughout dist/PathTools.
perldelta entry for module updates.
Add two Emacs control files to MANIFEST; re-sort MANIFEST.
For: RT #124119.
|
| |
|
|
|
|
|
| |
XS writers may need to manipulate the LC_NUMERIC locale. Some macros
are available to do this. This documents them and the issues.
|
|
|
|
|
| |
Remove some empty /**/ and align line continuation backslashes onto tab
boundaries
|
|
|
|
|
|
|
|
|
|
| |
This changes the way some of the current internal-only macros are named
and used in order to simplify things and minimize what gets exposed as
part of the API.
Although these have not been listed as publicly available, it costs
essentially nothing to keep the old names around in case someone was
illegally using them.
|
|
|
|
|
| |
This definition was duplicated in both branches of an #if #else #endif
It's better to do it once, outside the #if.
|
|
|
|
| |
Otherwise things won't compile.
|
|
|
|
|
|
| |
Fix for [perl #123767] IRIX64 blead (ddce084a) opbasic/arith.t failure
Use the PERL_SYS_FPU_INIT to initialize the FPU flags appropriately.
|
|
|
|
| |
(now that the nan payload code is gone)
|
|
|
|
| |
More generally, the NaN should be the quiet one.
|
|
|
|
| |
They are unused, better keep the API small.
|
|
|
|
|
|
|
|
|
|
|
| |
A function implements seeing if the space between any two characters is
a grapheme cluster break. Afer I wrote this, I realized that an array
lookup might be a better implementation, but the deadline for v5.22 was
too close to change it. I did see that my gcc optimized it down to
an array lookup.
This makes the implementation of \X go from being complicated to
trivial.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
4258cf903c752ec19a3aeee9b93020533d923e1a
91e945c051cfcdf499d5b43aa5ac0a5681cdd595
eb254f2672a985ec3c34810f624f36c18fc35fc7
c9a671b17a9c588469bcef958038daaaaf9cc88b
99fcdd4df47515fb0a62a046e622adec0871754d
ba511db061a88439acb528a66c780ab574bb4fb0
0d1cf11425608e9be019f27a3a4575bc71c49e6b
c2ea8a88f8537d00ba25ec8feb63ef5dc085ef2b
b5a6eedc2f49a90089cca896ee20f41e373fb4c9
30419b527d2c5a06cefe2db9183f59e2697c47fc
29b62199cd4c359dfc6b9d690341de40d105ca5f
be181dc9d91c84a2fe03912c993c8259fed92641
4de1bcfe1abdaba0a5da394ddea0cc6fd7e36c7b
6e915616c4ccb4f6cc3122c5d395765db96c0a2d
b2e3501558a1017eb529be0915c25d31671e7869
bfaa02d55f4ace1571e6fa9e5b47d5e3ac3cecc6
569f27e562618bdddcf4a9fc71612283a73747e9
4f89311dc8de87ddc9a302c6f2d2c844951bbd28
a307a0b0d83c509cc2adaad8cebb44260294bf36
6640aa2c3b93d7ac78e4e86983fe5948b3ca55f2
b74dc0b3c96390d8bf83d8c3ffc0c2c2d1f0a5d3
c3a8e5a5b4bb89a15de642c023dfd5cbc4678938
|
| |
|
|
|
|
| |
This is not a strong guarantee that the NV_NAN is a quiet NaN.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Extracted from patch submitted by Lajos Veres in RT #123693.
|
|
|
|
| |
Prevents treating a large file position as negative (or even wrapped).
|
|
|
|
|
|
|
| |
This reverts commit 819b139db33e2022424694e381422766903d4f65.
This could be repapplied for 5.23.1, with modifications or
additional patches to solve the breakage discussed in RT 123580.
|
|
|
|
|
|
|
|
|
|
| |
The bulk of this macro is extremely rarely executed, so it makes sense
to optimize for space, as it is called from a fair number of places, and
move as much as possible to a single function.
For whatever it's worth, on my system with my typical compilation
options, including -O0, the savings was 19640 bytes in regexec.o, 4528
in utf8.o, at a cost of 1488 in locale.o.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gv_add_by_type was added in commit d5713896ec in 5.11.0 . Improve
gv_add_by_type by making it return the newly created SV*, instead of the
the GV *, which the caller must deref both the GV head to get svu and
then deref a slice into the GP, even though it already derefed svu and GP
right before, to figure out whether to call gv_add_by_type in the first
place. The original version of this patch had gv_add_by_type returning a
SV ** to ensure lvalue-ness but it was discovered it wasn't needed and not
smart.
-rename gv_add_by_type since it was removed from public api and its proto
changed
-remove null check since it is impossible to pass null through GvAVn(),
and unlikely with gv_AVadd, null segvs reliably crash in the rare case of
a problem
-instead of S_gv_init_svtype and gv_add_by_type using a tree of logic/
conditional jumps in asm, use a lookup table, GPe (e=enum or entry)
enums are identical to offsets into the GP struct, all of then fit under
0xFF, if the CC and CPU arch wants, CC can load the const once into a
register, then use the number for the 2nd deref, then use the number again
as an arg to gv_add_by_type, the low (&~0xf) or high (<<2) 2 bits in a
GPe can be used for something else in the future since GPe is pointer
aligned
-SVt_LAST triggers "panic: sv_upgrade to unknown type", so use that value
for entries of a GP which are not SV head *s and are invalid to pass as
an arg
-remove the tree of logic in S_gv_init_svtype, replace with a table
-S_gv_init_svtype is now tail call friendly and very small
-change the GV**n to be rvalues only, assigning to GV**n is probably a
memory leak
-fix 1 core GV**n as lvalue use
-GvSVn's unusual former definition is from commit 547f15c3f9 in 2005
and DEFSV as lvalue is gone in core as of commit 414bf5ae08 from 2008
since all the GV**n macros are now rvalues, this goes too
-PTRPTR2IDX and PTRSIZELOG2 could use better names
-in pp_rv2av dont declare strings like that VC linker won't dedup that, and
other parts of core also have "an ARRAY", perl521.dll previously had 2
"an ARRAY" and "a HASH" strings in it due to this
before VC 2003 32 perl521.dll .text 0xc8813 in machine code bytes after
.text 0xc8623
|
|
|
|
|
| |
C++ fails otherwise, and PL_my_cxt_list is void ** so individual
elephants (aka elements) should be void *.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nn VC 2003 32, taking a very simple CLONE XSUB, specifically
Time::HiRes::CLONE, shows a reduction from 0x53 to 0x47 bytes of machine
code. This is because my_cxt_index has to be reread after the memcpy
function call incase my_cxt_index was changed by memcpy (GCC usually
inlines short fixed length memcpys, on VC P5P perl, the option to inline
memcpy is off), also the new my_cxtp does not need to be saved in a non-vol
anymore, previously my_cxtp had to be copied to a non-vol for it be
available after the memcpy function call. In a simple XSUB like the one
mentioned here, saving and restoring the non-vol register is also
removed.
See details in perl #123534.
|
|
|
|
|
|
|
|
|
| |
See http://nntp.perl.org/group/perl.perl5.porters/211909
Something is quite likely wrong with the logic if say in a Greek locale,
Unicode characters (especially Greek ones) are encountered. The same
character will be represented by two different code points. This
warning alerts the user to this undesirable state of affairs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 8c6180a91de91a1194f427fc639694f43a903a78 added a warning message
for when Perl determines that the program's underlying locale just
switched into is poorly supported. At the time it was thought that this
would be an extremely rare occurrence. However, a bug in HP-UX -
B.11.00/64 causes this message to be raised for the "C" locale. A
workaround was done that silenced those. However, before it got fixed,
this message would occur gobs of times executing the test suite. It was
raised even if the script is not locale-aware, so that the underlying
locale was completely irrelevant. There is a good prospect that someone
using an older Asian locale as their default would get this message
inappropriately, even if they don't use locales, or switch to a
supported one before using them.
This commit causes the message to be raised only if it actually is
relevant. When not in the scope of 'use locale', the message is stored,
not raised. Upon the first locale-dependent operation within a bad
locale, the saved message is raised, and the storage cleared. I was
able to do this without adding extra branching to the main-line
non-locale execution code. This was done by adding regnodes which get
jumped to by switch statements, and refactoring some existing C tests so
they exclude non-locale right off the bat.
These changes would have been necessary for another locale warning that
I previously agreed to implement, and which is coming a few commits from
now.
I do not know of any way to add tests in the test suite for this. It is
in fact rare for modern locales to have these issues. The way I tested
this was to temporarily change the C code so that all locales are viewed
as defective, and manually note that the warnings came out where
expected, and only where expected.
I chose not to try to output this warning on any POSIX functions called.
I believe that all that are affected are deprecated or scheduled to be
deprecated anyway. And POSIX is closer to the hardware of the machine.
For convenience, I also don't output the message for some zero-length
pattern matches. If something is going to be matched, the message will
likely very soon be raised anyway.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the PerlIO vtables were const only on PERL_GLOBAL_STRUCT_PRIVATE
builds, which was created for former Symbian port and today is rarely used.
Since writing/hooking the PerlIO vtables from XS has never been public API
and is very unlikely to be occuring on CPAN, make then const so they will
be shared between perl processes.
b4 VC2008 x64 perl521.dll .rdata section 0x7293C bytes, .data 0x34B0 bytes
after .rdata 0x7321C .data 0x2BD0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-gv_add_by_type is special only for non-GVs, and add AV to GV, otherwise
it is just assigning to GP slot (in this case through GvSV), which
CLEAR_ERRSV already did in another branch, so inline the gv_add_by_type
-dont compute GvSV multiple times, GvSV contains 2 derefs, after this patch
it will contains just 1 deref ("*svp") without an offset (deref without
offset is smaller in x86 machine code than deref with offset)
-SvREFCNT_dec_NN for efficiency
-move SvPOK_only closer to SvMAGICAL, this ensures SvFLAGS is read and
written only once, not 2 reads and 1 write, this is specifically for
RISC-ish cpus
-the goto clresv_newemptypv is because VC optimizer in -O1 didn't combine
the branches
perl521.dll VC 2003 before .text section size in machine code bytes
0xc8a63, after 0xc88e3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A remark in
http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115113.html
caused commit bc028b6b7f /
http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115116.html .
That remark is not true according to
http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115115.html
and
http://www.nntp.perl.org/group/perl.perl5.porters/2013/01/msg197318.html .
To save memory between perl processes, const the tables so the memory is
shared by the OS between perl processes.
b4 .rdata section of x64 VC 2008 miniperl 0x667EE bytes .data 0x3440 bytes
after .rdata 0x66FAE .data 0x2C80, 0x3440-0x2C80=0x7C0 saved,
based on the .data section size crossing a page boundary this saved 4K
of per process memory on Win64 miniperl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This op is an optimisation for any series of one or more array or hash
lookups and dereferences, where the key/index is a simple constant or
package/lexical variable. If the first-level lookup is of a simple
array/hash variable or scalar ref, then that is included in the op too.
So all of the following are replaced with a single op:
$h{foo}
$a[$i]
$a[5][$k][$i]
$r->{$k}
local $a[0][$i]
exists $a[$i]{$k}
delete $h{foo}
while these aren't:
$a[0] already handled by OP_AELEMFAST
$a[$x+1] not a simple index
and these are partially replaced:
(expr)->[0]{$k} the bit following (expr) is replaced
$h{foo}[$x+1][0] the first and third lookups are each done with
a multideref op, while the $x+1 expression and
middle lookup are done by existing add, aelem etc
ops.
Up until now, aggregate dereferencing has been very heavyweight in ops; for
example, $r->[0]{$x} is compiled as:
gv[*r] s
rv2sv sKM/DREFAV,1
rv2av[t2] sKR/1
const[IV 0] s
aelem sKM/DREFHV,2
rv2hv sKR/1
gvsv[*x] s
helem vK/2
When executing this, in addition to the actual calls to av_fetch() and
hv_fetch(), there is a lot of overhead of pushing SVs on and off the
stack, and calling lots of little pp() functions from the runops loop
(each with its potential indirect branch miss).
The multideref op avoids that by running all the code in a loop in a
switch statement. It makes use of the new UNOP_AUX type to hold an array
of
typedef union {
PADOFFSET pad_offset;
SV *sv;
IV iv;
UV uv;
} UNOP_AUX_item;
In something like $a[7][$i]{foo}, the GVs or pad offsets for @a and $i are
stored as items in the array, along with a pointer to a const SV holding
'foo', and the UV 7 is stored directly. Along with this, some UVs are used
to store a sequence of actions (several actions are squeezed into a single
UV).
Then the main body of pp_multideref is a big while loop round a switch,
which reads actions and values from the AUX array. The two big branches in
the switch are ones that are affectively unrolled (/DREFAV, rv2av, aelem)
and (/DREFHV, rv2hv, helem) triplets. The other branches are various entry
points that handle retrieving the different types of initial value; for
example 'my %h; $h{foo}' needs to get %h from the pad, while '(expr)->{foo}'
needs to pop expr off the stack.
Note that there is a slight complication with /DEREF; in the example above
of $r->[0]{$x}, the aelem op is actually
aelem sKM/DREFHV,2
which means that the aelem, after having retrieved a (possibly undef)
value from the array, is responsible for autovivifying it into a hash,
ready for the next op. Similarly, the rv2sv that retrieves $r from the
typeglob is responsible for autovivifying it into an AV. This action
of doing the next op's work for it complicates matters somewhat. Within
pp_multideref, the autovivification action is instead included as the
first step of the current action.
In terms of benchmarking with Porting/bench.pl, a simple lexical
$a[$i][$j] shows a reduction of approx 40% in numbers of instructions
executed, while $r->[0][0][0] uses 54% fewer. The speed-up for hash
accesses is relatively more modest, since the actual hash lookup (i.e.
hv_fetch()) is more expensive than an array lookup. A lexical $h{foo}
uses 10% fewer, while $r->{foo}{bar}{baz} uses 34% fewer instructions.
Overall,
bench.pl --tests='/expr::(array|hash)/' ...
gives:
PRE POST
------ ------
Ir 100.00 145.00
Dr 100.00 165.30
Dw 100.00 175.74
COND 100.00 132.02
IND 100.00 171.11
COND_m 100.00 127.65
IND_m 100.00 203.90
with cache misses unchanged at 100%.
In general, the more lookups done, the bigger the proportionate saving.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the same as a UNOP, but with the addition of an op_aux field,
which points to an array of UNOP_AUX_item unions.
It is intended as a general escape mechanism for adding per-op-type extra
fields (or arrays of items) to UNOPs.
Its class character (for regen/opcodes etc) is '+'.
Currently there are no ops of this type; but shortly, OP_MULTIDEREF will
be added, which is the original motivation for this new op type.
|
|
|
|
|
| |
Cannot find the exact moment from gcc release notes, but tests fine in 4.3.6.
(not fine = "warning: unused ...")
|
|
|
|
|
| |
In non-DEBUGGING builds it would be replaced with nothing, producing
a syntax error
|
|
|
|
|
|
|
|
|
|
|
| |
distinct from SV. This should fix the CPAN modules that were failing
when the PadnameLVALUE flag was added, because it shared the same
bit as SVs_OBJECT and pad names were going through code paths not
designed to handle pad names.
Unfortunately, it will probably break other CPAN modules, but I think
this change is for the better, as it makes both pad names and SVs sim-
pler and makes pad names take less memory.
|
|
|
|
|
| |
for pad names. Currently equivalent to SVf(ARG), they will be changed
shortly when I make pad names a separate type.
|