| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
With RCPV strings we can use the RCPV_LEN() macro, and
make this logic a little less weird.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ->-
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The file was partly using 2 space indents, partly using 4 space indents,
and occasionally tabs. Standardize on 4 space indents using spaces.
|
|
|
|
| |
detected by make test_porting and fixed by make regen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Helps disentangle mixed up output
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
As it becomes obsolete
|
|
|
|
|
| |
Unicode 15.0 is revising the heading format for non-UCD files; Fix
mktables to be able to parse that.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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..
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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,.
|
|
|
|
|
| |
This includes indenting a block of code in anticipation of a future
commit which will form a conditional block around it
|
|
|
|
|
| |
This changes an inside-out hash reference to have a shorthand for it,
making for better readability
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
These functions were missed or broken by 4fe9356b250. They're used only
in debugging, so it wasn't noticed until now.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This failed to exit when the file handle was exhausted
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Add `my` to examples.
Don't exemplify indirect object syntax on one occasion.
|
|
|
| |
Add `my` to synopsis.
|
|
|
| |
Add `my` to synopsis.
|
|
|
|
|
|
|
|
|
| |
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 `my` on examples.
|
|
|
| |
Add `my` to examples for better practice.
|
|
|
| |
Add `my` to examples for better practice.
|
|
|
|
|
|
|
| |
Added `my` to Synopsis for better practice.
Repository points to GH:
https://metacpan.org/pod/File::stat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The former is always present; the latter might not be
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
`R` command: pure man -> poor man
Probably meant that:
https://en.wiktionary.org/wiki/poor_man%27s#English
|
|
|
|
|
|
|
|
| |
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
|