| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
With threaded builds, cop.h and op.h get an extra member in their
structs, to save the UTF-8ness of the stash's name.
*STASH_set() checks for the flag, stores it through
*STASH_flags(), and *STASH() uses the latter to fetch the
correct scalar.
|
|
|
|
|
|
| |
$[ remains as a variable. It no longer has compile-time magic.
At runtime, it always reads as zero, accepts a write of zero, but dies
on writing any other value.
|
|
|
|
|
|
|
| |
instead of deriving it from the opchain.
Also contains a test where using the opchain to determine the deref
type fails.
|
|
|
|
|
|
|
|
| |
This makes them consistent with other functions that put the basic
datum type first (like hv_*, sv_*, cophh_*).
Since fetch_cop_label is marked as experimental (M), this change
should be OK.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OK, now I understand what’s happening.
If there is a public macro (PUSHSUB) that contains a call to a pri-
vate function (was_lvalue_sub), that function has to be exported, so
that non-core code can call it. But if it is marked X, there is no
was_lvalue_sub shorthand macro visible to non-core code, so when the
PUSHSUB macro is expanded in such code, the was_lvalue_sub(...) bit
becomes a call to the function literally named was_lvalue_sub, as
opposed to Perl_lvalue_sub (and is compiled that way on forgiving
platforms). Making it A makes that macro available to non-core code,
but also implies that it is available for direct use by extensions,
which is not the case with was_lvalue_sub.
So, this commit makes it X again, but spells it out in PUSHSUB, so
there is no need for the function’s macro to be available when
PUSHSUB is expanded.
Hence, there is no need for the was_lvalue_sub macro to exist, so this
commit also removes it.
See also these three commits:
c73b0699db
7b70e81778
777d901444
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit, this code would fail:
$foo = "foo";
sub foo :lvalue{ return index "foo","o" }
sub bar :lvalue { foo }
$x = bar;
(It would fail for ‘return $]’ as well. Whether it’s a PADTMP or a
read-only scalar makes no difference.)
foo would think it was being called in true lvalue context, because
the entersub op that called it (in bar) was marked that way, bar being
an lvalue sub as well.
The PUSHSUB macro in cop.h needed to be modified to account for
dynamic, or indetermine, context (i.e., indeterminable at compile
time). This happens when an entersub op is an argument to return or
the last statement in a subroutine. In those cases it has to propa-
gate the context from the caller.
So what we now do is this: Both lvalue and in-args flags are turned on
for an entersub op when op_lvalue is called with OP_LEAVESUBLV as the
type. Then PUSHSUB copies into the context stack only those flags
that are set both on the current entersub op and in the context stack
for the previous sub call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes autovivification work with lvalue subs. It follows
the same technique used by other autovivifiable ops (aelem, helem,
tc.), except that, due to flag constraints, it uses a single flag and
instead checks the op tree at run time to find out what sort of thing
to vivify.
The flag constraints are that these two flags:
#define OPpENTERSUB_HASTARG 32 /* Called from OP tree. */
#define OPpENTERSUB_NOMOD 64 /* Immune to op_lvalue() for :attrlist. */
conflict with these:
#define OPpDEREF (32|64) /* autovivify: Want ref to something: */
#define OPpDEREF_AV 32 /* Want ref to AV. */
#define OPpDEREF_HV 64 /* Want ref to HV. */
#define OPpDEREF_SV (32|64) /* Want ref to SV. */
Renumbering HASTARG and NOMOD is problematic, as there are places in
op.c that change entersubs into rv2cvs, and the entersub and rv2cv
flags would conflict. Setting the flags correctly when changing the
type is hard and would result in subtle bugs if not done perfectly.
Ops like ${...} don’t actually autovivify; it’s the op inside that
does it. In those cases, the parent op is flagged with OPpDEREFed, and
it skips get-magic, as it has already been called by the inner op.
Since entersub is now marked as being an autovivifying op, ${...} in
lvalue context ends up skipping get-magic if there is a foo() inside.
And this affects even regular subs. So pp_leavesub and pp_return have
to call get-magic; hence the new tests in gmagic.t.
|
| |
|
|
|
|
| |
The field was removed a while ago, but the macro sb_once remained.
|
| |
|
|
|
|
|
|
| |
Add a flag G_WRITING_TO_STDERR to signal that Perl_magic_methcall() needs to
localise PL_stderrgv to NULL, and save/free temps, inside its ENTER/LEAVE
pair.
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81904]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
|
|
|
|
|
|
| |
This adds an additional parameter to perl's dtrace probes with the stash
name of the subroutine. This generally looks nicer than the filename but
gives a similar level of context.
As this is an additional parameter this will not have an impact on
existing DTrace scripts. (Also due to the way DTrace works I believe it
does not break binary compatibility and would be safe to backport to
maint-5.12 if desired, but I'm not a DTrace expert.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Expose cop hint hashes as a type COPHH, with a cophh_* API which is a
macro layer over the refcounted_he_* API. The documentation for cophh_*
describes purely API-visible behaviour, whereas the refcounted_he_*
documentation describes the functions mainly in terms of the
implementation. Revise the cop_hints_* API, using the flags parameter
consistently and reimplementing in terms of cophh_*. Use the cophh_*
and cop_hints_* functions consistently where appropriate.
[Modified by the committer to update two calls to
Perl_refcounted_he_fetch recently added to newPMOP.]
|
|
|
|
|
|
|
|
| |
See [perl #78070].
Basically, POPSUB/LEAVESUB had a mechanism to decrement the reference
count of the CV only at CvDEPTH==1; POP_MULTICALL was decrementing it at
all depths.
|
|
|
|
| |
Previously it was only used under -DITHREADS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fix for [perl #21469]:
since the GP may be pulled from under us and freed, coredumps and strange
things can happen.
Fix this by storing a pointer to the GV in the loop block, rather than a
pointer to the GvSV slot. The ITHREADS variant already stores GV rather
than than &GvSV; extend this to non-threaded builds too.
Also, for both threaded and non-threaded, it used to push &GvSV on the
save stack. Fix this by introducing a new save type, SAVEt_GVSV.
This behaves similarly to SAVEt_SV, but without magic get/set.
This means that
for $package_var (...)
is now close in behaviour to
local $package_var = ...
(except for the magic bit).
|
|
|
|
|
|
|
| |
make it clearer what types of pointer to the iterator variable can be
stored, reduce the amount of #ifdef USE_ITHREADS, get rid of some macros,
and generally make the code easier to follow. No change to the size of the
structure.
|
|
|
|
| |
This value is also available via via cx->blk_loop.my_op->op_targ
|
|
|
|
|
|
| |
This field is only used in non-threaded builds, and the comments imply
that this is because in non-threaded builds this value may be
modified. But nothing in core modifies it.
|
|
|
|
|
|
|
|
|
|
| |
From a suggestion from Ben Morrow.
The first argument used to be struct refcounted_he *, which exposed an
implementation detail - that the COP's labels are (now) stored in this way.
Google Code Search and an unpacked CPAN both fail to find any users of this
API, so the impact should be minimal.
|
|
|
|
|
| |
This reverts commit 395b8e2d02eadc9b0639534410c39c530bc8a33d.
The fencepost error is coming from inside the programmer!
|
|
|
|
| |
(patch req by Nicholas)
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
pp_ctl.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Makes the G_KEEPERR logic more consistent, and in particular make it
sensibly handle non-string exceptions. An exception in a destructor
is now always emitted as a warning, and never copied or merged into
$@ of the surrounding context. No more clobbering exceptions being
handled elsewhere, and no more double reporting. This fixes the rest of
[perl #74538].
|
|/
|
|
|
|
| |
This replaces the previous special case of using a negative argument count to
signify this, allowing the argument count to become unsigned. Rename it from n
to argc.
|
|
|
|
|
|
| |
This ensures that (safe) signals sent to the same process are still dispatched
within the same statement (as before), without overloading the semantics of
block popping.
|
|
|
|
|
|
|
|
|
| |
For the typical code this gives a 5% speedup, and removes the cost of "safe
signals". Tight looping code will show less gains, but should never be slower.
Subtle bugs might remain - there might be constructions that enter the runloop
(where signals used to be dispatched) but don't contain any PERL_ASYNC_CHECK()
calls themselves.
|
| |
|
|
|
|
|
| |
In particular, distinguish between scope and context stack push/pops,
show depth of JUMPENV stack, and show STACKINFO push/pops
|
|
|
|
|
|
|
|
|
| |
It had been added with change 3728 to track linenumbers in
optimized else, disabled by change 4309,
and removed with change 33072.
Bump copyright, latest change was "Fix MULTICALL in List-Util" 2009-03-07
with commit 1bbbfc50
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add information about where in the C code the jumplevel poping/setting up was done.
Gerard
From 7b95a19d6fbd3615a034cea79fa087b80e4a9555 Mon Sep 17 00:00:00 2001
From: Gerard Goossen <gerard@ggoossen.net>
Date: Thu, 12 Nov 2009 16:50:13 +0100
Subject: [PATCH] Add line information to jumplevel debug information provided when using -Dl
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
|
|
|
|
| |
level jumplevel
|
|
|
|
| |
This fixes [perl #68590] : %^H not lexical enough.
|
|
|
|
|
|
|
|
| |
(MacOS support was removed from MakeMaker in 6.22, and merged to blead on
15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this
point MacOS wouldn't even have been able to build the perl binary, because it
would not have been able to build DynaLoader. If anyone wishes to resurrect
MacOS, start by reversing this commit and the relevant part of that commit.)
|
|
|
|
|
|
|
|
| |
Add a new stack frame; the MULTICALL code in pp_return assumes there
is a clean stack, and blindly changes the top-most stack value. This
change brings cop.h more in line with the "poor-man's MULTICALL"
provided in ext/List-Util/multicall.h, which also always pushes a new
stack.
|
|
|
|
|
| |
static. Macros PUSHSUBST() and POPSUBST() are only viable in PERL_CORE.
p4raw-id: //depot/perl@34935
|
|
|
| |
p4raw-id: //depot/perl@34621
|
|
|
|
|
| |
MUTABLE_PTR(), to validate that there is no casting away of const.
p4raw-id: //depot/perl@34610
|
|
|
|
|
|
|
|
|
|
| |
away const, returning a void *. Add MUTABLE_SV(sv) which uses this, and
replace all (SV *) casts either with MUTABLE_SV(sv), or (const SV *).
This probably still needs some work - assigning to SvPVX() and SvRV()
is now likely to generate a casting error. The core doesn't do this.
But as-is it's finding bugs that can be fixed.
p4raw-id: //depot/perl@34605
|
|
|
| |
p4raw-id: //depot/perl@34585
|
|
|
|
|
|
| |
entry in the hints hash. Most statements don't have labels, so this
will save memory. Not sure how much.
p4raw-id: //depot/perl@33656
|
|
|
|
|
| |
for part of some other context-stack related struct.
p4raw-id: //depot/perl@33655
|
|
|
|
|
|
|
| |
never used are more obfuscation than clarification, so inline the only
use of SAVECOPLABEL_FREE(), and remove the unthreaded variant and
both SAVECOPLABEL()s. Exterminate! Exterminate! Exterminate!
p4raw-id: //depot/perl@33654
|
|
|
|
|
| |
Here saves 72 bytes in pp_ctl.o. Small, but in the right direction.
p4raw-id: //depot/perl@33232
|
|
|
| |
p4raw-id: //depot/perl@33086
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of wedging the pad offset into a void* iterdata, and always
storing PL_comppad even when it isn't used, instead do this:
PAD *oldcomppad; /* Also used for the GV, if targoffset is 0 */
/* This is also accesible via cx->blk_loop.my_op->op_targ */
PADOFFSET targoffset;
and store the GV pointer in oldcompad. Pointers to pointers seems
cleaner. This also allows us to eliminate the flag bit CXp_PADVAR.
p4raw-id: //depot/perl@33081
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pad is shared between POPLOOP, using itersave, and the end of scope
restore action requested by Perl_save_padsv(). In fact, the only user
of SAVEt_PADSV is pp_enteriter, and it already provides enough
information to allow it to perform the sv_2mortal() in POPLOOP.
So make it do so. Rather than creating a new routine, use the existing
routine because nothing else (at least nothing else known to Google's
codesearch) uses it. But rename it just in case something we can't see
is being naughty and using our private functions - they will get
link errors against 5.12.
All this means that itersave is now redundant. So remove it.
This makes struct context 48 bytes on ILP32 platforms with 32bit IVs,
down from 64 bytes in 5.10. 33% more context stack in the same memory.
p4raw-id: //depot/perl@33080
|