| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was done by adding new OP_METHOD_REDIR and OP_METHOD_REDIR_SUPER optypes.
Class name to redirect is saved into METHOP as a shared hash string.
Method name is changed (class name removed) an saved into op_meth_sv as
a shared string hash.
So there is no need now to scan for '::' and calculate class and method names
at runtime (in gv_fetchmethod_*) and searching cache HV without precomputed hash.
B::* modules are changed to support new op types.
method_redir is now printed by Concise like (for threaded perl)
$obj->AAA::meth
5 <.> method_redir[PACKAGE "AAA", PV "meth"] ->6
|
|
|
|
|
| |
In non-DEBUGGING builds it would be replaced with nothing, producing
a syntax error
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was no way to get from a PMOP to its regexp object under non-
threaded builds. The threaded pmoffset field was exposed, but not its
non-threaded counterpart.
I implemented pmregexp in terms of PM_GETRE (which uses op_pmoffset
with threads and op_pmregexp without), so it works under threads, too.
It’s easier than conditionally using the regex_padav to get at things
like this:
$ ./perl -Ilib -MB -e 'use O "Concise", B::regex_padav->ARRAYelt(B::svref_2object(sub {qr/(??{})/})->ROOT->first->first->sibling->pmoffset)->qr_anoncv->object_2svref'
B::Concise::compile(CODE(0x7f8e9185ba08))
2 <1> leavesub[1 ref] K/REFC,1 ->(end)
1 </> qr() P/RTIME ->2
- <@> list K ->-
- <0> pushmark s ->-
- <1> null sK*/1 ->-
- <1> ex-scope sK ->(end)
- <0> stub s ->(end)
- <$> const(PV "(\077?{})") s ->-
-e syntax OK
With pmregexp, it is ‘only’:
$ ./perl -Ilib -MB -e 'use O "Concise", B::svref_2object(sub {qr/(??{})/})->ROOT->first->first->sibling->pmregexp->qr_anoncv->object_2svref'
|
|
|
|
| |
This should go with the other regexp tests.
|
|
|
|
| |
I forgot this in 0f94cb1fe.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
When pad names become their own type, separate from SVs, the ‘immor-
tal’ pad names, &PL_padname_undef and &PL_padname_const (to replace
&PL_sv_undef and &PL_sv_no), will no longer be B::SPECIAL objects,
but B::PADNAMEs. The way to distinguish them is to check the
length. This method happens to work both before and after the pad
name changes.
|
| |
|
| |
|
|
|
|
|
| |
They were defined in the structure passed to the general_tests func-
tion, but not all of them were used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to 5.16, pad names never used the UTF8 flag, and all non-ASCII
pad names were in UTF8. Because the latter was consistently true,
everything just worked anyway.
In 5.16, UTF8 handling was done ‘properly’, so that non-ASCII UTF8
strings were always accompanied by the UTF8 flag.
Now, it is still the case that the only non-ASCII names to make their
way into pad name code are in UTF8. Since ASCII is a subset of UTF8,
we effectively *always* have UTF8 pad names. So the flag handling is
actually redundant.
If we just assume that all pad names are UTF8 (which is true), then
we don’t need to bother with the flag checking. There is actually
no reason why we should have two different encodings for storing
pad names.
So this commit enforces what has always been the case and removes the
extra code for converting between Latin-1 and UTF8. Nothing on CPAN
is using the UTF8 flag with pads, so nothing should break. In fact,
we never documented padadd_UTF8_NAME.
|
|
|
|
| |
This is in preparation for making PADNAME a separate type.
|
|
|
|
|
|
|
|
|
|
|
| |
As of perl 5.18, pmops have a code_list pointer that points to a list
of ops representing the constants, variables and code blocks that
make up the regular expression. For run-time compilation, these ops
are also accessible via pmop->op_first->op_first (i.e., the kids of
the regcomp op), so they are already dumped. But for regexp compiled
at compile time, these ops were not being dumped. So this commit
makes them appear as kids of the pmop, right before the replacement
block in the case of subst.
|
|
|
|
| |
This is necessary to get to the code blocks in qr/(?{...})/.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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%.
|
| |
|
|
|
|
| |
It wasn’t updating the parent pointer after reallocating the op.
|
|
|
|
|
|
| |
See <20141126223250.GS19835@mars.tony.develop-help.com>
S_IFMT on os390 has the upper bit set but Perl is expecting an unsigned,
so force it to be so.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit f5fdb0259d5e9470e8291544a8b209e202d36334.
(the theory is that 7ff69a2d made this unnecessary)
|
|
|
|
|
|
|
|
|
|
| |
On Windows, the output was including
# 490-e syntax OK
# : $l->concise($level);
which does not match /(?^:\# 4\d\d: \s+ \$l->concise\(\$level\);)/,
hence the test failure.
|
| |
|
|
|
|
| |
skip_all isn't defined under Test::More.
|
|
|
|
|
| |
is_ascii_string's name has misled me in the past; the new name is
clearer.
|
| |
|
|
|
|
|
|
| |
Since -std=c89 (eq -ansi) simply isn't compatible with "inline static".
Based on a fix by TonyC.
|
|
|
|
|
|
|
| |
My fix to fix smokes broke something else.
(The people responsible for sacking the people who broke the builds, have
now been sacked.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some smokers run with PERL_UNICODE set; this has the side effect of
making Concise display nextstate ops with open hints flags, e.g.
nextstate(....) v:>,<,% ->8
where :... are the flags.
Concise 'golden samples' should have these flags set; they're stripped
from the expected output in the non-PERL_UNICODE case, rather than
being stripped from the actual output in the PERL_UNICODE case.
(It would probably make life easier if we did it the other way round.)
|
| |
|
| |
|
|
|
|
|
|
| |
Commit c6036734 changed the subject of an optimized constant function
rendering test to one from the Storable API (ie stable), but missed
the function name repeated in the test description. Fix that now.
|
|
|
|
|
|
|
|
|
|
| |
Former COPs still carry information with them, and to get to it I had
to have B::Deparse rebless the op object into B::COP.
This commit makes B use the right class to begin with. This happens
to make B::Concise output the extra information that nulled COPs carry
around with them, which was on my to-do list anyway, so I’m happy
about that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
8635e3c2 (5.21.6) changed the COP sequence numbers for nested blocks,
such that most BEGIN blocks (incl. ‘use’ statements) and sub declara-
tions end up in the right place. However, it had the side effect of
causing declarations at the end of the enclosing scope to fall out of
it and appear below.
This commit fixes that by adding an extra nulled COP to the end of the
enclosing scope if that scope ends with a sub, so the final declara-
tion gets deparsed before it.
The frequency of sub declarations at the end of the enclosing scope is
sufficiently low (I’m guessing a bit here) that this slight increase
in run-time memory usage is probably acceptable.
I had to change B::Deparse to deparse nulled COPs the same way it does
live COPs, which means we get more extraneous semicolons than before.
I hope to fix that in a forthcoming commit. I also ran into a B bug,
in that null ops are not presented to Perl code with the right op
class (see the blessing in the patch). I plan to fix that in a separ-
ate commit, too.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason extended characters were only being escaped in
the final component of the path, but not in the directory portion,
the one exception being dots. We need to give the entire path
the same treatment. There is probably considerable opportunity
for further consolidation and refactoring in what we escape, but
at least now ../foo bar/ correctly becomes [-.foo^_^_bar].
The reverse case has similar problems and is a TODO.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|