summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* cop.h - get rid of the STRLEN* stuff from cop_warningsYves Orton2022-11-021-1/+1
| | | | | With RCPV strings we can use the RCPV_LEN() macro, and make this logic a little less weird.
* warnings.h - length guard cop_warnings bitvector checksYves Orton2022-11-021-1/+1
|
* Enable `use feature 'module_true'`chromatic2022-11-011-6/+14
| | | | | | | | | | | Per RFC 18, whenever `use feature 'module_true';` is enabled in a scope, any file required with `require` has an implicit return value of true and will not trigger the "did not return a true value" error condition. This includes logic to use the OPf_SPECIAL flag for OP_RETURN listops to indicate that the module_true feature is in effect when it executes. This flag plays no role unless the OP_RETURN tail calls the pp_leaveeval logic, so it doesn't affect normal sub returns.
* OP_EMPTYAVHV - optimized empty ANONLIST/ANONHASHRichard Leach2022-10-242-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new OP to replace cases of OP_ANONLIST and OP_ANONHASH where there are zero elements, which is very common in Perl code. As an example, `my $x = {}` is currently implemented like this: ... 6 <2> sassign vKS/2 ->7 4 <@> anonhash sK* ->5 3 <0> pushmark s ->4 5 <0> padsv[$x:1,2] sRM*/LVINTRO ->6 The pushmark serves no meaningful purpose when there are zero elements and the anonhash, besides undoing the pushmark, performs work that is unnecessary for this special case. The peephole optimizer, which also checks for applicability of a related TARGMY optimization, transforms this example into: ... - <1> ex-sassign vKS/2 ->4 3 <@> emptyavhv[$x:1,2] vK*/LVINTRO,ANONHASH,TARGMY ->4 - <0> ex-pushmark s ->3 - <0> ex-padsv sRM*/LVINTRO ->-
* overload: bump versionGraham Knop2022-10-241-1/+1
|
* overload: only disable builtin warnings where blessed is calledGraham Knop2022-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Until recently, overload did not enable or disable any warnings. Instead, it would rely on the value of $^W, or the -w flag. When switching to use the builtin::blessed function, the code was changed to disable 'experimental::builtin' warnings. Since no other warnings are changed, the current active warning set is combined with this one disabled category, and baked in for the entire module. The currently active warning set is determined by $^W, so whatever its value was when overload was compiled would get baked in, and any runtime changes to $^W would no longer have any impact. The particular warning that would most commonly be emitted by overload is the sub redefinition warning, in case an overload was being overwritten. Various modules, such as JSON::PP and Cpanel::JSON::XS, were expecting to be able to overwrite overloads without any warnings. They would set $^W to false to prevent them. After the "no warnings 'experimental::builtin';" line was added, it became impossible to disable these warnings at runtime. Move the disabling of the experimental warnings to a smaller scope. This means that the rest of the module is restored to its previous state of having warnings controlled by $^W.
* overload: remove localizing of error varibles when not loading a moduleGraham Knop2022-10-241-2/+0
| | | | | | Localizing $@ and $! was added when the code was loading Scalar::Util at runtime. We're no longer loading any modules in this part of the code, so we don't need to localize anything.
* overload: clean up whitespaceGraham Knop2022-10-241-360/+364
| | | | | The file was partly using 2 space indents, partly using 4 space indents, and occasionally tabs. Standardize on 4 space indents using spaces.
* update B::Op_private version to match perl versionTony Cook2022-10-241-1/+1
| | | | detected by make test_porting and fixed by make regen
* end of file (^D on POSIX-likes) now behaves like q as documentedTony Cook2022-10-171-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was originally reported againt 5.36.0 where ^D would act more like 'n' than 'q': $ ~/perl/v5.36.0-clang14/bin/perl -lde 'print 1; print 2; print 3;' Loading DB routines from perl5db.pl version 1.73 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): print 1; print 2; print 3; DB<1> 1 main::(-e:1): print 1; print 2; print 3; DB<1> 2 main::(-e:1): print 1; print 2; print 3; DB<1> 3 (^D at each prompt) Post 80c1f1e4 this behaved a little differently, since reading ^D from the stream now sets the eof() flag readline() would return immediately after each attempt, instead of reading a command. This produced the same output as above, but only required a single ^D. But neither of these is correct, both 'q' and ^D are documented to exit the debugger, and 'q' does that, this changes eof to also exit the debugger. Unfortunately the perl5db test infrastructure doesn't support testing this, and due to the way the debugger interacts with the terminal, I don't think this is easily tested in core. I think a module like Expect or IPC::Run that can interact with a terminal would be needed.
* Compile anonymous subs as anoncode without srefgen.Felipe Gasper2022-10-101-3/+19
| | | | | | | | | | | | Heretofore the compiler represented an anonymous subroutine as an anoncode op then an srefgen op; the latter’s only purpose was to return a reference to the anoncode’s returned CV. This changeset slightly optimizes that by making pp_anoncode return a reference if so bidden. The same optimization is applied to pp_anonconst as well. Deparse.pm is updated accordingly.
* Add anonconst test to Deparse.tFelipe Gasper2022-10-101-0/+7
|
* mktables: flush output immediately when debuggingKarl Williamson2022-09-282-1/+2
| | | | Helps disentangle mixed up output
* Support Unicode 15.0Unicode Consortium2022-09-2861-2208/+4210
|
* mktables: Skip some new 15.0 filesKarl Williamson2022-09-282-1/+14
| | | | | | | | | These are newly delivered by Unicode. I haven't had time to analyze them for use for potential new properties. They deal with security issues of characters that look alike. I'm not adding them to the list of files under git, but they are explicitly mentioned in mktables to indicate their not being used.
* mktables: Skip some code for Unicode 15Karl Williamson2022-09-282-2/+4
| | | | As it becomes obsolete
* mktables: Revise Version line search in inputsKarl Williamson2022-09-282-13/+23
| | | | | Unicode 15.0 is revising the heading format for non-UCD files; Fix mktables to be able to parse that.
* mktables: Accept multiple @missing lines in input filesKarl Williamson2022-09-282-11/+78
| | | | | | | | | | | | | Unicode 15.0 will now use this approach to deal with ranges of code points that have a different default for unassigned code points than the table at large. For example, a table may have one default, but all Ideographic character ranges have something else. Prior to this new mechanism, the files had entries for each unassigned code point that had a different default than the global one. So this saves some lines in the files that Unicode delivers that were otherwise useless. Not all files in 15.0 have been converted to use the new scheme, for whatever reason.
* mktables: Multi_Default now accepts multiple defaults per propertyKarl Williamson2022-09-282-4/+19
| | | | | | Unicode 15.0 may have multiple @missing lines for a single property, that should use this class. This commit converts the storage into an array to accommodate that need..
* mktables: Add two methods to Multi_Default classKarl Williamson2022-09-282-5/+13
| | | | | | These are so that you don't have to know everything at construction time. The constructor function changes to call these with whatever it does get passed
* mktables: More closely examine @missing linesKarl Williamson2022-09-282-4/+15
| | | | | | These lines have all had the same range (all of Unicode). But in Unicode 15.0, there will be some with different ranges. This commit changes to save those values (which are currently still unused)
* mktables: Standardize value aliasesKarl Williamson2022-09-282-5/+38
| | | | | | | | | | | | | | As stated in the code comments added by this commit, Unicode has various spellings for the same property value. For example in some places it uses 'W', and in others 'Wide'. The legal spellings are listed in PropValueAliases.txt, which is processed early in the construction. So we can standardize things on input, which makes it easier later. This commit produces minimal changes in the generated tables, so that the algorithm can be verified by inspection of the results. And no other code that has hard-coded in expected spellings needs to be changed. Prior to this commit, we standardized the default value for properties that have a default value,.
* mktables: Add/Fix comments, white-spaceKarl Williamson2022-09-282-79/+95
| | | | | This includes indenting a block of code in anticipation of a future commit which will form a conditional block around it
* mktables: Use intermed variable to shorten nameKarl Williamson2022-09-282-23/+19
| | | | | This changes an inside-out hash reference to have a shorthand for it, making for better readability
* mktables: Convert array to hashKarl Williamson2022-09-282-10/+13
| | | | | | | | Prior to this commit we had a two element array, and it was known that element 0 contained a particular thing; and element 1 contained the other. But a future commit will add several elements, so keeping track of which is which will become more problematic. Solve this by using a hash instead, with the elements appropriately named.
* mktables: Fix some function signaturesKarl Williamson2022-09-282-8/+6
| | | | | These functions were missed or broken by 4fe9356b250. They're used only in debugging, so it wasn't noticed until now.
* mktables: Reorder some codeKarl Williamson2022-09-282-18/+18
| | | | | | | This moves some code ahead of other code so that the end of the sub all works on a single related issue. This is in preparation for 15.0, where that issue becomes moot, so we can then change to return early from the sub.
* mktables: Stop infinite loop with invalid inputKarl Williamson2022-09-282-1/+2
| | | | This failed to exit when the file handle was exhausted
* B::Deparse.pm - add padsv_store to list in sub retscalarRichard Leach2022-09-261-2/+2
| | | | | | | | | | | | Issue #20327 revealed that code that is expected to deparse to: &$uncompress(my $Tmp = shift()); has, since the addition of padsv_store, been deparsing to this: &$uncompress(scalar(my $Tmp = shift())); This seems to be because padsv_store was not added to a particular list of scalar OPs in B::Deparse.pm. Closes #20327.
* Reclaim unused bits in ${^WARNING_BITS}Philippe Bruhat (BooK)2022-09-242-211/+191
| | | | | | | | | | | | | | | | | | `no warnings 'experimental::foo';` is effectively a no-op if the `foo` feature is not experimental any more. So, stop reserving bits in `${^WARNING_BITS}` for them, and silently do nothing when they are enabled or disabled via `use warnings` or `no warnings`. Warnings turned into no-op in this commit: * experimental::alpha_assertions * experimental::bitwise * experimental::isa * experimental::lexical_subs * experimental::postderef * experimental::script_run * experimental::signatures
* Bump the perl version in various places for 5.37.5Karen Etheridge2022-09-201-1/+1
|
* wording fixKaren Etheridge2022-09-201-1/+1
|
* ext/lib - bump module versions on Opcode.pm, APItest and DeparseYves Orton2022-09-081-1/+1
|
* OP_AELEMFASTLEX_STORE - combined sassign/aelemfast_lexRichard Leach2022-09-072-0/+12
| | | | | | | | | | | | | | | | | | | | | | 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.
* Update synopses on User:: and Sys:: modulesElvin Aslanov2022-09-052-8/+8
|
* Update Struct.pmElvin Aslanov2022-09-051-8/+8
| | | | | Add `my` to examples. Don't exemplify indirect object syntax on one occasion.
* Update servent.pmElvin Aslanov2022-09-051-2/+2
| | | Add `my` to synopsis.
* Update protoent.pmElvin Aslanov2022-09-051-2/+2
| | | Add `my` to synopsis.
* Promote v5.36 usage and feature bundles docNicolas R2022-08-301-10/+12
| | | | | | | | | 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.
* [doc] Update File::Basename synopsisElvin Aslanov2022-08-301-5/+5
| | | Add `my` on examples.
* [doc] Update FileHandle synopsisElvin Aslanov2022-08-301-8/+8
| | | Add `my` to examples for better practice.
* [doc] Update File::Copy synopsisElvin Aslanov2022-08-301-6/+6
| | | Add `my` to examples for better practice.
* [doc] Update File::stat synopsisElvin Aslanov2022-08-261-2/+2
| | | | | | | Added `my` to Synopsis for better practice. Repository points to GH: https://metacpan.org/pod/File::stat
* Add OPpTARGET_MY optimization to OP_UNDEFRichard Leach2022-08-252-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* locale_threads.t: Use I18N::Langinfo, not POSIX::localeconv()Karl Williamson2022-08-221-1/+2
| | | | The former is always present; the latter might not be
* lib/locale.t: Use I18N::Langinfo, not POSIX::localeconv()Karl Williamson2022-08-221-4/+8
| | | | | | | Now that Langinfo is ported to every box, it requires less work than localeconv(), and offers more choices. This commit changes to use it, and for more info when debugging, gets some additional info from it, while avoiding some calls when not debugging
* Bumping perl version in various places for 5.37.4Neil Bowers2022-08-201-1/+1
|
* Implement OP_PADSV_STORE - combined sassign/padsv OPRichard Leach2022-08-172-5/+18
| | | | | | | | | | | | | | | | | | | | | 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.
* perl5db.pl: SpellingElvin Aslanov2022-08-051-3/+3
| | | | | | `R` command: pure man -> poor man Probably meant that: https://en.wiktionary.org/wiki/poor_man%27s#English
* Typo in "y" (PadWalker) command descriptionElvin Aslanov2022-08-041-2/+2
| | | | | | | | Fix: then -> them Also corrected "dumpvar.pl" to be rendered as a file name in POD rather than code/command. https://perldoc.perl.org/perlpod#F-used-for-filenames Bumped Perl Debugger version to pass t/porting/cmp-version.t test