| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This is in preparation for making PADNAME a separate type.
|
|
|
|
|
|
|
|
|
| |
This is in preparation for making PADNAME a separate type.
This commit is not perfect. What I did was temporarily make PADNAME a
separate struct identical to struct sv and make whatever changes were
necessary to avoid compiler warnings. In some cases I had to add tem-
porary SV casts.
|
|
|
|
|
|
|
|
|
|
| |
As of 7777302a PERL_ARGS_ASSERT_NEWRV_NOINC has been failing an asser-
tion, because the variable mentioned in embed.fnc (which the macro
uses) is not the function’s parameter, but another, uninitial-
ised variable.
This disparity between the variable names in the function definition
and its prototype goes back to e3b8966e2a.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In ck_method:
Scan for '/::. If found SUPER::, create OP_METHOD_SUPER op
with precomputed hash value for method name.
In B::*, added support for method_super
In pp_hot.c, pp_method_*:
S_method_common removed, code related to getting stash is
moved to S_opmethod_stash, other code is moved to
pp_method_* functions.
As a result, SUPER::func() calls speeded up by 50%.
|
|
|
|
|
|
| |
This is a more accurately named synonym for is_ascii_string(), which is
retained. The old name is misleading to someone programming for
non-ASCII platforms.
|
|
|
|
| |
There's no reason to call it otherwise; there are no side effects.
|
|
|
|
| |
It doesn’t need it.
|
|
|
|
|
|
| |
This is in preparation for making the retrieval more complex in future
commits than it is now. This is going into mg.c because the value is
magical.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Based on commit 73758d77 (by me), in commit 117af67d629 more things got
noreturn removed on MSVC. See also ML post
"(Hugmeir) Re: [perl.git] branch blead, updated. v5.21.0-377-gdc3bf40"
This caused a measurable increase in machine code size in 117af67d629 .
In commit 73758d77 , the reason there was no increase is
Perl_magic_regdatum_set is called only through a magic vtable. Optimizing
this to noreturn is forbidden unless the struct member type specifies it
(and it obviously doesn't, since this is the magic vtable).
The other not-noreturn on MSVC function, Perl_screaminstr, has no core
usage (its only reference is in the export table) or CPAN grep usage so
therefore it is being removed. It was made fatal in commit 9e3f0d16db .
before .text section of perl521.dll on VC 2003 32b, 0xc66a3 bytes, after
0xc6453
|
|
|
|
| |
This is explained in the added perldiag entry.
|
|
|
|
| |
It is no longer called from any other file.
|
|
|
|
|
|
|
|
| |
op_const_sv is actually two functions in one. This particular calling
convention (CvCONST) was used only by cv_clone.
Half the code was not even necessary for cv_clone’s use (the other
half only for its use), so this reduces the total number of lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It probably stopped being inlinable in commit beab0874143b.
Following op_next pointers to see whether a sub’s execution chain con-
sists of a constant followed by sub exit does not make sense if the
op_next pointers have not been set up yet.
So call LINKLIST earlier, so that we can merge the two calls to
op_const_sv in newATTRSUB (no need to search for constants twice).
That will allow sub () { 0; 3 } to be inlined once more, as it was in
perl 5.005 (I checked) and probably in 5.6, too (I didn’t check).
This also allows us to remove initial the OP_LINESEQ check, which
was added to help this function into the block when we have no
op_next pointers.
op_const_sv is now called only before the peephole optimiser and
finalize_op, which removes the need for the special explicit return
check (it hasn’t been optimised out of the execution chain yet) and
the need to account for constants that have been relocated to the pad
by finalize_op.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the new PadnameLVALUE flag, we can detect cases where an outer
lexical is used multiple times in lvalue context. If the subroutine
contains just a lexical variable and nothing else, deprecate this
behaviour, so we can change it not to break the closure pattern at
some future date.
Future commits will fix those cases where the subroutine contains more
than just a lexical variable, without a deprecation cycle.
Adding this code to op_const_sv doesn’t really make sense. More to
the point, having S_cv_clone_pad call op_const_sv doesn’t make sense,
but changing that (moving this code directly to S_cv_clone_pad) will
require other refactorings to avoid breaking some cases of constant
(real constant) inlining, such as sub(){$x++ if 0; 3}, which cur-
rently gets inlined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- this improves the error message on ABI incompatibility, per
[perl #123136]
- reduce the number of gv_fetchfile calls in newXS over registering many
XSUBs
- "v" was not stripped from PERL_API_VERSION_STRING since string
"vX.XX.X\0", a typical version number is 8 bytes long, and aligned to
4/8 by most compilers in an image. A double digit maint release is
extremely unlikely.
- newXS_deffile saves on machine code in bootstrap functions by not passing
arg filename
- move newXS to where the rest of the newXS*()s live
- move the "no address" panic closer to the start to get it out of the way
sooner flow wise (it nothing to do with var gv or cv)
- move CvANON_on to not check var name twice
- change die message to use %p, more efficient on 32 ptr/64 IV platforms
see ML post "about commit "util.c: fix comiler warnings""
- vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by
a C debugger in an unoptimized build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 2f9970be0 (5.13.9) caused the lhs to be written to with 0
before the chomp happens, and then incremented for each chomp on the
rhs argument.
That makes
my $a = $/ = 7;
$a = chomp $a;
print $a;
print 0 instead of 1 and makes
my $a = $/ = 0;
$a = chomp $a;
assign the empty string to $a instead of 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API elevates the amount of ABI compatibility protection between XS
modules and the interp. It also makes each boot XSUB smaller in machine
code by removing function calls and factoring out code into the new
Perl_xs_handshake and Perl_xs_epilog functions.
sv.c :
- revise padlist duping code to reduce code bloat/asserts on DEBUGGING
ext/DynaLoader/dlutils.c :
- disable version checking so interp startup is faster, ABI mismatches are
impossible because DynaLoader is never available as a shared library
ext/XS-APItest/XSUB-redefined-macros.xs :
- "" means dont check the version, so switch to " " to make the test in
xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION
is CPP defined but "", mow what?"
ext/re/re.xs :
- disable API version checking until #123007 is resolved
ParseXS/Utilities.pm :
109-standard_XS_defs.t :
- remove context from S_croak_xs_usage similar to core commit cb077ed296 .
CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and
by then core's croak_xs_uage API has been long available and this
backport doesn't need to account for newer perls
- fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
|
|
|
|
|
|
|
| |
We control both strings. Perl API versions are not old decimal or alphas
versions. Maints dont increase Perl API ver. Just do a memcmp. Faster and
less machine code. Before 0xA6 bytes of machine code on VC 2003 32b,
after 0x35. This patch is related to [perl #123136].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the implicit close() fails, warn about it, mentioning $! in the
message. This is a default warning in the io category.
We do this in two spots, sv_clear and gp_free. While sv_clear would
be sufficient to get the warning emitted, the warning won’t contain
the name of the handle when called from there, because lone IO thing-
ies are nameless. Doing it also when a GV’s glob pointer is freed--as
long as the IO thingy in there has a reference count of 1--allows the
name to be included in the message, because we still have the glob,
which is where the name is stored.
The result:
$ ./miniperl -Ilib -e 'open fh, ">/Volumes/Disk Image/foo"; print fh "x"x1000, "\n" for 1..50; undef *fh'
Warning: unable to close filehandle fh properly: No space left on device at -e line 1.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CvRESERVED is a placeholder, it will be replaced with a sentinal value
from future revised BOOTCHECK API.
CvPADLIST_set was helpful during development of this patch, so keep it
around for now.
PoisonPADLIST's magic value is from PERL_POISON 0xEF pattern. Some
PoisonPADLIST locations will get code from future BOOTCHECK API.
Make padlist_dup a NN function to avoid overhead of calling it for XSUBs
during closing.
Perl_cv_undef_flags's else if (CvISXSUB(&cvbody)) is to avoid whitespace
changes.
Filed as perl [#123059].
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This optimisation, added in 7d3c8a683, nulls the list+pushmark pair if
it occurs in list context, since the two ops effectively cancel each
other out. I recently extended it in 8717a761e to apply to void con-
text, too.
It works by checking in the peephole optimiser whether the sibling of
the current op is a list with a pushmark kid:
1 current op
4 list
2 pushmark
3 ...
5 ...
That means the optimisation doesn’t happen if the elder sibling of the
list op is something that is not part of the execution chain, such as
$package_var:
- ex-rv2sv
1 gvsv
4 list
2 pushmark
3 ...
5 ...
because the ex-rv2sv is never the ‘current op’. So ($_,($_,$_))
doesn’t get optimised.
We can’t just handle this when ‘pushmark’ or ‘list’ is the current
op, because, in the former case, there is no way to get to the parent
op to null it; in the latter case, there is no way to get to the op
pointing to pushmark, to rethread the op_next pointers.
However, handling this when list or void context is applied, before we
even get to the peephole optimiser, just works, and requires much less
code. We can just null the ops there, and leave it to the peephole
optimiser’s handling of null ops to rethread op_next pointers.
This breaks this convention:
op_prepend_elem(OP_LIST, foo, list(that_list))
by creating two redundant null ops that were not there before, but the
only pieces of code doing that were calling list() needlessly anyway.
|
|
|
|
|
|
| |
Sometimes we want things to fit exactly into a specific number
of chars, elipses, quotes and all. Includes make regen update
to make dsv argument nullok.
|
|
|
|
|
|
| |
Requires adding a new optional argument to regprop as we do not
have a completed regexp object to give us the names, and we need
to get it from RExC_state.
|
|
|
|
| |
instead of stringify(join(...)).
|
|
|
|
|
| |
I just couldn’t resist using the backslash for the character, even
though I had to tweak mg_vtable.pl to make it work.
|
|
|
|
| |
\$::x = ... works, but not \local $x yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No \my$x= yet. Only my $x; \$x =....
It does not work properly with variables closed over from outside;
hence, all the to-do tests fail still, since they do the assign-
ment in evals.
But this much works:
$ ./miniperl -Ilib -Mfeature=:all -e 'my $m; \$m = \$n; warn \$m; warn \$n'
Lvalue references are experimental at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously in PUSH_EXTEND_MORTAL__SV_C, "PL_tmps_ix + 1" would execute
twice, once for the nonmutable if(>=), then again after the potential
tmps_grow call. tmps_grow has an unused return register/void proto, put it
to use by returning ix. Also change tmps_grow to take the result of
"PL_tmps_ix + the constant (usually 1) or non-constant (EXTEND_MORTAL)".
This avoid having to put the constant twice in machine code, once for the
if test, 2nd time for extend length param for tmps_grow call. For
non-constant/EXTEND_MORTAL usage, it allows the C optimizer to have the
length var to go out of liveness sooner if possible. Also the var used for
the if(>=) test is more likely to be in a register than length var.
So "if test variable" is closer on hand to the CPU than length var. In some
cases, if non-const len var isn't used again, it becomes the "ix" variable
by having PL_tmps_ix added to it. Change sv_2mortal to return sv instead
of NULL to remove a unique branch/block of machine code that assigns 0 to
return variable (Visual C didn't figure out return sv == returned NULL,
not sv). See also [perl #121845].
|
|
|
|
|
|
|
|
|
| |
This prevents perl recursing infinitely when an overloaded object is
assigned to $DB::single, $DB::trace or $DB::signal
This is done by referencing their values as IVs instead of as SVs in
dbstate, and by adding magic to those variables so that assignments to
the scalars update the PL_DBcontrol array.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sv.c and toke.c have the following warnings on VC6 but not VC 2003
(and probably newer too), example
..\toke.c(3149) : warning C4761: integral size mismatch in argument;
conversion supplied
find_default_stash (commit 90aeefb473 )& gv_magicalize (commit 71c35c050e )
..\gv.c(1680) : warning C4028: formal parameter 6 different from declaration
..\gv.c(1783) : warning C4028: formal parameter 6 different from declaration
not all VC6 compiler warnings are fixed by this patch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new opcode class, METHOP, which will hold class/method related
info needed at runtime to improve performance of class/object method
calls, then change OP_METHOD and OP_METHOD_NAMED from being UNOP/SVOP to
being METHOP.
Note that because OP_METHOD is a UNOP with an op_first, while
OP_METHOD_NAMED is an SVOP, the first field of the METHOP structure
is a union holding either op_first or op_sv. This was seen as less messy
than having to introduce two new op classes.
The new op class's character is '.'
Nothing has changed in functionality and/or performance by this commit.
It just introduces new structure which will be extended with extra
fields and used in later commits.
Added METHOP constructors:
- newMETHOP() for method ops with dynamic method names.
The only optype for this op is OP_METHOD.
- newMETHOP_named() for method ops with constant method names.
Optypes for this op are: OP_METHOD_NAMED (currently) and (later)
OP_METHOD_SUPER, OP_METHOD_REDIR, OP_METHOD_NEXT, OP_METHOD_NEXTCAN,
OP_METHOD_MAYBENEXT
(This commit includes fixups by davem)
|
|
|
|
|
|
|
|
|
|
|
|
| |
See ff2a62e0c8 for the explanation. The bug fix in that commit did
not apply to foreach’s aliasing.
In short, ($a,$b)=($c,$d) needs to account for whether two of those
variable names could be referring to the same variable.
This commit causes the test suite to exercise a code path in scope.c
added by ff2a62e0c8, which turned out to be buggy. (I forgot to test
it at the time.)
|
|
|
|
|
|
|
|
|
|
|
| |
This operator works like <> or <ARGV>, as it reads the list of file
names to open from the command-line arguments. However, it disables
the magic-open feature (that forks to execute piped commands) :
$ bleadperl -e 'while(<>){print}' 'echo foo |'
foo
$ bleadperl -e 'while(<<>>){print}' 'echo foo |'
Can't open echo foo |: No such file or directory at -e line 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A synthetic start class (SSC) is generated by the regular expression
pattern compiler to give a consolidation of all the possible things that
can match at the beginning of where a pattern can possibly match.
For example
qr/a?bfoo/;
requires the match to begin with either an 'a' or a 'b'. There are no
other possibilities. We can set things up to quickly scan for either of
these in the target string, and only when one of these is found do we
need to look for 'foo'.
There is an overhead associated with using SSCs. If the number of
possibilities that the SSC excludes is relatively small, it can be
counter-productive to use them.
This patch creates a crude sieve to decide whether to use an SSC or not.
If the SSC doesn't exclude at least half the "likely" possiblities, it
is discarded. This patch is a starting point, and can be refined if
necessary as we gain experience.
See thread beginning with
http://nntp.perl.org/group/perl.perl5.porters/212644
In many patterns, no SSC is generated; and with the advent of tries,
SSC's have become less important, so whatever we do is not terribly
critical.
|
|
|
|
|
|
|
| |
This adds a function to allocate a regnode with 2 32-bit arguments, and
uses it, rather than the ad-hoc code that did the same thing previously.
This is in preparation for this code being used in a 2nd place in a
future commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This causes the nearly-duplicate code of S_reg_node and S_reganode to be
placed into a single function, S_regnode_guts.
There is one place where it might not be obvious that this doesn't
change things. And that is under DEBUGGING, reg_node() called
Set_Node_Offset(RExC_emit, RExC_parse + (op == END));
and reganode called
Set_Cur_Node_Offset;
However Set_Cur_Node_Offset is defined to be
Set_Node_Offset(RExC_emit, RExC_parse)
and since op will never be END for reganode, the two statements are
equivalent.
|
|
|
|
|
|
|
| |
sprintf, pack and chr were treating 0+"Inf" and "Inf" differently,
even though they have the same string and numeric values.
pack was also croaking for 0+"Inf" passed to a string format.
|
|
|
|
|
|
|
|
|
|
| |
One of the main purposes of cv_name was to provide a way for CPAN mod-
ules easily to obtain the name of a sub. As written, it was not
actually sufficient, as some modules, such as Devel::Declare, need an
unqualified name.
So I am breaking compatibility with 5.21.4 (which introduced cv_name,
but is only a dev release) by adding a flags parameter.
|
| |
|
|
|
|
|
| |
It now does more than that, so use a name that describes when it is
called, rather than what it does.
|
|
|
|
|
| |
Instead of setting aside the name, calling cv_undef, and then naming
the sub anew, just pass a flag to tell cv_undef not to unname it.
|
| |
|
|
|
|
| |
I’m about to change this code anyway, and it’s easier in one spot.
|
|
|
|
| |
I’m about to change this code anyway, and it’s easier in one spot.
|
|
|
|
|
|
|
|
| |
This is like cv_set_call_checker, except that it allows the caller to
decide whether the call checker needs a GV.
Currently the GV flag is recorded, but ck_subr does not do anything
with it yet.
|