| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
In commit f99a5f08f203, I inadvertently made modifications to val-
ues return by list ‘constants’ affect what values are returned sub-
sequently.
It’s for this type of situation that PADTMP exists (values are never
referenced, but copied). So use it.
This is similar to 5608dcc62, which fixed #3105.
|
|
|
|
| |
This broke CPAN. Maybe we need to rethink this....
|
|
|
|
|
|
|
| |
I didn’t have this constant stuff ready as soon as I expected. I also
left a comment and a couple of ‘local $TODO’s lying around that don’t
need to be there. As a bonus, correct a typo in constant.pm’s docu-
mentation.
|
|
|
|
|
|
| |
Here we take advantage of the array-ref-stash-elem mechanism added in
the previous commit, which causes the actual elements of the stored
array to be pushed on to the stack.
|
|
|
|
| |
I didn’t have this done in time for 5.19.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes bugs #21979, #89188, #109746, #114838 and #115388 and
mostly fixes #109744 and #105906 (other issues still remain in those
two tickets).
Because the PADTMP flag was doing double duty, indicating that a
pad slot was in use in addition to indicating a target, constants
could not be shared between pad slots, as freeing one const op (and
turning of its PADTMP flag in pad_free) would mark some other pad
slot as free.
I believe this may have been fixed already by change 3b1c21fabed,
which made const ops use pad_swipe (which removes the SV from the
pad) instead of pad_free (which marks it as available for reuse). But
the copying still happens.
In any case, as of the previous commit, whether a pad slot for a con-
stant is in use is now stored in the pad name. Slots in use for const
ops now have &PL_sv_no names.
So there is no longer any reason to copy the constants.
The difference can be observed thus:
Before:
$ ./perl -lIlib -MDevel::Peek -e 'sub foo(){42} Dump foo; Dump foo'
SV = IV(0x7f94ea02ef10) at 0x7f94ea02ef20
REFCNT = 2
FLAGS = (PADTMP,IOK,READONLY,pIOK)
IV = 42
SV = IV(0x7f94ea02eeb0) at 0x7f94ea02eec0
REFCNT = 1
FLAGS = (PADTMP,IOK,READONLY,pIOK)
IV = 42
After:
$ ./perl -lIlib -MDevel::Peek -e 'sub foo(){42} Dump foo; Dump foo'
SV = IV(0x7f894882ef10) at 0x7f894882ef20
REFCNT = 3
FLAGS = (IOK,READONLY,pIOK)
IV = 42
SV = IV(0x7f894882ef10) at 0x7f894882ef20
REFCNT = 3
FLAGS = (IOK,READONLY,pIOK)
IV = 42
Notice the different addresses.
There are still special cases for copying &PL_sv_undef, which I need
to tackle.
Since most constants created by ‘use constant’ have the PADMY flag on
(since they reside in lexical variables inside constant.pm) and PADMY
and PADTMP are exclusive, I have stop turning on PADTMP for constants.
It is no longer necessary now, since before its purpose was to mark
pad entries as being in use. That means many to-do tests pass.
|
|
|
|
| |
including many to-do tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch contributed by Sébastien Aperghis-Tramoni
For: RT #114770.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch blead
# Your branch is ahead of 'origin/blead' by 1 commit.
#
# Changes to be committed:
# (use "git reset HEAD^1 <file>..." to unstage)
#
# modified: dist/constant/lib/constant.pm
# modified: dist/constant/t/constant.t
#
|
| |
|
|
|
|
|
|
| |
Because sub lookup (and glob lookup in general) ignores the UTF8
flag, such subs are actually ‘correctly’ stored under the utf8-encoded
equivalent of the name, and not the name itself.
|
|
|
|
|
|
|
|
|
| |
Commit e5c69c9b added the test to dist/constant/t/constant.t, probably because
the bug was initially reported in combination with constant.pm. However, it was
a core bug in gv_init and can be reproduced easily without constant.pm.
With this change dist/constant can be safely synced back to CPAN without having
to SKIP or TODO this particular test.
|
|
|
|
|
|
|
|
|
| |
gv_init() has name and len args, but newCONSTSUB() (which it calls)
doesn't have a len arg, so any trailing garbage in name gets used by
newCONSTSUB.
In the test case, this means that we end up attaching the const CV
to both the "FOO" and qq{FOO, "\\n";\n} GVs. So it gets freed twice.
|
| |
|
|
|