| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new OP to replace simple cases of OP_SASSIGN
and OP_AELEMFAST_LEX. (Similar concept to GH #19943)
For example, `my @ary; $ary[0] = "boo"` is currently implemented as:
7 <2> sassign vKS/2 ->8
5 <$> const[PV "boo"] s ->6
- <1> ex-aelem sKRM*/2 ->7
6 <0> aelemfast_lex[@ary:1,2] sRM ->7
- <0> ex-const s ->-
But now will be turned into:
6 <1> aelemfastlex_store[@ary:1,2] vKS ->7
5 <$> const(PV "boo") s ->6
- <1> ex-aelem sKRM*/2 ->6
- <0> ex-aelemfast_lex sRM ->6
- <0> ex-const s ->-
This is intended to be a transparent performance optimization.
It should be applicable for RHS optrees of varying complexity.
|
|
|
|
|
|
|
|
|
| |
Promote the use of 'v5.36' instead of 'v5.10'.
Also point to the existing Cheat Sheet for the
feature bundle.
For consistency also removed the final dot in several
'head2' feature title.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows the existing `undef` OP to act on a pad SV. The following
two cases are optimized:
`undef my $x`, currently implemented as:
4 <1> undef vK/1 ->5
3 <0> padsv[$x:1,2] sRM/LVINTRO ->4
`my $a = undef`, currently implemented as:
5 <2> sassign vKS/2 ->6
3 <0> undef s ->4
4 <0> padsv[$x:1,2] sRM*/LVINTRO ->5
These are now just represented as:
3 <1> undef[$x:1,2] vK/SOMEFLAGS ->4
Note: The two cases are not quite functionally identical, as `$x = undef`
clears the SV flags but preserves any PV allocation for later reuse,
whereas `undef $x` does free any PV allocation. This behaviour difference
is preserved through use of the OPpUNDEF_KEEP_PV flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new OP to replace simple cases
of OP_SASSIGN and OP_PADSV.
For example, 'my $x = 1' is currently implemented as:
1 <;> nextstate(main 1 -e:1) v:{
2 <$> const(IV 1) s
3 <0> padsv[$x:1,2] sRM*/LVINTRO
4 <2> sassign vKS/2
But now will be turned into:
1 <;> nextstate(main 1 -e:1) v:{
2 <$> const(IV 1) s
3 <1> padsv_store[$x:1,2] vKMS/LVINTRO
This intended to be a transparent performance optimization.
It should be applicable for RHS optrees of varying complexity.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces PL_regnode_arg_len, PL_regnode_arg_len_varies,
PL_regnode_off_by_arg and PL_regnode_kind with a single PL_regnode_info
array, which is an array of struct regnode_meta, which contains the same
data but as a struct. Since PL_regnode_name is only used in debugging
builds of the regex engine we keep it separate. If we add more debug
properties it might be good to create a PL_regnode_debug_info[] to hold
that data instead.
This means when we add new properties we do not need to modify any
secondary sources to add new properites, just the struct definition
and regen/regcomp.pl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we're using C99, we can safely use the __VA_ARGS__ expansion in
these variable-list macros.
Unfortunately we can't just emit them unconditionally, because much
existing CPAN code exists that thinks it can call e.g. `warn()` without
an aTHX_ in scope (because they don't #define PERL_NO_GET_CONTEXT).
Therefore, we have to guard these new macro forms by
... || defined(PERL_CORE)
and continue to emit the "..._nocontext()" variants at the end of the
file, as we previously did.
It's not a great solution but it at least means we can use `croak()`,
`warn()`, et.al. within perl core source now.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
For debugging and enhancements, etc.
|
| |
|
| |
|
|
|
|
|
| |
This is in preparation for a future patch, so we can access
PL_reg_off_by_arg() from an inline function in regexec.c
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we hard code the struct used by the different regop types.
This makes it awkward to change the structure used by a specific regop
as the struct it uses might be used in many contexts, and each cases
of a regop using that structure must be reviewed to see if it needs
to be changed.
This patch adds a typedef for each regnode. The typedefs are named
'tregnode_OP', for instance 'tregnode_TRIE' is typedefed to 'struct
charclass' (at the time of this commit). This allows the code to do
things like 'sizeof(tregnode_TRIE)' and should the exact struct used
for TRIE regops change in the future then no code need be reviewed
or changed.
|
|
|
|
|
|
|
|
|
| |
In a follow up patch we will use this data from regexec.c which
currently cannot see the variable.
This changes a comment in regen/mk_invlists.pl which necessitated
rebuilding several files related to unicode. Only the hashes associated
with mk_invlists.pl were changed.
|
| |
|
|
|
|
| |
Handle comments on #else like we do with #endif.
|
|
|
|
|
|
| |
Commit c5327cb77526e4e4c7bb83e24be20ac48e85b1fa fixed the bug that
caused it to be put back in the :5.36 feature bundle, so let's pull it
out again.
|
|
|
|
|
| |
Also tweak the implementation of the other two boolean builtins (is_bool
& is_weak) to be slightly more efficient.
|
|
|
|
|
|
|
|
| |
This allows us to enforce API boundaries and potentially enables
compiler optimisations.
We've been always hiding non-public symbols on Windows. This commit
brings that to the other platforms.
|
|
|
|
| |
This will be used in the next commit
|
| |
|
|
|
|
|
|
| |
This should be being used only in core, as its only use is for autodoc.
Change the flag name to be more mnemonic, freeing up its current name
for another use.
|
|
|
|
|
|
|
| |
C reserves symbols beginning with underscores for its own use. This
commit moves the underscore so it is trailing, which is legal. The
symbols changed here are many of the ones in handy.h that have
significant uses outside it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A long standing bug in Perl that has gone undetected is that the array
is global that is created when changing locales and tells fc() and qr//i
matching what the folds are in the new locale.
What this means is that any program only has one set of fold definitions
that apply to all threads within it, even if we claim that the locales
are thread-safe on the given platform. One possibility for this going
undetected so long is that no one is using locales on multi-threaded
systems much. Another possibility is that modern UTF-8 locales have the
same set of folds as any other one.
It is a simple matter to make the fold array per-thread instead of
per-process, and that solves the problem transparently to other code.
I discovered this stress-testing locale handling under threads. That
test will be added in a future commit.
In order to keep from having a dTHX inside foldEQ_locale, it has to have
a pTHX_ parameter. This means that the other functions that function
pointer variables get assigned to point to have to have an identical
signature, which means adding pTHX_ to functions that don't require it.
The bodies of all these are known to the compiler, since they are all
in inline.h or in the same .c file as where they are called. Hence the
compiler can optimize out the unused parameter.
Two calls of STR_WITH_LEN also have to be changed because of C
preprocessor limitations; perhaps there is another way to do it that I'm
unfamiliar with.
|
|
|
|
| |
delimiters
|
|
|
|
|
|
|
|
| |
These use checksums to see if the generated data could be out of date.
The new NormTest.pl wasn't counted in this, and needn't be, but
excluding it and other similar ones is more trouble than it's worth, so
make a comment to that effect and update to include the NormTest.pl
digest value.
|
|
|
|
|
| |
These have long been accepted by autodoc, but could not be listed in
embed.fnc until now.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normally, the embed.fnc C flag requires a p flag to make sure that the
name starts with 'Perl_', to avoid polluting the caller's name space.
This commit makes an exception to that if the name already starts with
[Pp]erl.
This is because we have few old functions whose name starts with
'perl_', and hence they don't fit in with the newer scheme of things.
The meanings of the O and o flags in combination could have been
tweaked, but this is the simplest solution, namely: If the name isn't
going to pollute, it's ok no matter what the flags say.
|
| |
|
|
|
|
|
|
| |
This script regenerates a portion of perlguts, including notes for
generating perlapi. Those notes were lacking the section name in
perlapi that the documentation should apply to.
|
|
|
|
|
| |
Since the global variable $tree was renamed $TREE, we can now rename all
the instances of a sub parameter $tre to '$tree'.
|
|
|
|
|
| |
Explain this structure, which is the input used to define all the
warnings.
|
|
|
|
|
| |
rename my($warn, $pm) to ($warn_h, $warn_pm) to make it easier to
see that they're the filehandles for warnings.h and warnings.pm
|
| |
|
|
|
|
|
|
|
|
| |
valueWalk() checks for a duplicate warnings name. However,
1) This is also done in walk(), so is redundant.
2) It is broken. Originally it declared @list but checked %list;
%list is global and was renamed to %CATEGORIES to make it clear it was a
global (and thus unrelated to @list). So its probably never worked.
|
|
|
|
|
| |
This lexical had global scope. Instead, make it a parameter to
sub valueWalk(), since it's only used temporarily by two subs.
|
|
|
|
| |
This doesn't seem to be used any more
|
|
|
|
|
|
|
|
|
|
|
| |
various lexical vars like $tree, $def are populated early on, then their
values are used later in many places, including directly in subs.
Rename these vars to be uppercase and with more meaningful names, to
emphasise their globalness.
(Ideally they really ought to be local and passed as arguments to all
the subs that use them, but that's more work.)
|
|
|
|
|
|
| |
A block of code no longer declares any lexical variables, so remove the
block. Apart from removing a '{' and '}', this is a whitespace-only
change.
|
|
|
|
| |
$offset was added in 2000, but hasn't actually been used for a long while
|