summaryrefslogtreecommitdiff
path: root/regen
Commit message (Collapse)AuthorAgeFilesLines
* OP_AELEMFASTLEX_STORE - combined sassign/aelemfast_lexRichard Leach2022-09-072-2/+3
| | | | | | | | | | | | | | | | | | | | | | 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 v5.36 usage and feature bundles docNicolas R2022-08-301-10/+15
| | | | | | | | | 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.
* Add OPpTARGET_MY optimization to OP_UNDEFRichard Leach2022-08-251-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Implement OP_PADSV_STORE - combined sassign/padsv OPRichard Leach2022-08-172-2/+4
| | | | | | | | | | | | | | | | | | | | | 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.
* regen/warnings.pl Rmv extraneous 'my' declarationKarl Williamson2022-08-141-1/+1
|
* regen/regcomp.pl - Apparently this extra const breaks g++Yves Orton2022-08-061-1/+1
|
* regex engine - replace many attribute arrays with oneYves Orton2022-08-061-95/+37
| | | | | | | | | | | | | | 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
* Emit __VA_ARGS__-using macros into embed.h when on PERL_COREPaul "LeoNerd" Evans2022-08-031-13/+27
| | | | | | | | | | | | | | | | | | | 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.
* Avoid some confusion in regen/embed.pl by renaming the scalar $args to $argcPaul "LeoNerd" Evans2022-08-031-9/+9
|
* regex engine - Rename PL_reg_name to PL_regnode_nameYves Orton2022-08-031-3/+3
|
* regex engine - Rename PL_reg_off_by_arg to PL_regnode_off_by_argYves Orton2022-08-031-3/+3
|
* regex engine - Rename PL_regkind to PL_regnode_kindYves Orton2022-08-031-5/+5
|
* regex engine - Rename PL_regargvaries to PL_regnode_arg_len_variesYves Orton2022-08-031-3/+3
|
* regex engine - Rename PL_regarglen to PL_regnode_arg_lenYves Orton2022-08-031-3/+3
|
* regen/regcomp.pl - add PL_regargvariesYves Orton2022-08-031-0/+29
|
* regen/regcomp.pl - add a way to dump the node/state tableYves Orton2022-08-031-0/+5
| | | | For debugging and enhancements, etc.
* regen/regcomp.pl - fix documentation (add missing PL_ prefix)Yves Orton2022-08-031-1/+1
|
* regcomp.pl - use the regnode typedefs in EXTRA_SIZE calculationsYves Orton2022-08-031-1/+1
|
* regex engine - Rename reg_off_by_arg to PL_reg_off_by_argYves Orton2022-08-031-1/+0
| | | | | This is in preparation for a future patch, so we can access PL_reg_off_by_arg() from an inline function in regexec.c
* regex engine rename -> reg_off_by_argYves Orton2022-08-031-23/+9
|
* regen/regcomp.pl - create typedefs for all regnode typesYves Orton2022-08-031-0/+34
| | | | | | | | | | | | | | | 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.
* regen/regcomp.pl - Make regarglen available as PL_regarglen in regexec.cYves Orton2022-08-031-3/+8
| | | | | | | | | 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.
* regen/mk_invlists.pl - under DEBUG=1 show some progress outputYves Orton2022-08-031-4/+26
|
* regen/embed_lib.pl - deal with comments betterYves Orton2022-07-151-2/+2
| | | | Handle comments on #else like we do with #endif.
* Remove bareword_filehandles from the :5.38 feature bundleDagfinn Ilmari Mannsåker2022-07-061-2/+5
| | | | | | 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.
* Add builtin::is_taintedJames Raspass2022-07-051-2/+3
| | | | | Also tweak the implementation of the other two boolean builtins (is_bool & is_weak) to be slightly more efficient.
* hide private functions with __attribute__((visibility("hidden")))Tomasz Konojacki2022-06-182-1/+7
| | | | | | | | 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.
* regen/embed.pl: Add static Perl_ not_inlined capabilityKarl Williamson2022-06-141-4/+6
| | | | This will be used in the next commit
* regen/embed.pl: Use $var to avoid duplicate stringKarl Williamson2022-06-141-9/+11
|
* Change autodoc flagKarl Williamson2022-06-141-1/+1
| | | | | | 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.
* Change handy.h macro names to be C standard conformantKarl Williamson2022-06-121-2/+2
| | | | | | | 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.
* Make fc(), qr//i thread-safe on participating platformsKarl Williamson2022-06-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* feature - document that use utf8 should probably be used for non-ascii ↵Dan Book2022-06-071-1/+5
| | | | delimiters
* Update checksums in some generated filesKarl Williamson2022-06-061-1/+4
| | | | | | | | 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.
* regen/embed.pl: Handle "literals" parametersKarl Williamson2022-05-291-3/+15
| | | | | These have long been accepted by autodoc, but could not be listed in embed.fnc until now.
* feature.pl: update for the v5.37 bundle (and regen)Ricardo Signes2022-05-271-1/+2
|
* Document that use feature 'defer' is still experimentalPaul "LeoNerd" Evans2022-05-241-0/+6
|
* regen/embed.pl: Allow perl_' prefix to namesKarl Williamson2022-05-181-2/+11
| | | | | | | | | | | | | | 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.
* Put 'bareword_filehandles' feature back into the v5.35 bundlePaul "LeoNerd" Evans2022-05-131-6/+3
|
* regen/mg_vtable.pl: Output section for perlapiKarl Williamson2022-05-091-0/+1
| | | | | | 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.
* regen/warnings.pl: rename $tre to $treeDavid Mitchell2022-05-041-13/+13
| | | | | Since the global variable $tree was renamed $TREE, we can now rename all the instances of a sub parameter $tre to '$tree'.
* regen/warnings.pl: add comments about $TREEDavid Mitchell2022-05-041-0/+17
| | | | | Explain this structure, which is the input used to define all the warnings.
* regen/warnings.pl: rename filehandle variablesDavid Mitchell2022-05-041-36/+39
| | | | | 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
* regen/warnings.pl: better comment what the subs doDavid Mitchell2022-05-041-0/+22
|
* regen/warnings.pl: eliminate broken dup checkDavid Mitchell2022-05-041-2/+0
| | | | | | | | 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.
* regen/warnings.pl: eliminate global %v_list varDavid Mitchell2022-05-041-7/+28
| | | | | This lexical had global scope. Instead, make it a parameter to sub valueWalk(), since it's only used temporarily by two subs.
* regen/warnings.pl: eliminate lexical var %ValueDavid Mitchell2022-05-041-2/+0
| | | | This doesn't seem to be used any more
* regen/warnings.pl: uppercase 'global' lexical varsDavid Mitchell2022-05-041-32/+41
| | | | | | | | | | | 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.)
* regen/warnings.pl: remove a block scopeDavid Mitchell2022-05-041-41/+39
| | | | | | 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.
* regen/warnings.pl: remove unused lexical variableDavid Mitchell2022-05-041-2/+0
| | | | $offset was added in 2000, but hasn't actually been used for a long while