summaryrefslogtreecommitdiff
path: root/op.h
Commit message (Collapse)AuthorAgeFilesLines
* document how tainting works with pattern matchingDavid Mitchell2011-02-161-1/+1
|
* Initial setup to accommodate /aa regex modifierKarl Williamson2011-02-141-1/+1
| | | | | This changes the bits to add a new charset type for /aa, and other bookkeeping for it.
* op.h: add blank line for groupingKarl Williamson2011-01-161-0/+1
|
* Fix typos (spelling errors) in Perl sources.Peter J. Acklam) (via RT2011-01-071-2/+2
| | | | | | | | | # 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>
* call pp_glob() even when its being skippedDavid Mitchell2011-01-021-0/+1
| | | | | | | | | | | | | | Currently when an external Perl glob function is used (which is most of the time), the OP_GLOB op is removed and replaced with the pair: GV("CORE::GLOBAL::glob"), ENTERSUB. This commit re-adds the OP_GLOB to the op tree, but with OPf_SPECIAL set; and pp_glob() is updated to just return if OPf_SPECIAL is set. Thus there's no change in outward functionality with this commit. However, by always calling pp_glob(), it will allow us (in the next commit) to handle iterator overloading consistently, regardless of whether the internal globbing function is used or not.
* mark blockhooks API as experimentalZefram2010-12-131-6/+6
|
* [perl #77762] Constant assignment warningFather Chrysostomos2010-11-301-0/+1
| | | | | | | | | | | | With this patch: $ ./perl -we 'sub A () {1}; if (0) {my $foo = A or die}' $ ./perl -we 'sub A () {1}; if (0) {my $foo = 1 or die}' Found = in conditional, should be == at -e line 1. Since the value of a constant may not be known at the time the program is written, it should be perfectly acceptable to do a constant assign- ment in a conditional.
* Convert newSUB() to a macro wrapping Perl_newATTRSUB()Nicholas Clark2010-11-171-0/+2
| | | | | Provide a Perl_newSUB() function in mathoms.c for anyone referencing it by its full name.
* Document the new custom op functions.Ben Morrow2010-11-141-0/+46
|
* Improve custom OP support.Ben Morrow2010-11-141-0/+46
| | | | | | | | | | | | | | | | | 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'.
* Remove THREADSV_NAMES, part of 5005 threads that the chainsaw missed.Nicholas Clark2010-10-271-1/+0
| | | | | Also remove the documentation of OPf_SPECIAL for OP_ENTERITER, as that was only for 5.005 threads. Stop B::Deparse misinterpreting OPf_SPECIAL on OP_ENTERITER.
* new API functions op_scope and op_lvalueZefram2010-10-261-1/+1
| | | | | | The function scope() goes into the API as op_scope(), and mod() goes into the API as op_lvalue(). Both marked experimental, because their behaviour is a little quirky and not trivially dequirkable.
* Add LINKLIST to the API.Ben Morrow2010-10-121-0/+15
| | | | | Also rename the underlying function to op_linklist, to match the other API op functions.
* Remove some excess cleverness from the Bhk macros.Ben Morrow2010-10-101-6/+6
| | | | | | | | | Allowing BhkENTRY(bhk, start) to look up the bhk_start member defeats much of the point of having a bhk_ prefix in the first place: if a member is added later called (say) 'bhk_die', any invocation of BhkENTRY(bhk, die) will expand to BhkENTRY(bhk, Perl_die) because of the API macros. Requiring BhkENTRY(bhk, bhk_start), while tedious, is much safer.
* plugin mechanism to rewrite calls to a subroutineZefram2010-10-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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.)
* Add /d, /l, /u (infixed) regex modifiersKarl Williamson2010-09-221-1/+1
| | | | | | | | | | | | This patch adds recognition of these modifiers, with appropriate action for d and l. u does nothing useful yet. This allows for the interpolation of a regex into another one without losing the character set semantics that it was compiled with, as for the first time, the semantics is now specified in the stringification as one of these modifiers. To this end, it allocates an unused bit in the structures. The off- sets change so as to not disturb other bits.
* [perl #20444] regex not evaluated in constant ?:Father Chrysostomos2010-09-201-0/+4
| | | | | | | | | | | | $text =~ ( 1 ? /phoo/ : /bear/) used to be constant-folded to $text =~ /phoo/ This patch solves the problem by marking match and subst ops as OPf_SPECIAL during constant folding, so the =~ operator can tell not to take possession of it.
* Remove OA_RETINTEGER, unused since 2002 (commit e7311069df54baa6)Nicholas Clark2010-08-281-4/+3
| | | | | | | | 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.
* Remove CALL_FPTR and CPERLscope.Ben Morrow2010-08-201-2/+2
| | | | | | | | | | | | | | | | 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.
* op.h: Move bits around to allow for future growthKarl Williamson2010-08-111-1/+3
| | | | | | | This creates an unallocated space at the shared/unshared boundary of the data with regexp.h. This allows any future bits that may be needed to go into either, without affecting binary compatibility. I chose a number of spare bits larger than I thought we would ever need
* op.h, regexp.h: renumber shifts.Karl Williamson2010-08-111-12/+12
| | | | | | This patch doesn't change any generated code. It just changes the base numbering of the shifts from 1 to 0. In regexp.h the RXf_BASE_SHIFT was changed to make sure the used bits didn't change
* op_reg_common.h: Continue refactoringKarl Williamson2010-08-111-3/+0
| | | | | | | | | | | | | | | The new op_reg_common.h did not have in it all the things that made sense for it to have, including some comment changes that I should have made when I created it. I also realized the the new mechanism of using shifts allowed RXf_PMf_STD_PMMOD_SHIFT to actually control things, rather than be a #define that one had to remember to change if those things changed independently. Finally, I created a check so that adding bits without adding them to RXf_PMf_COMPILETIME will force a compilation error. (This came from the school of hard knocks)
* op_reg_common.h: Refactor variable for safetyKarl Williamson2010-08-111-1/+1
| | | | | | | | This patch changes the variable that tells how many common bits there are to instead be +1 that value, so bits won't get reused. A later commit will renumber the bits in op.h and regexp.h, but for now things are left as-is there, which means the base variables in those two files must subtract one to compensate for the +1
* regexp.h, op.h: decouple mostly from op_reg_common.hKarl Williamson2010-08-111-11/+13
| | | | | | This patch changes the shift bases to new ones local in the files that are set to the common one. Thus, there is now a single point of coupling between in each file to the common one.
* op.h: Fix error msgKarl Williamson2010-08-111-1/+1
|
* Refactor common parts of op.h, regexp.h into new .hKarl Williamson2010-07-291-23/+25
| | | | | | | | | | | op.h and regexp.h share common elements in their data structures. They have had to manually be kept in sync. This patch makes it easier by putting those common parts into a common header #included by the two. To do this, it seemed easiest to change the symbol definitions to use left shifts to generate the flag bits. But this meant that regcomp.pl and axt/B/defsubs_h.PL had to be taught to recognize those forms of expressions, done in separate commits
* op.h: Fix comments in #defines that cross linesKarl Williamson2010-07-291-9/+9
| | | | | | It is not good form to have comments in a #define continue onto the next line, especially not with a \ ending each continuation line. People preferred that the comment be placed before the #define
* Macros to en/disable blockhook entries.Ben Morrow2010-07-151-1/+23
| | | | | This allows the individual callbacks to be switched on and off as necessary, without removing the entry from PL_blockhooks.
* Document the blockhook functions and macros.Ben Morrow2010-07-121-0/+24
|
* Macroify the block_hooks structure.Ben Morrow2010-07-121-5/+23
| | | | | Add a flags member, so it can be extended later if necessary. Add a bhk_eval member, called from doeval to catch requires and string evals.
* Generic hooks into Perl_block_{start,end}.Ben Morrow2010-07-121-0/+26
| | | | | | | | | | These take the form of a vtable pushed onto the new PL_blockhooks array. This could probably do with a API around it later. Separate pre_end and post_end hooks are needed to capture globals before the stack is unwound (like needblockscope in the existing code). The intention is that once a vtable is installed it never gets removed, so where necessary extensions using this will need to use a hinthv element to determine whether to do anything or not.
* Link from GIMME_V to perlcall for a usage example.Shlomi Fish2010-05-251-1/+1
| | | | | | Added a link from the GIMME_V entry to perlcall for a usage example. Signed-off-by: David Golden <dagolden@cpan.org>
* add OPpDEREFed flag to avoid double mg_get()David Mitchell2010-05-251-0/+2
| | | | | | | | | | | | | 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).
* Add s///r (non-destructive substitution).David Caldwell2010-05-221-0/+2
| | | | | | | | | | | | | | | | This changes s/// so that it doesn't act destructively on its target. Instead it returns the result of the substitution (or the original string if there was no match). In addition this patch: * Adds a new warning when s///r happens in void context. * Adds a error when you try to use s///r with !~ * Makes it so constant strings can be bound to s///r with =~ * Adds documentation. * Adds some tests. * Updates various debug code so it knows about the /r flag. * Adds some new 'r' words to B::Deparse.
* * eliminated OP_SETSTATE also in commentsSlaven Rezic2010-04-131-1/+1
|
* Optimize reversing an array in-placeVincent Pit2009-11-101-0/+3
|
* Use less constness in MAD codeRafael Garcia-Suarez2009-08-261-1/+1
| | | | This suppresses warnings, because sometimes the constness was taken away
* Introduce "delete local"Vincent Pit2009-07-251-0/+1
|
* Document the PERL_LOADMOD_ flagsRafael Garcia-Suarez2009-05-301-3/+3
|
* Replace Perl_my() with a small shell script. er. macro.Nicholas Clark2008-11-261-0/+4
| | | p4raw-id: //depot/perl@34917
* [perl #38809] return do { } : take 3 (or 4...)Vincent Pit2008-11-251-0/+1
| | | | | Message-ID: <48E0F5E9.4050805@profvince.com> p4raw-id: //depot/perl@34907
* Re: [perl #60360] [PATCH] local $SIG{FOO} = sub {...}; sets signalChip Salzenberg2008-11-121-0/+3
| | | | | Message-ID: <20081111000040.GB19329@tytlal.topaz.cx> p4raw-id: //depot/perl@34819
* Add a macro MUTABLE_PTR(p), which on (non-pedantic) gcc will not castNicholas Clark2008-10-271-2/+2
| | | | | | | | | | 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
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* Re: [PATCH] readable assertion names, now the restReini Urban2008-06-081-3/+3
| | | | | | From: "Reini Urban" <rurban@x-ray.at> Message-ID: <6910a60806080717h1aaaef1fh425a2ef21a62c9ed@mail.gmail.com> p4raw-id: //depot/perl@34030
* Re: Solaris build warningsAndy Dougherty2008-04-141-1/+1
| | | | | | | Message-ID: <Pine.LNX.4.64.0803261337130.22919@fractal.phys.lafayette.edu> Rename the "optype" typedef to "Optype" p4raw-id: //depot/perl@33679
* Re: [patch] optimize OP_IS_(FILETEST|SOCKET) macrosJim Cromie2008-02-251-7/+0
| | | | | | 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-2/+0
| | | | | | Message-ID: <47B60D72.50708@profvince.com> Date: Fri, 15 Feb 2008 23:08:50 +0100 p4raw-id: //depot/perl@33356
* Silence compiler warnings on Win32/VC6Jan Dubois2008-02-151-1/+6
| | | | | | | Subject: RE: Bit-fields patch causes warnings on Win32/VC6 From: "Jan Dubois" <jand@activestate.com> Message-ID: <002f01c86f3f$27e23ca0$77a6b5e0$@com> p4raw-id: //depot/perl@33315
* Fix bit-fields for VC [was RE: [perl #50386] GIMME_V broken with 5.10.0/GCC ↵Jan Dubois2008-02-121-6/+6
| | | | | | | | and XS?] From: "Jan Dubois" <jand@activestate.com> Message-ID: <02ee01c8651b$17ef72f0$47ce58d0$@com> p4raw-id: //depot/perl@33292