summaryrefslogtreecommitdiff
path: root/pp.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert tied PRINT to using Perl_tied_method()Nicholas Clark2011-01-051-0/+1
| | | | | Add a flag TIED_METHOD_SAY to Perl_tied_method(), to allow tied PRINT to effect C<local $\ = "\n";> within the ENTER/LEAVE pair of Perl_tied_method().
* Rename tied_handle_method() to tied_method(), and make it non-static.Nicholas Clark2011-01-051-0/+8
| | | | It can be used for (at least) the call to "SPLICE" from pp_splice.
* reindent tryAMAGICunTARGET after previous changeDavid Mitchell2011-01-031-20/+20
|
* simplify tryAMAGICunTARGETDavid Mitchell2011-01-031-5/+1
| | | | | Expecting the targ in sp[-1] rather than sp[0] is accomplished cleanly using dATARGET.
* make <expr> always overload if expr is overloadedDavid Mitchell2011-01-021-2/+7
| | | | | | | | Due to the way that '<> as glob' was parsed differently from '<> as filehandle' from 5.6 onwards, something like <$foo[0]> didn't handle overloading, even where $foo[0] was an overloaded object. This was contrary to the docs for overload, and meant that <> couldn't be used as a general overloaded iterator operator.
* overloaded <> sometimes left an extra stack argDavid Mitchell2011-01-021-0/+2
|
* standardise amagic method namingDavid Mitchell2010-12-311-3/+6
| | | | | | | | | | | | | | Some amagic-related macros take the full method enumeration name, (e.g. "add_amg"); while others "helpfully" allow you to pass a shortened version, ("add"), and do a CAT2(meth,_amg) behind the scenes. Standardise on passing the full name; this makes it less confusing and allows you to grep for the enumeration name in the source. It updates two macros to accept full enumeration names: tryAMAGICunTARGET (which isn't used outside the core apparently), and AMG_CALLun, which is replaced by a new AMG_CALLunary (since AMG_CALLun is used outside the core).
* Fix error in tryAMAGICunDEREF() introduced in 25a9ffce153b0e67.Nicholas Clark2010-11-091-1/+1
| | | | tryAMAGICunDEREF() isn't used anywhere in the core. Add tests for it.
* Inline tryAMAGICunDEREF_var() into its callers and eliminate it.Nicholas Clark2010-11-031-4/+4
| | | | Nothing outside the core was using this macro.
* Add Perl_amagic_deref_call() to implement the bulk of tryAMAGICunDEREF_var().Nicholas Clark2010-11-031-15/+2
| | | | | | | | | This removes around 300 bytes of object code from each place it was previously inlined. It also provides a better interface - quite a lot of the core currently bodges things by creating a local variable C<SV **sp = &sv> to use the macro. Change the XS::APItest wrapper to amagic_deref_call().
* Inline RvDEEPCP() into its only caller, Perl_amagic_call().Nicholas Clark2010-11-021-12/+0
| | | | | | | Only Perl_amagic_call() was using RvDEEPCP() when it was added in 5.000, and I believe that it's never had any other users (in the core, on CPAN, or anywhere else visible to Google codesearch). Hence it seems an ideal candidates to be inlined and eliminated.
* Implement the loop in tryAMAGICunDEREF_var() using while, rather than goto.Nicholas Clark2010-11-021-7/+7
| | | | | | | | Yes, it was a while loop implemented using goto, although this only became clear by untangling the macros. I believe it need never have been implemented as goto, given that the other user of tryAMAGICunW_var "broke" out of the "if"'s block using a return, hence that "if" could have been a "while" all along.
* Expand AMG_CALLun_var() into all its users, and eliminate it.Nicholas Clark2010-11-021-6/+6
| | | | | Aside from the 2 callers where it can be replaced with AMG_CALLun(). AMG_CALLun_var was only used in core.
* Inline tryAMAGICunW_var() into macros tryAMAGICun{DEREF_var,TARGET}Nicholas Clark2010-11-021-28/+36
| | | | | | | This also inlines and eliminates FORCE_SETs and setAGAIN. The three eliminated macros were not referenced from anywhere else. (The core, CPAN, code visible to Google codesearch.)
* Eliminate tryAMAGICunW() by refactoring tryAMAGICun{DEREF,TARGET}Nicholas Clark2010-11-021-4/+2
| | | | | tryAMAGICunW was only used within pp.h itself, and not referenced from anywhere else. (The core, CPAN, code visible to Google codesearch.)
* Remove unused AMAGIC macros from pp.h. Neither core nor CPAN uses any.Nicholas Clark2010-11-021-71/+0
| | | | | | | | | | | | | | | | | | | | Since commit 6f1401dc2acd2a2b, many AMAGIC macros in pp.h are no longer used in core, nor in modules or CPAN, nor in code visible to Google codesearch. Specifically: tryAMAGICbinW_var tryAMAGICbinW tryAMAGICbin_var tryAMAGICbin tryAMAGICbinSET tryAMAGICbinSET_var tryAMAGICbinW_var AMG_CALLbinL tryAMAGICun_var tryAMAGICun tryAMAGICunSET_var tryAMAGICunSET tryAMAGICftest
* Return DIE(...) to *return*ing Perl_die(...).Nicholas Clark2010-06-271-1/+1
| | | | | | | | | Much simplification ensues - witness the diffstat. Changes Perl_die_unwind() to use Perl_croak() rather than DIE(). Reverses an unwise part of bb4c52e023e0fcad. Reverts 9e95c6350a60744d and 805bf316c58ab2d7.
* make overload respect get magicDavid Mitchell2010-05-211-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In most places, ops checked their args for overload *before* doing mg_get(). This meant that, among other issues, tied vars that returned overloaded objects wouldn't trigger calling the overloaded method. (Actually, for tied and arrays and hashes, it still often would since mg_get gets called beforehand in rvalue context). This patch does the following: Makes sure get magic is called first. Moves most of the overload code formerly included by macros at the start of each pp function into the separate helper functions Perl_try_amagic_bin, Perl_try_amagic_un, S_try_amagic_ftest, with 3 new wrapper macros: tryAMAGICbin_MG, tryAMAGICun_MG, tryAMAGICftest_MG. This made the code 3800 bytes smaller. Makes sure that FETCH is not called multiple times. Much of this bit was helped by some earlier work from Father Chrysostomos. Added new functions and macros sv_inc_nomg(), sv_dec_nomg(), dPOPnv_nomg, dPOPXiirl_ul_nomg, dPOPTOPnnrl_nomg, dPOPTOPiirl_ul_nomg dPOPTOPiirl_nomg, SvIV_please_nomg, SvNV_nomg (again, some of these were based on Father Chrysostomos's work). Fixed the list version of the repeat operator (x): it now only calls overloaded methods for the scalar version: (1,2,$overloaded) x 10 no longer erroneously calls x_method($overloaded,10)) The only thing I haven't checked/fixed yet is overloading the iterator operator, <>.
* avoid use of operator name in macroRobin Barker2010-04-261-0/+1
|
* Fix [perl #74542] 5.12.0 crash on diverse platformsRafael Garcia-Suarez2010-04-211-1/+2
| | | | | | Filetest ops don't always expect an op on the stack, so we should use TOPs only if we're sure that we're not stat'ing the _ filehandle. This is indicated by OPf_KIDS (as checked in ck_ftst).
* move JMPENV_JUMP to die_where and mark it as "noreturn"Gerard Goossen2009-11-061-1/+1
|
* Stacked overloaded -X.Ben Morrow2009-03-251-0/+13
|
* Fall back to "" overload for -X.Ben Morrow2009-03-251-1/+1
|
* Finish the rest of the -X ops.Ben Morrow2009-03-251-13/+14
|
* Move magic logic into tryAMAGICftest macro.Ben Morrow2009-03-251-0/+16
|
* Introduce SvCANEXISTDELETE in pp.h, which simplify the logic in pp_helem and ↵Vincent Pit2008-12-281-0/+9
| | | | pp_hslice
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* [perl #55786] [PATCH blead] Re: Overload Segfaulting Rick Delaney2008-06-151-3/+3
| | | | | | From: Rick Delaney (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-22068-1213469460-652.55786-75-0@perl.org> p4raw-id: //depot/perl@34055
* Re-implement mPUSHp() and mXPUSHp() using Perl_newSVpvn_flags(), whichNicholas Clark2008-01-041-2/+2
| | | | | results in slightly smaller object code. (No extra work is done.) p4raw-id: //depot/perl@32834
* There's no need to handle 'set' magic in the mX?PUSH macros.Marcus Holland-Moritz2008-01-041-35/+25
| | | | | | | | | The macros all create new mortals using sv_newmortal(), and those cannot be magical. This is in contrary to the X?PUSH macros, which operate on TARG, which can be magical. With that in mind, mentioning whether or not mX?PUSH can handle 'set' magic doesn't make sense any longer. p4raw-id: //depot/perl@32824
* Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stackMarcus Holland-Moritz2008-01-041-0/+12
| | | | | | and mortalizing them. Use these macros where possible. And also mX?PUSH[inpu] where possible. p4raw-id: //depot/perl@32821
* Fix up copyright years for files modified in 2007.Nicholas Clark2007-11-071-2/+2
| | | p4raw-id: //depot/perl@32237
* Cast markstack values to I32Jan Dubois2007-04-101-2/+2
| | | | | Message-ID: <prol131i8b27re246alnhmem4mj13fcl2b@4ax.com> p4raw-id: //depot/perl@30879
* Remove register keyword from dSP; (at least for now)Nicholas Clark2007-01-211-1/+1
| | | p4raw-id: //depot/perl@29907
* pp_rv2av and pp_rv2hv have a lot of common code, so it's certainly aNicholas Clark2007-01-151-2/+4
| | | | | space saving to merge them. Hopefully this will reduce L2 cache misses. p4raw-id: //depot/perl@29836
* Update copyright years in .h files. Also, in .plRafael Garcia-Suarez2007-01-051-1/+1
| | | | | | files that generate .h files, so they'll be ready next time. p4raw-id: //depot/perl@29695
* Merging pp_bit_or and pp_bit_xor shrinks the object code by about .7K.Nicholas Clark2006-02-071-1/+5
| | | | | The overloading tests are not free. p4raw-id: //depot/perl@27126
* Create new macros AMG_CALLun_var, AMG_CALLun_var and tryAMAGICun_varNicholas Clark2006-02-071-8/+13
| | | | | which don't do the pre-processor string manipulation internally. p4raw-id: //depot/perl@27122
* PL_amagic_generation is always non-zero, so remove the test for this.Nicholas Clark2005-12-281-4/+0
| | | | | (Since change 17990 added version object overloading) p4raw-id: //depot/perl@26516
* pre-likely cleanupAndy Lester2005-12-271-9/+11
| | | | | | | Message-ID: <20051227203939.GC1781@petdance.com> Includes a small fix to the changes in tryAMAGICbinW_var() in pp.h. p4raw-id: //depot/perl@26505
* Allow passing of the full enum name into the tryAMAGICbin family ofNicholas Clark2005-11-051-2/+8
| | | | | | macros, to avoid needing C pre-processor string concatenation within the lowest level expansion. p4raw-id: //depot/perl@26015
* tidy up DieNull and DIE_NULLRobin Barker2005-07-281-1/+0
| | | | | Message-ID: <533D273D4014D411AB1D00062938C4D90849C75C@hotel.npl.co.uk> p4raw-id: //depot/perl@25237
* Const Boy II: The LocalizingAndy Lester2005-06-231-3/+13
| | | | | Message-ID: <20050622144059.GA19598@petdance.com> p4raw-id: //depot/perl@24945
* Eliminate more C<n_a>sNicholas Clark2005-06-081-1/+1
| | | p4raw-id: //depot/perl@24757
* Convert POPpx POPpconstx and POPpbytex to use nolen macros.Nicholas Clark2005-06-081-7/+4
| | | | | Elminate a lot of C<n_a>s p4raw-id: //depot/perl@24748
* POPpx needs a const equivalent.Nicholas Clark2005-06-071-0/+1
| | | p4raw-id: //depot/perl@24723
* consting-eleventy.patch: More consts, plus actual bug fixAndy Lester2005-05-161-2/+1
| | | | | Message-ID: <20050516151353.GA25387@petdance.com> p4raw-id: //depot/perl@24489
* Refactoring to Sv*_set() macros - patch #5Steve Peters2005-04-191-1/+1
| | | | | | Message-ID: <20050419000925.GA21640@mccoy.peters.homeunix.org> Date: Mon, 18 Apr 2005 19:09:25 -0500 p4raw-id: //depot/perl@24248
* Update copyrights.Rafael Garcia-Suarez2005-03-301-1/+1
| | | p4raw-id: //depot/perl@24106
* to improve -DCHECK_FORMATRobin Barker2005-01-071-0/+1
| | | | | Message-ID: <533D273D4014D411AB1D00062938C4D90849C55A@hotel.npl.co.uk> p4raw-id: //depot/perl@23767