summaryrefslogtreecommitdiff
path: root/opnames.h
Commit message (Collapse)AuthorAgeFilesLines
* Implement the fc keyword and the \F string escape.Brian Fraser2012-01-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | Along with the simple_casefolding and full_casefolding features. fc() stands for foldcase, a sort of pseudo case (like lowercase), which is used to implement Unicode casefolding. It maps a string to a form where all case differences are erased, so it's a locale-independent way of checking if two strings are the same, regardless of case. This functionality was, and still is, available through the regular expression engine -- /i matches would use casefolding internally. The fc keyword merely exposes this for easier access. Previously, one could attempt to case-insensitively test two strings for equality by doing lc($a) eq lc($b) But that might get you wrong results, for example in the case of \x{DF}, LATIN SMALL LETTER SHARP S.
* [perl #80628] __SUB__Father Chrysostomos2011-11-221-1/+2
| | | | | After much alternation, altercation and alteration, __SUB__ is finally here.
* regen/opcode.pl: generate OP_IS_DIRHOP, use in gv.cJim Cromie2011-09-091-3/+7
| | | | | | | Generate OP_IS_DIRHOP like other OP_IS_* macros, use in gv.c:Perl_gv_add_by_type(). Modifies 'F' operand type to 'DF'. This yields a micro-optimization.
* implement OP_IS_NUMCOMPARE like other OP_IS macrosJim Cromie2011-09-091-0/+3
| | | | | | | other macros are written by regen/opcode.pl into opnames.h Generate OP_IS_NUMCOMPARE the same way, and get a micro-optimization. Adds a new 'S<' operand type for the numeric comparison ops. Needs make regen.
* Add coreargs opFather Chrysostomos2011-08-181-1/+2
| | | | &CORE::foo subs will use this operator for sorting out @_.
* Reorder ops so that trans{,r} and aelemfast{,_lex} are adjacent.Nicholas Clark2011-06-121-335/+335
|
* Split OP_AELEMFAST_LEX out from OP_AELEMFAST.Nicholas Clark2011-06-121-1/+2
| | | | | | | | | | | | | 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.
* Move all the generated file header printing into read_only_top()Nicholas Clark2011-01-231-5/+4
| | | | | | | | | 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".
* Extract the opcode data from regen/opcode.pl into regen/opcodesNicholas Clark2011-01-091-1/+1
| | | | | Whilst it is possible to open regen/opcode.pl and parse it to find the __END__ token, it's not the cleanest approach.
* Remove OP_phoney_{IN,OUT}PUT_ONLY, as they are no longer used or supported.Nicholas Clark2010-12-281-3/+0
|
* Add transr op typeFather Chrysostomos2010-11-021-1/+2
| | | | | for the upcoming y///r feature. There are not enough flag bits, hence the extra type.
* Allow push/pop/keys/etc to act on referencesDavid Golden2010-10-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* opcode.pl -> regen/opcode.plFather Chrysostomos2010-10-131-2/+2
|
* Move the boolkeys op to the group of hash ops.Nicholas Clark2009-10-151-225/+225
| | | | This breaks binary compatibility.
* Optimise if (%foo) to be faster than if(keys %foo)demerphq2009-10-151-1/+2
| | | | | | | | | | | 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.
* Update copyright year in opcode.pl to reflect change 33364.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34587
* Re: [patch] optimize OP_IS_(FILETEST|SOCKET) macrosJim Cromie2008-02-251-0/+3
| | | | | | From: "Jim Cromie" <jim.cromie@gmail.com> Message-ID: <cfe85dfa0802101152n4e1b9e07pc7fb7ad9241a9794@mail.gmail.com> p4raw-id: //depot/perl@33364
* Re: [PATCH] Splitting OP_CONST (Was: pp_const, not, that, hot?)Vincent Pit2008-02-231-40/+41
| | | | | | Message-ID: <47B60D72.50708@profvince.com> Date: Fri, 15 Feb 2008 23:08:50 +0100 p4raw-id: //depot/perl@33356
* [patch] optimize OP_IS_(FILETEST|SOCKET) macrosJim Cromie2008-02-101-405/+370
| | | | | | Message-ID: <47ADBF3B.2050108@gmail.com> Date: Sat, 09 Feb 2008 07:56:59 -0700 p4raw-id: //depot/perl@33267
* Eliminate the OP_SETSTATE, which had been disabled by change 4309.Nicholas Clark2008-01-261-169/+168
| | | p4raw-id: //depot/perl@33072
* Implement each @array.Nicholas Clark2007-12-201-233/+236
| | | | | | 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
* Make state $zok = slosh(); behave as the Perl 6 design with an implicitNicholas Clark2007-09-061-2/+3
| | | | | | | | | | | | | | | 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
* A logical rearrangement of ops, to get the post 5.005 ops to theirNicholas Clark2007-03-301-262/+262
| | | | | logical groups. p4raw-id: //depot/perl@30784
* Eliminate pp_threadsv, as it was only ever used by 5005 threads.Nicholas Clark2007-01-081-16/+15
| | | p4raw-id: //depot/perl@29727
* Re-order ops to the implementation order in pp_sys.c - this makes aNicholas Clark2006-11-121-14/+14
| | | | | branch table corresponding to a switch statement slightly smaller. p4raw-id: //depot/perl@29251
* Update the copyright years in the generated files, and nostdio.hNicholas Clark2006-01-081-1/+2
| | | p4raw-id: //depot/perl@26736
* latest switch/say/~~Robin Houston2005-12-191-2/+10
| | | | | Message-Id: <20051217204431.GB28940@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26400
* Include vim/emacs modelines in generated files to open themRafael Garcia-Suarez2005-05-111-1/+3
| | | | | | in read-only mode. Make vi modelines compatible with non-vim vi versions. p4raw-id: //depot/perl@24445
* Update copyright noticesRafael Garcia-Suarez2004-03-161-1/+1
| | | p4raw-id: //depot/perl@22509
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+1
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801
* Defined-or patch (cleaned up)Brent Dax2002-08-051-2/+4
| | | | | | From: "Brent Dax" <brentdax@cpan.org> Message-id: <000001c234a1$d1ca72c0$6501a8c0@deepblue> p4raw-id: //depot/perl@17682
* Sprinkle some copyrights (use the oldest timestamp toJarkko Hietaniemi2002-01-241-4/+13
| | | | | | be found in the repository, which is most often not right, but at least consistent) p4raw-id: //depot/perl@14400
* Regen headersArtur Bergman2001-08-271-1/+2
| | | p4raw-id: //depot/perl@11760
* Infrastructure to allow:Nick Ing-Simmons2001-01-201-1/+1
| | | | | | | | | | open($fh,"|-",@array); to be implemented i.e. mark pp_open as needing a stack mark, and make pp_open process its args in that style (and pass them _all_ to tied handles OPEN). Invent do_openn() which takes SV ** at allow it to see multiple args. Note this does not _do_ anything yet. p4raw-id: //depot/perlio@8484
* shrink pp_hot fractionallyNicholas Clark2000-12-051-0/+2
| | | | | | | Message-ID: <20001205124431.E74518@plum.flirble.org> Use report_evil_fh(). p4raw-id: //depot/perl@7990
* Generate OP_IS_SOCKET() and OP_IS_FILETEST() macrosJarkko Hietaniemi2000-08-021-0/+46
| | | | | that are hopefully soon put into use. p4raw-id: //depot/perl@6498
* initial implementation of lvalue subroutines (slightly fixedGurusamy Sarathy1999-09-051-183/+184
| | | | | | version of patch suggested by Ilya Zakharevich, which in turn is based on the one suggested by Tuomas J. Lukka <lukka@iki.fi>) p4raw-id: //depot/perl@4081
* fix broken -DDEBUGGING_OPS (from Spider BoardmanGurusamy Sarathy1999-08-021-0/+361
<spider@leggy.zk3.dec.com>) p4raw-id: //depot/perl@3902