| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
A further note: while debugging this issue it was annoying that
Devel::Peek::Dump doesb't actually dump the HASH elements when an
iterator is active. Also added is a patch that does the iteration to
dump the HASH contents by iterating over it by hand (not disturbing
any active iterator). With that it also doesn't activate hash magic
during iteration, which I think is a feature
|
|
|
|
|
|
|
| |
This reverts commit 002beaef76a1595af2e39ffd4cd55c595bd6c271.
I am about to apply the manual-iteration patch from ticket #85026.
It conflicts with 002beaef, but it also renders 002beaef unnecessary.
|
| |
|
|
|
|
|
|
| |
As it's a 1 to 1 mapping with the vtables in PL_magic_vtables[], refactor
Perl_do_magic_dump() to index into it directly to find the name for an
arbitrary mg_virtual, avoiding a long switch statement.
|
|
|
|
|
| |
Also, in Perl_sv_magic() merge the case for PERL_MAGIC_dbfile with the others
that return a NULL vtable.
|
|
|
|
|
| |
Magic with a NULL vtable is equivalent to magic with a vtable of all 0s.
On CPAN, only Apache::Peek's code for 5.005 is referencing it.
|
|
|
|
| |
This turns out to be a simpler solution than 9ba75e3cf905a6e6.
|
|
|
|
|
|
|
|
| |
This should reduce the complexity of code dealing with GVs, as they no longer
try to play several different incompatible roles.
(As suggested by Ben Morrow. However, it didn't turn out to be as
straightforward as one might have hoped).
|
| |
|
|
|
|
|
| |
In Perl_find_rundefsv() and PAD_COMPNAME_FLAGS_isOUR(), replace longhand flags
test with SvPAD_OUR().
|
|
|
|
|
|
|
| |
The memory is used for part of the FBM state.
Tidy the order of conditions in the if() determining whether the IV/UV should
be shown.
|
|
|
|
|
|
|
|
| |
The check for whether to use 3 digits of octal was not correct, and was capable
of reading the byte beyond the passed in buffer. Except for the small
possibility that that byte was not mapped memory, it wouldn't change the
semantic correctness of the escaped output, but it would lead to
non-deterministic choice of which format to use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This:
commit 8aacddc1ea3837f8f1a911d90c644451fc7cfc86
Author: Nick Ing-Simmons <nik@tiuk.ti.com>
Date: Tue Dec 18 15:55:22 2001 +0000
Tidied version of Jeffrey Friedl's <jfriedl@yahoo.com> restricted hashes
- added delete of READONLY value inhibit & test for same
- re-tabbed
p4raw-id: //depot/perlio@13760
essentially deprecated HvKEYS() in favor of HvUSEDKEYS(); this is
explained in line 144 (now 313) of file `hv.h':
/*
* HvKEYS gets the number of keys that actually exist(), and is provided
* for backwards compatibility with old XS code. The core uses HvUSEDKEYS
* (keys, excluding placeholdes) and HvTOTALKEYS (including placeholders)
*/
This commit simply puts that into practice, and is equivalent to running
the following (at least with a35ef416833511da752c4b5b836b7a8915712aab
checked out):
git grep -l HvKEYS | sed /hv.h/d | xargs sed -i s/HvKEYS/HvUSEDKEYS/
Notice that HvKEYS is currently just an alias for HvUSEDKEYS:
$ git show a35ef416833511da752c4b5b836b7a8915712aab:hv.h | sed -n 318p
#define HvKEYS(hv) HvUSEDKEYS(hv)
According to `make tests':
All tests successful.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Formats are compiled down to a sequence of U32 opcodes in doparseform().
Previously the block of opcodes was stored in the buffer of SvPVX() after
the raw string by extending the buffer, and calculating the first U32 aligned
address after SvCUR(). A flag bit on the scalar was set to signal this hackery,
tested with SvCOMPILED()
The flag bit used happened to be the same as one of the two used by to signal
Boyer-Moore compiled scalars. The assumption was that no scalar can be used for
both. Unfortunately, this isn't quite true.
Given that the scalar is alway upgraded to PVMG to add PERL_MAGIC_fm magic,
to clear the cached compiled version, there's no extra memory cost in using
mg_ptr in the MAGIC struct to point directly to the block of U32 opcodes. The
test for "is there a compiled version" can switch to mg_find(..., PERL_MAGIC_fm)
returning a pointer, and the use of a flag bit abolished.
Retain SvCOMPILED() and SvCOMPILED_{on,off}() as compatibility for XS code on
CPAN - the first is always 0, the other two now no-ops.
|
| |
|
|
|
|
|
| |
Now that a regexp is a first-class SV, dump all the fields
of the 'struct regexp': it's just another SV body type
|
|
|
|
|
| |
SVt_REGEXP was in the 'general SV fields' section; move it to the
'type-specific SV fields' section. Not that it does anything yet.
|
|
|
|
|
|
| |
Make this long function easier on the eye by separating "paragraphs"
with a blank lines, and with a comment at the start of each major
section.
|
|
|
|
|
| |
This was a temporary type used while regexes were in the process
of being promoted to first-class SVs
|
| |
|
|
|
|
| |
xmldump_all.
|
|
|
|
|
|
|
| |
This patch adds an option to pv_escape() to dump all characters above ASCII
in hex. Before, you could get all chars as hex or the Latin1 non-ASCII
as octal, whereas the typical values for these that people think in are
given in hex.
|
| |
|
|
|
|
|
| |
Simpler code avoids the need for a comment explaining how the complex code was
working. Also use newSVpvs_flags() in place of sv_newmortal() and sv_setpv().
|
|
|
|
|
| |
This avoids a lot of casting. Nothing outside the perl core code is accessing
that member directly.
|
| |
|
|
|
|
| |
Remove quotation marks and, as a bonus, eliminate a compiler warning.
|
|
|
|
|
| |
Also rearrange the flags according to their value and trim some trailing
whitespace in that area.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New magic type PERL_MAGIC_checkcall attaches a function to a CV, which
will be called as the second half of the op checker for an entersub
op calling that CV. Default state, in the absence of this magic,
is to process the CV's prototype if it has one, or apply list context
to all the arguments if not. New API functions cv_get_call_checker()
and cv_set_call_checker() provide a clean interface to this facility,
hiding the internal use of magic.
Expose in the API the new functions rv2cv_op_cv(),
ck_entersub_args_list(), ck_entersub_args_proto(), and
ck_entersub_args_proto_or_list(), which are meaningful segments of
standard entersub op checking and are likely to be useful in plugged-in
call checker functions.
Expose new API function op_contextualize(), which is a public interface
to the internal scalar()/list()/scalarvoid() functions. This API is
likely to be required in most plugged-in call checker functions.
Incidentally add new function mg_free_type(), in the API, which will
remove magic of one type from an SV. (mg_free() removes all magic,
and there isn't anything else more selective.)
|
|
|
|
| |
This is left over from PERL_OBJECT (see beeff2, 16c915, and so on).
|
|
|
|
|
| |
Anywhere an API function takes a string in pvn form, ensure that there
are corresponding pv, pvs, and sv APIs.
|
|
|
|
|
| |
While one certainly can argue the merits of using a class name like "\0", it is legal
so lets avoid it confusing our primary debugging tool.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are left from PERL_OBJECT, which was an implementation of
multiplicity using C++ objects. PERL_OBJECT was removed in 5.8, but the
macros seem to have been cargo-culted all over the core (including in
places where they would have been inappropriate originally). Since they
now do exactly nothing, it's cleaner to remove them.
I have left the definitions in perl.h, under #ifndef PERL_CORE, since
some CPAN XS code uses them (also often incorrectly). I have also left
STATIC alone, since it seems potentially more useful and is much more
ingrained.
The only appearance of these macros this patch doesn't touch is in
Devel-PPPort, because that's a CPAN module.
|
|
|
|
|
| |
Rather than just recording whether an SV was cloned (sv->sv_debug_cloned),
record the address of the SV we were cloned from.
|
| |
|
| |
|
|
|
|
|
|
| |
When dumping an HV, we skip dumping the elements if the iterator is
already in use. Explain this in the dump output so people like me aren't
left wondering why the elements have vanished.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
after the recent commit 803f274831f937654d48f8cf0468521cbf8f5dff,
the CvGV field is sometimes reference counted. Since it was intended that
the reference counting would happen only for anonymous CVs, the CVf_ANON
flag was co-opted to indicate whether RC was being used. This is not
entirely robust; for example, sub __ANON__ {} is a non-anon sub which
points to the same GV used by anon subs, which while itself doesn't
directly break things, shows that the potential for breakage is there.
So add a separate flag just to indicate the reference count status of the
CvGV field.
|
| |
|
|
|
|
|
|
|
|
|
| |
Thus silencing compiler noise like:
OP_PRIVATE_ONCE(op_aassign, OPpASSIGN_COMMON, ",COMMON");
........................................................^
%CC-I-EXTRASEMI, Extraneous semicolon.
at line number 846 in file D0:[craig.blead]dump.c;1
|
| |
|
| |
|
|
|
|
| |
Refactor the macro append_flags() in dump.c to use it.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Convert repetitive sequences of "if this bit is set, append that string" into
structures and a function call. Use a custom macro append_flags() to make
calling it easer.
This makes the object code slightly smaller.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous commit made various ops such as rv2av unconditionally do
an SvGETMAGIC(). Under some circumstances this could cause a double
mg_get() (and hence double FETCH etc). In particular, when the
proceeding op was something like aelem with OPpDEREF, the aelem would
call vivify_ref(), which would call magic. So in peep(), mark
OP_RV2[SAH]V ops with the new OPpDEREFed flag if the preceding op was
OPpDEREF. Then use this flag to avoid a second dose of magic.
Note that RV2GV probably needs this flag too, but there weren't any
spare private flag bits left for that op (I think).
|