summaryrefslogtreecommitdiff
path: root/ext/Opcode
Commit message (Collapse)AuthorAgeFilesLines
* Critical bugfix in module Safe (Opcode). Version increased, changelog and ↵syber2014-08-052-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | test added. This example hacks outside environment: package My::Controller; use strict; sub jopa { return "jopa\n"; } package main; use Safe; my $s = new Safe; my $ok = $s->reval(q{ package My::Controller; sub jopa { return "hacked\n"; } My::Controller->jopa(); }); print My::Controller->jopa();
* Opcode: fix 'null argument' warningDavid Mitchell2013-11-132-2/+4
| | | | | | | | | | | | | | | | HvNAME_get() can return NULL, and strNE() wants non-null args. [ As a side note: on debugging builds this line if (strNE(HvNAME_get(hv),"main")) { macro-expands into an 18,000 character line (!) due to the fact that HvNAME_get() is quite a big expansion under debugging, and strNE expands to strlen, which under gcc expands to a huge macro (which is mainly lots of different compile-time alternatives depending on which of its args are constants), that references its args several times. ]
* Increase $Opcode::VERSION to 1.26Father Chrysostomos2013-09-131-1/+1
|
* Add new opcodes to Opcode.pmFather Chrysostomos2013-09-131-3/+4
|
* add padrange opDavid Mitchell2012-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This single op can, in some circumstances, replace the sequence of a pushmark followed by one or more padsv/padav/padhv ops, and possibly a trailing 'list' op, but only where the targs of the pad ops form a continuous range. This is generally more efficient, but is particularly so in the case of void-context my declarations, such as: my ($a,@b); Formerly this would be executed as the following set of ops: pushmark pushes a new mark padsv[$a] pushes $a, does a SAVEt_CLEARSV padav[@b] pushes all the flattened elements (i.e. none) of @a, does a SAVEt_CLEARSV list pops the mark, and pops all stack elements except the last nextstate pops the remaining stack element It's now: padrange[$a..@b] does two SAVEt_CLEARSV's nextstate nothing needing doing to the stack Note that in the case above, this commit changes user-visible behaviour in pathological cases; in particular, it has always been possible to modify a lexical var *before* the my is executed, using goto or closure tricks. So in principle someone could tie an array, then could notice that FETCH is no longer being called, e.g. f(); my ($s, @a); # this no longer triggers two FETCHES sub f { tie @a, ...; push @a, 1,2; } But I think we can live with that. Note also that having a padrange operator will allow us shortly to have a corresponding SAVEt_CLEARPADRANGE save type, that will replace multiple individual SAVEt_CLEARSV's.
* Add clonecv op typeFather Chrysostomos2012-09-151-1/+1
| | | | | | This will be used for cloning a ‘my’ sub on scope entry. I was going to use pp_padcv for this, but it would end up having a top-level if/else.
* Add introcv op typeFather Chrysostomos2012-09-151-1/+1
| | | | | This will be used for introducing ‘my’ subs on scope entry, by turning off the stale flag.
* Add padcv to Opcode.pmFather Chrysostomos2012-09-151-1/+1
|
* Opcode.pm: wrap long pod linesFather Chrysostomos2012-08-261-17/+24
|
* Increase $Opcode::VERSION to 1.24Father Chrysostomos2012-08-261-1/+1
|
* Remove boolkeys opFather Chrysostomos2012-08-261-1/+1
|
* Implement the fc keyword and the \F string escape.Brian Fraser2012-01-291-2/+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-2/+2
| | | | | After much alternation, altercation and alteration, __SUB__ is finally here.
* [perl #101486] Make PL_curstash refcountedFather Chrysostomos2011-10-222-3/+3
| | | | | | | | | | This stops PL_curstash from pointing to a freed-and-reused scalar in cases like ‘package Foo; BEGIN {*Foo:: = *Bar::}’. In such cases, another BEGIN block, or any subroutine definition, would cause a crash. Now it just happily proceeds. newATTRSUB and newXS have been modified not to call mro_method_changed_in in such cases, as it doesn’t make sense.
* Add coreargs opFather Chrysostomos2011-08-181-2/+2
| | | | &CORE::foo subs will use this operator for sorting out @_.
* Split OP_AELEMFAST_LEX out from OP_AELEMFAST.Nicholas Clark2011-06-121-2/+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.
* Fix typos (spelling errors) in ext/*.Peter J. Acklam) (via RT2011-01-071-1/+1
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81882] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81882 > Signed-off-by: Abigail <abigail@abigail.be>
* bump version of many modulesZefram2010-12-191-1/+1
| | | | | Core-only modules that have changed from v5.13.7, and dual-life modules that have changed from v5.13.7 and didn't show up in earlier passes.
* Convert ext/Opcode/t/ops.t to Test::MoreNicholas Clark2010-12-171-7/+5
|
* fix various compiler warnings from XS codeZefram2010-12-111-2/+2
| | | | | | | | | | | Trivial changes to fix warnings of types * unclear precedence * assignment as conditional * signed/unsigned mixing * unused parameter/variable * value computed not used * wrong argument type for a printf format * variable may be used uninitialised (due to unhandled switch case)
* Test that Opcode loads without warnings.Nicholas Clark2010-11-091-3/+13
| | | | This will fail if there are untagged ops.
* Tidy up ext/Opcode/t/Opcode.t.Nicholas Clark2010-11-091-10/+10
| | | | | Convert a loop with a die into regular tests. Don't declare lexicals ahead of use. Don't even declare a lexical @o3, which isn't used.
* Convert ext/Opcode/t/Opcode.t to Test::More.Nicholas Clark2010-11-091-39/+39
| | | | The tests (including the still-TODO) mostly date from 1996.
* Add new ops in Opcode, so it does not warn at compilationRafael Garcia-Suarez2010-11-061-3/+3
| | | | The ops are the recently-introduced reach, rvalues, rkeys and transr.
* All callers of get_op_bitspec() in Opcode.xs pass len, so don't call strlen().Nicholas Clark2010-11-011-2/+0
| | | | This commit brought to you by the campaign for elimination of strlen().
* Small refactoring of op_names_init() and put_op_bitspec() in Opcode.xsNicholas Clark2010-11-011-7/+3
| | | | | | | | | Change op_names_init() to use memset() rather than a longhand loop, and to call put_op_bitspec() with an explicit length by using STR_WITH_LEN(). As all calls to put_op_bitspec() now pass in a length, remove the code to call strlen() if the passed-in length is zero. This commit brought to you by the campaign for elimination of strlen().
* Convert modules in ext/ to pass minimal arguments to XSLoader::load().Nicholas Clark2010-10-141-3/+3
|
* Replace sv_2mortal(newSVpvn(...)) with newSVpvn_flags(..., SVs_TEMP)Nicholas Clark2009-10-151-4/+8
|
* Use gv_stashsv() and gv_fetchpvs(), the later with proper arguments.Nicholas Clark2009-10-152-7/+7
| | | | | | | Brought to you by the Campaign for the Elimination of strlen(). (And the elimination of accidental bugs due to typos in lenghts of constants, and the elimination of abuse of boolean constants for parameters with more than 2 values.)
* 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.
* Make extensions in ext run their tests from the extension's own directory.Nicholas Clark2009-08-282-4/+0
| | | | | | | | | | | Inspired by, and in parts borrows from, Schwern's branch on github, but takes a slightly different approach in places. Not quite perfect yet - ext/File-Glob still runs from t, at least one FIXME needs fixing, and the changes to dual-life modules' tests need to be filtered back upstream, and possibly modified to suit their respective authors. But it works.
* Mark all .t and .pm files as non executableRafael Garcia-Suarez2009-06-062-0/+0
|
* make_ext.pl's automatic Makefile.PL generation can write these five for us.Nicholas Clark2009-03-261-6/+0
|
* Move Safe.pm into ext/Safe, and temporarily give it a Makfile.PLNicholas Clark2009-02-101-634/+0
|
* Bump VERSIONs in all non-dual-lived modules that have changedSteve Hay2008-09-151-1/+1
| | | | | | | | | | since 5.8.8, ready for merging into maint-5.8 prior to 5.8.9. (Many (all?) of these should really have been changed prior to 5.10.0, but better late than never.) Also modify cmpVERSION.pl to skip uninstalled test modules whose VERSIONs don't really matter. p4raw-id: //depot/perl@34365
* Patch by Tod Hagan to document the 2nd argument of reval() in Safe.pmRafael Garcia-Suarez2008-08-241-2/+6
| | | p4raw-id: //depot/perl@34222
* Regexp::DESTROY was only added in 5.8.1Rafael Garcia-Suarez2008-03-131-3/+4
| | | p4raw-id: //depot/perl@33503
* Re: [PATCH] Splitting OP_CONST (Was: pp_const, not, that, hot?)Vincent Pit2008-02-231-0/+2
| | | | | | Message-ID: <47B60D72.50708@profvince.com> Date: Fri, 15 Feb 2008 23:08:50 +0100 p4raw-id: //depot/perl@33356
* Adapt Safe innards to older (XS) versions of version.pmRafael Garcia-Suarez2008-02-051-0/+1
| | | p4raw-id: //depot/perl@33238
* Fix CPAN bug #32896: make version.pm loadable in a Safe compartmentRafael Garcia-Suarez2008-02-051-0/+2
| | | p4raw-id: //depot/perl@33236
* Break apart the list of functions defined in universal.c by perlNicholas Clark2008-02-011-13/+16
| | | | | version (from 5.8.8 upwards) p4raw-id: //depot/perl@33170
* Bump Safe's versionRafael Garcia-Suarez2008-01-301-1/+1
| | | p4raw-id: //depot/perl@33124
* Bump the version of SafeRafael Garcia-Suarez2008-01-281-1/+1
| | | p4raw-id: //depot/perl@33096
* In Safe, load Carp::Heavy only if it exists (to remainRafael Garcia-Suarez2008-01-281-1/+3
| | | | | compatible with older perls) p4raw-id: //depot/perl@33093
* Eliminate the OP_SETSTATE, which had been disabled by change 4309.Nicholas Clark2008-01-261-2/+2
| | | p4raw-id: //depot/perl@33072
* Purge all use of Nullch in non-dual life modules.Nicholas Clark2008-01-231-1/+1
| | | | | Exterminate! Exterminate! Exterminate! p4raw-id: //depot/perl@33052
* Implement each @array.Nicholas Clark2007-12-201-2/+2
| | | | | | 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
* Change maintainer address for Safe.Rafael Garcia-Suarez2007-12-081-4/+4
| | | p4raw-id: //depot/perl@32597
* Funny symbol table names can be shared, tooRafael Garcia-Suarez2007-10-121-3/+0
| | | p4raw-id: //depot/perl@32103
* Share the internal XS functions defined in universal.cRafael Garcia-Suarez2007-10-121-1/+49
| | | | | to Safe compartments p4raw-id: //depot/perl@32102