| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unpack is the only op that takes an implicit $_ for its second argu-
ment. (For others it’s the first.)
Instead of special-casing unpack with its own ck_ routine, we can sim-
ply modify the logic in ck_fun to apply OA_DEFGV to the first optional
argument, not just the first argument.
Currently OA_DEFGV is not set in PL_opargs[OP_UNPACK], which means the
automatically-generated prototype is ($;$), instead of ($_).
This commit sets the flag on the op, changes it to use ck_fun
directly, and updates ck_fun and the prototype-generation code accord-
ingly. I couldn’t put this in multiple commits, as the changes are
interdependent.
|
|
|
|
| |
&CORE::foo subs will use this operator for sorting out @_.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the argument is optional, we need a semicolon.
This commit accomplishes that by setting the OA_OPTIONAL flag for the
appropriate entries in PL_opargs. This should not affect anything
else, as ck_ftst (the check routine for [l]stat) doesn’t even look at
PL_opargs.
It also has to tweak the prototype-generation logic slightly, because
PL_opargs also has OA_DEFGV set.
I think this is insignificant enough not to warrant a delta entry.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
6a077020aea1c5f0 extended the OP_AELEMFAST optimisation to lexical arrays.
Previously OP_AELEMFAST was only used as an optimisation for OP_GV, which is a
PADOP/SVOP.
However, by reusing the same opcode, and signalling (pad) lexical vs package,
it introduced a myriad of special cases, because OP_PADAV is a BASEOP (not a
PADOP), whilst OP_AELEMFAST is a PADOP/SVOP (which is larger).
Using two OP numbers allows each variant to have the correct OP flags in
PL_opargs. Both can continue to share the same C code.
|
|
|
|
| |
See ticket #80626.
|
|
|
|
|
|
|
|
|
| |
Previously all the scripts in regen/ had code to generate header comments
(buffer-read-only, "do not edit this file", and optionally regeneration
script, regeneration data, copyright years and filename).
This change results in some minor reformatting of header blocks, and
standardises the copyright line as "Larry Wall and others".
|
|
|
|
|
| |
Unlike set{host,net,proto,serv}ent, set{gr,pw}ent don't have stayopen
parameter, hence their "signature" is the same as the ent*ent functions.
|
| |
|
|
|
|
|
|
|
| |
PL_op_desc[] rather than PL_op_name(), as the OPs are internally named e*ent,
but implement the ent*ent functions, and when unimplemented report themselves
using the function name. No need for OP_DESC(), as the switch statement means
that we can't encounter OP_CUSTOM.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of having each socket op conditionally compile as either the
implementation or a DIE() depending on #HAS_SOCKET
1: remove the conditional code from the ops themselves
2: only compile the ops if HAS_SOCKET is defined
3: general conditional code for the intialisation of PL_ppaddr - as appropriate
either the ops, or Perl_unimplemented_op
4: Amend Perl_unimplemented_op to generate the appropriate DIE() for socket
ops (ie not the "panic"... message)
Whilst this complicates the support code in regen/opcode.pl, it's already a
net saving of 5 lines in the C code.
|
|
|
|
|
| |
Previously syswrite was an alias for send. However, syswrite is always
available, whereas send is not implemented if HAS_SOCKET is not defined.
|
|
|
|
|
|
|
|
| |
For OPs that share implementations, use #define aliases for the "original"
names in PL_ppaddr[], instead of having regen/opcode.pl replace them with
the name of the implementing OP body. Whilst this initially adds another layer
of indirection, it will give more flexibility where conditional compilation of
OPs is determined by the feature macros in config.h
|
|
|
|
|
|
|
| |
It now generates prototypes for all functions that implement OPs. Hence
Perl_unimplemented_op no longer needs a special-case prototype. As it is now
generating a prototype for Perl_do_kv, no need for regen/embed.pl to duplicate
this. Convert the last two users of the macro do_kv() to Perl_do_kv(aTHX).
|
|
|
|
|
|
|
| |
External code that references OPs by name will still link (and work).
Unlike the other compatibility functions in mathoms.c, the OP stubs were simply
making calls onwards to their replacements, so simply taking up space without
adding anything.
|
| |
|
| |
|
|
|
|
|
|
|
| |
The initial parse-time UNOP is upgraded at ck_eval to an LOGOP
- op_other holding the ptr to leavetry -
which causes problems at run-time B optype inspection.
The opclass info was always wrong, the Bytecode compiler broke with 5.12.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the custom op registrations from two separate hashes to one hash
holding structure pointers, and add API functions to register ops and
look them up. This will make it easier to add new properties of custom
ops in the future. Copy entries across from the old hashes where
necessary, to preserve compatibility.
Add two new properties, in addition to the already-existing 'name' and
'description': 'class' and 'peep'. 'class' is one of the OA_*OP
constants, and allows B and other introspection mechanisms to work with
custom ops that aren't BASEOPs. 'peep' is a pointer to a function that
will be called for ops of this type from Perl_rpeep.
Adjust B.xs to take account of the new properties, and also to give
custom ops their registered name rather than simply 'custom'.
|
|
|
|
|
| |
for the upcoming y///r feature. There are not enough flag bits,
hence the extra type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All built-in functions that operate directly on array or hash
containers now also accept hard references to arrays or hashes:
|----------------------------+---------------------------|
| Traditional syntax | Terse syntax |
|----------------------------+---------------------------|
| push @$arrayref, @stuff | push $arrayref, @stuff |
| unshift @$arrayref, @stuff | unshift $arrayref, @stuff |
| pop @$arrayref | pop $arrayref |
| shift @$arrayref | shift $arrayref |
| splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 |
| keys %$hashref | keys $hashref |
| keys @$arrayref | keys $arrayref |
| values %$hashref | values $hashref |
| values @$arrayref | values $arrayref |
| ($k,$v) = each %$hashref | ($k,$v) = each $hashref |
| ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref |
|----------------------------+---------------------------|
This allows these built-in functions to act on long dereferencing
chains or on the return value of subroutines without needing to wrap
them in C<@{}> or C<%{}>:
push @{$obj->tags}, $new_tag; # old way
push $obj->tags, $new_tag; # new way
for ( keys %{$hoh->{genres}{artists}} ) {...} # old way
for ( keys $hoh->{genres}{artists} ) {...} # new way
For C<push>, C<unshift> and C<splice>, the reference will auto-vivify
if it is not defined, just as if it were wrapped with C<@{}>.
Calling C<keys> or C<values> directly on a reference gives a
substantial performance improvement over explicit dereferencing.
For C<keys>, C<values>, C<each>, when overloaded dereferencing is
present, the overloaded dereference is used instead of dereferencing
the underlying reftype. Warnings are issued about assumptions made in
the following three ambiguous cases:
(a) If both %{} and @{} overloading exists, %{} is used
(b) If %{} overloading exists on a blessed arrayref, %{} is used
(c) If @{} overloading exists on a blessed hashref, @{} is used
|
| |
|
|
|
|
| |
This is left over from PERL_OBJECT (see beeff2, 16c915, and so on).
|
|
|
|
|
|
|
|
| |
This returns us to 8 flag bits, and restores OCSHIFT and OASHIFT to 8 and 12
Previously these were 9 and 13, and effectively PL_opargs[] was using 33 of
32 bits, relying on the ugly hack that no 5 argument builtin had an optional
5th argument, hence the (13 + 5 * 4)th bit was always zero.
is effectively 33 bits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes srand to to return the seed instead of always
returning 1. The motivation behind this is to allow applications to not
have to come up with their own pseudo-random generator if they want
repeatable results.
The previous return behavior has never been documented. Note that it is
possible, but very unlikely, for the seed to end up being 0, which means
that if someone were relying on the undocumented previous behavior of
srand returning true, that in very rare instances it would return 0,
failing, and the next time they ran it, it would succeed, possibly
leading to puzzlement and very rare unexplained failures.
|
|
|
|
|
| |
This way, it's correctly caught and blocked by Safe, separately
from eval "".
|
|
|
|
| |
This breaks binary compatibility.
|
|
|
|
|
|
|
|
|
|
|
| |
Thread was "[PATCH] Make if (%hash) {} act the same as if (keys %hash) {}"
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-11/msg00432.html
but the implementation evolved from the approach described in the subject, to
instead add a new opcode pp_boolkeys, to exactly preserve the existing
behaviour.
Various conflicts with the passage of time resolved, 'register' removed, and a
$VERSION bump.
|
|
|
|
|
|
| |
the current compiling cop to a different address. This ensures that
lexical hints are correctly honoured, and allows us to fold sprintf.
p4raw-id: //depot/perl@33369
|
|
|
|
|
|
| |
Message-ID: <47B60D72.50708@profvince.com>
Date: Fri, 15 Feb 2008 23:08:50 +0100
p4raw-id: //depot/perl@33356
|
|
|
| |
p4raw-id: //depot/perl@33338
|
|
|
| |
p4raw-id: //depot/perl@33337
|
|
|
|
|
|
| |
Message-ID: <47ADBF3B.2050108@gmail.com>
Date: Sat, 09 Feb 2008 07:56:59 -0700
p4raw-id: //depot/perl@33267
|
|
|
| |
p4raw-id: //depot/perl@33072
|
|
|
|
|
|
| |
Documentation needed, FIXME for proper 64 bit support of arrays longer
than 2**32, re-order the new ops at the end if merging to 5.10.x.
p4raw-id: //depot/perl@32680
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
START block. First time through, call slosh() and assign to $zok.
Subsequently neither call slosh() nor assign to $zok. Adds a new op
ONCE to control the conditonal call and assign. No change to list
context, so state ($zok) = slosh() and (state $zok) = ... etc will
still repeatedly evaluate and assign. [Can't fix that before 5.10]
Use as an RVALUE is as Larry's design - my $boff = state $zok = ...;
will evaluate, assign and return first time, and subsequently act as if
it were written my $boff = $zok;
FIXME - state $zok = ...; won't deparse - I believe op->op_last isn't
being correctly set on the sassign, but I don't know how to fix this.
This change may be backed out before 5.10.
p4raw-id: //depot/perl@31798
|
|
|
|
|
| |
logical groups.
p4raw-id: //depot/perl@30784
|
|
|
|
|
| |
This allows more ops to be added during the life of a stable release.
p4raw-id: //depot/perl@30782
|
|
|
|
|
| |
Plus MAD fixes.
p4raw-id: //depot/perl@30750
|
|
|
|
|
| |
in opcode.pl too.
p4raw-id: //depot/perl@30749
|
|
|
|
|
|
|
|
| |
Message-Id: <20070219174107.63EEB43A67@anubis.hut.fi>
Plus a regen picked up changes in pod/perlapi.pod related to change
#30347.
p4raw-id: //depot/perl@30362
|
|
|
|
|
| |
space saving to merge them. Hopefully this will reduce L2 cache misses.
p4raw-id: //depot/perl@29836
|
|
|
| |
p4raw-id: //depot/perl@29727
|
|
|
|
|
| |
branch table corresponding to a switch statement slightly smaller.
p4raw-id: //depot/perl@29251
|
|
|
|
|
|
|
|
| |
Message-ID: <lrek2t1e8n.fsf@caliper.activestate.com>
with tweaks so "say;" continues to default to $_
plus a regression test
p4raw-id: //depot/perl@29187
|
|
|
| |
p4raw-id: //depot/perl@29168
|
|
|
|
|
| |
Message-ID: <4502B398.6060505@iki.fi>
p4raw-id: //depot/perl@28814
|
|
|
|
|
| |
Message-ID: <9b18b3110609020740y2eb9004cpab313c3353a437ca@mail.gmail.com>
p4raw-id: //depot/perl@28785
|
|
|
|
|
| |
Message-ID: <44D7AA6B.4040802@iki.fi>
p4raw-id: //depot/perl@28674
|
|
|
|
|
| |
The overloading tests are not free.
p4raw-id: //depot/perl@27126
|