| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Someone missed an '_' in the name in the comment, the correct
name is 'PL_in_eval' not 'PL in_eval'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In GH 20435 many typos in our C code were corrected. However, this pull
request was not applied to blead and developed merge conflicts. I
extracted diffs for the individual modified files and applied them with
'git apply', excepting four files where patch conflicts were reported.
Those files were:
handy.h
locale.c
regcomp.c
toke.c
We can handle these in a subsequent commit. Also, had to run these two
programs to keep 'make test_porting' happy:
$ ./perl -Ilib regen/uconfig_h.pl
$ ./perl -Ilib regen/regcomp.pl regnodes.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we have no need for an empty shared string, but there is no
reason it should not be possible. This patch reworks the internals so it
is possible to create one without triggering asserts. Currently we don't
use this, but it seems reasonable that someone might want it in the
future. Under DEBUGGING we will still assert if someone tries to create
an empty RCPV unless the flag specifies it should be allowed.
At the same time the docs for rcpv_new() have been cleaned up a bit to
be more correct and reflect what actually happens inside.
This changes things so that the len member of the RCPV structure is
always non-zero in a well formed structure by accounting for the null
we add to the end explicitly. The RCPV_LEN() macro continues to return
the old value (not including the null).
|
|
|
|
|
| |
With RCPV strings we can use the RCPV_LEN() macro, and
make this logic a little less weird.
|
|
|
|
|
|
| |
this allows multiple ops to share the same underlying
warning bit vector. the vectors are not deduped, however
they are efficiently copied and shared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a weird bifurcation of the cop logic around threads. With
threads we use a char * cop_file member, without it we use a GV * and
replace cop_file with cop_filegv.
The GV * code refcounts filenames and more or less efficiently shares
the filename amongst many opcodes. However under threads we were
simplify copying the filenames into each opcode. This is because in
theory opcodes created in one thread can be destroyed in another. I say
in theory because as far as I know the core code does not actually do
this. But we have tests that you can construct a perl, clone it, and
then destroy the original, and have the copy work just fine, this means
that opcodes constructed in the main thread will be destroyed in the
cloned thread. This in turn means that you can't put SV derived
structures into the op-tree under threads. Which is why we can not use
the GV * stategy under threads.
As such this code adds a new struct/type RCPV, which is a refcounted
string using shared memory. This is implemented in such a way that code
that previously used a char * can continue to do so, as the refcounting
data is located a specific offset before the char * pointer itself.
This also allows the len data to embedded "into" the PV, which allows
us to expose macros to acces the length of what is in theory a null
terminated string.
struct rcpv {
UV refcount;
STRLEN len;
char pv[1];
};
typedef struct rcpv RCPV;
The struct is sized appropriately on creation in rcpv_new() so that the
pv member contains the full string plus a null byte. It then returns a
pointer to the pv member of the struct. Thus the refcount and length and
embedded at a predictable offset in front of the char *, which means we
do not have to change any types for members using this.
We provide three operations: rcpv_new(), rcpv_copy() and rcpv_free(),
which roughly correspond with newSVpv(), SvREFCNT_inc(), SvREFCNT_dec(),
and a handful of macros as well. We also expose SAVERCPVFREE which is
similar to SAVEGENERICSV but operates on pv's constructed with
rcpv_new().
Currently I have not restricted use of this logic to threaded perls. We
simply do not use it in unthreaded perls, but I see no reason we
couldn't normalize the code to use this in both cases, except possibly
that actually the GV case is more efficient.
Note that rcpv_new() does NOT use a hash table to dedup strings. Two
calls to rcpv_new() with the same arguments will produce two distinct
pointers with their own refcount data.
Refcounting the cop_file data was Tony Cook's idea.
|
|
|
|
|
|
|
|
|
|
|
| |
All current features are compile-time, so this hasn't been an issue,
but my current implementation of the autovivification issue checks
features at runtime, which failed to work correctly if non-bundle
features were set.
This commit fixes things so that run-time default-on features also work
properly, by setting each COP's cop_features to the value of the bits
set at the COP's compile time - ie the same approach as cop_hints.
|
|
|
|
| |
CopLINE() actually returns `line_t` since a long time ago.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From the standard:
"An invocation of the setjmp macro shall appear only in one of the
following contexts:
- the entire controlling expression of a selection or iteration
statement;
- one operand of a relational or equality operator with the other
operand an integer constant expression, with the resulting
expression being the entire controlling expression of a selection
or iteration statement;
- the operand of a unary ! operator with the resulting expression
being the entire controlling expression of a selection or
iteration statement; or
- the entire expression of an expression statement (possibly cast
to void).
If the invocation appears in any other context, the behavior is
undefined."
which does not include assignment.
Fixes #20189
|
|
|
|
|
| |
Also add SAFE_FUNCTION__ which ensures that the value
is "UNKNOWN" on platforms that dont support __func__.
|
|
|
|
| |
We can just do the count before and after.
|
|
|
|
|
|
| |
* Show the return from JMPENV_PUSH().
* use (v) consistently.
* Line up backslashes.
|
|
|
|
|
| |
Old versions (3.3.6) of gcc allowed assignment to such casts, but
this is no longer an issue.
|
|
|
|
|
| |
The comment explaining what the je_mustcatch field does was
incorrectly updated in 1999! Change it back to what it was originally.
|
|
|
|
|
|
| |
Although one of the macros associated with the JMPENV facility
is inconsistently called JMPENV_JUMP(), fix all code comments
and debugging output to eliminate any references to JUMPENV.
|
|
|
|
|
| |
This was meant to be a part of the previous commit, but somehow got
omitted.
|
|
|
|
|
|
| |
This should be being used only in core, as its only use is for autodoc.
Change the flag name to be more mnemonic, freeing up its current name
for another use.
|
|
|
|
| |
Only one flag bit is valid; this clears all others.
|
|
|
|
| |
Making these a single entry makes perlapi more concise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making these a single entry makes perlapi more concise with less
repetition, and clarifies the similarities and distinctions between the
variant forms.
Doing this showed me that some details had been glossed over, which this
commit adds.
This commit also changes the formal parameter name for one macro from
"keypv" to "key" so all variants use the same names.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making these a single entry makes perlapi more concise with less
repetition, and clarifies the similarities and distinctions between the
variant forms.
Doing this showed me that some details had been glossed over, which this
commit adds.
This commit also changes the formal parameter name for one macro from
"keypv" to "key" so all variants use the same names.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making these a single entry makes perlapi more concise with less
repetition, and clarifies the similarities and distinctions between the
variant forms.
Doing this showed me that some details had been glossed over, which this
commit adds.
This commit also changes the formal parameter name for one macro from
"keypv" to "key" so all variants use the same names.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making these a single entry makes perlapi more concise with less
repetition, and clarifies the similarities and distinctions between the
variant forms.
Doing this showed me that some details had been glossed over, which this
commit adds.
This commit also changes the formal parameter name for one macro from
"keypv" to "key" so all variants use the same names.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making these a single entry makes perlapi more concise with less
repetition, and clarifies the similarities and distinctions between the
variant forms.
Doing this showed me that some details had been glossed over, which this
commit adds.
This commit also changes the formal parameter name for one macro from
"keypv" to "key" so all variants use the same names.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Making these a single entry makes perlapi more concise with less
repetition, and clarifies the similarities and distinctions between the
variant forms.
Doing this showed me that some details had been glossed over, which this
commit adds.
This commit also changes the formal parameter name for one macro from
"keypv" to "key" so all variants use the same names.
|
|
|
|
| |
"finally" and not "defer"
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On threaded builds CopFILEAV() calls gv_fetchfile(), which always
created the *{"::_<filenamehere"} glob, so the attempted clean up
here could recreate the glob, even if it has already been removed
when cleaning up a string eval.
To avoid this, add CopFILEAVn() that never creates the glob,
nor the AV so that the clean up never adds new objects.
This change makes the check for PL_phase unnecessary, but that check
is much cheaper than the call for gv_fetchfile_flags() that the
macro hides, so retain the check.
|
|
|
|
| |
The build has been broken since 2009.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds syntax `defer { BLOCK }` to create a deferred block; code that is
deferred until the scope exits. This syntax is guarded by
use feature 'defer';
Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field
gives the start of an optree to be deferred until scope exit. That op
pointer will be stored on the save stack and invoked as part of scope
unwind.
Included is support for `B::Deparse` to deparse the optree back into
syntax.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This is a rebasing by @khw of part of GH #18792, which I needed to get
in now to proceed with other commits.
It also strips trailing white space from the affected files.
|
|
|
|
|
| |
These functions allow one to check for the existence of keys in the
hints hash of a specific cop.
|
|
|
|
|
| |
These functions allow one to check for the existence of keys in a hints
hash.
|
|
|
|
|
|
|
|
|
| |
* Add feature, experimental warning, keyword
* Basic parsing
* Basic implementation as optree fragment
See also
https://github.com/Perl/perl5/issues/18504
|
|
|
|
|
|
| |
CxTRYBLOCK would be confusing when we add a real CxTRY for try/catch
Also renames the associated CXp_TRYBLOCK flag to CXp_EVALBLOCK
|
| |
|
| |
|
|
|
|
|
| |
This encloses some #defines in a PERL_CORE section, as their only use is
in the macro immediately following, already confined to core.
|
|
|
|
|
| |
The pod says these are const, but they won't compile if actually called
with one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This feature allows documentation destined for perlapi or perlintern to
be split into sections of related functions, no matter where the
documentation source is. Prior to this commit the line had to contain
the exact text of the title of the section. Now it can be a $variable
name that autodoc.pl expands to the title. It still has to be an exact
match for the variable in autodoc, but now, the expanded text can be
changed in autodoc alone, without other files needing to be updated at
the same time.
|
|
|
|
|
|
| |
Now that we can get automatic links in perlapi, remove the redundant
stripped-down documentation that goes there in favor of the better
documentation in perlcall.
|
| |
|
|
|
|
|
| |
This uses a new organization of sections that I came up with. I asked
for comments on p5p, but there were none.
|
|
|
|
|
| |
apidoc_section is slightly favored over head1, as it is known only to
autodoc, and can't be confused with real pod.
|
|
|
|
|
| |
The macro which the comment describes is long gone, but the comment got
missed.
|
| |
|
|
|
|
| |
See previous commit.
|