summaryrefslogtreecommitdiff
path: root/sv.c
Commit message (Collapse)AuthorAgeFilesLines
* use svtypeRobin Barker2008-02-141-1/+1
| | | | | | From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D093A35@exchsvr2.npl.ad.local> p4raw-id: //depot/perl@33304
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-7/+307
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* Re: [PATCH] sv.c: constingSteven Schubiger2008-02-081-10/+10
| | | | | Message-ID: <20080207165158.GA22321@refcnt.homeunix.org> p4raw-id: //depot/perl@33249
* Re: [PATCH] sv.c: constingSteven Schubiger2008-02-071-11/+11
| | | | | Message-ID: <20080204144419.GB20276@refcnt.homeunix.org> p4raw-id: //depot/perl@33245
* sv.c: constingSteven Schubiger2008-02-041-8/+8
| | | | | Message-ID: <20080203185315.GA20276@refcnt.homeunix.org> p4raw-id: //depot/perl@33231
* The layout for struct block_loop under ithreads can be simplified.Nicholas Clark2008-01-261-7/+8
| | | | | | | | | | | | | Instead of wedging the pad offset into a void* iterdata, and always storing PL_comppad even when it isn't used, instead do this: PAD *oldcomppad; /* Also used for the GV, if targoffset is 0 */ /* This is also accesible via cx->blk_loop.my_op->op_targ */ PADOFFSET targoffset; and store the GV pointer in oldcompad. Pointers to pointers seems cleaner. This also allows us to eliminate the flag bit CXp_PADVAR. p4raw-id: //depot/perl@33081
* Investigation reveals that the work of restoring the iterator to theNicholas Clark2008-01-261-4/+2
| | | | | | | | | | | | | | | | | pad is shared between POPLOOP, using itersave, and the end of scope restore action requested by Perl_save_padsv(). In fact, the only user of SAVEt_PADSV is pp_enteriter, and it already provides enough information to allow it to perform the sv_2mortal() in POPLOOP. So make it do so. Rather than creating a new routine, use the existing routine because nothing else (at least nothing else known to Google's codesearch) uses it. But rename it just in case something we can't see is being naughty and using our private functions - they will get link errors against 5.12. All this means that itersave is now redundant. So remove it. This makes struct context 48 bytes on ILP32 platforms with 32bit IVs, down from 64 bytes in 5.10. 33% more context stack in the same memory. p4raw-id: //depot/perl@33080
* Some code can be removed following change 33070.Nicholas Clark2008-01-261-4/+6
| | | p4raw-id: //depot/perl@33073
* Re: struct context now 12.5% smaller than 5.10Benjamin Smith2008-01-261-7/+10
| | | | | | Message-ID: <20080124215537.GB10198@vtrl.co.uk> Date: Thu, 24 Jan 2008 21:55:37 +0000 p4raw-id: //depot/perl@33070
* PVIOs don't need space for SvNVX allocated.Nicholas Clark2008-01-251-2/+3
| | | p4raw-id: //depot/perl@33069
* In struct block_loop, merge itermax and iterlval into a unionNicholas Clark2008-01-241-2/+3
| | | | | | | | | lval_max_u, as CXt_LOOP_LAZYIV doesn't use iterlval and the other LOOP types don't use itermax. This reduces struct block_loop by 1 IV. As it's the largest component of the unions making up struct context, this reduces struct context. On ILP32 it will now be 56 bytes, down from the 64 of 5.10.x, as I've already removed the element 'label'. p4raw-id: //depot/perl@33063
* Merge CXt_LOOP_STACK's use of itermax for the reverse minimum withNicholas Clark2008-01-241-2/+2
| | | | | iterary, as the two structure members are not used simultaneously. p4raw-id: //depot/perl@33062
* Change the context type of for ($a .. $b) to CXt_LOOP_LAZYIV, andNicholas Clark2008-01-241-0/+1
| | | | | | assert that it isn't using cx->blk_loop.iterlval. Fix a casting bug when assigning a sentinal to cx->blk_loop.iterary. p4raw-id: //depot/perl@33061
* Split out foreach iterations of temporary lists on the stack toNicholas Clark2008-01-241-0/+1
| | | | | CXt_LOOP_STACK. Don't use cx->blk_loop.iterary to store PL_curstack. p4raw-id: //depot/perl@33059
* Split CXt_LOOP into CXt_LOOP_PLAIN and CXt_LOOP_FOR, eliminating theNicholas Clark2008-01-241-3/+4
| | | | | CXp_FOREACH flag added as part of given/when. p4raw-id: //depot/perl@33057
* Fix the misplaced warnings and failing tests caused by the precisionNicholas Clark2008-01-231-6/+6
| | | | | | | | loss warning on ++ and -- by moving the check to Configure time, creating a new config.sh variable nv_overflows_integers_at which contains an constant expression for the value of the NV which can't be incremented by 1.0 p4raw-id: //depot/perl@33049
* In struct block_sub and block_format, access the members hasargs andNicholas Clark2008-01-201-1/+1
| | | | | | lval via macros CxHASARGS() and CxLVAL(), which will allow the storage location to be changed. p4raw-id: //depot/perl@33017
* Split struct block_sub into struct block_sub and struct block_format.Nicholas Clark2008-01-201-3/+3
| | | | | | (CXt_SUB and CXt_FORMAT were using some comon members, but some members were only for one or the other.) p4raw-id: //depot/perl@33014
* In Perl_cx_dup(), block copy the entire context stack, then walk itNicholas Clark2008-01-201-45/+31
| | | | | to duplicate/fixup only the things that aren't simple binary copies. p4raw-id: //depot/perl@33013
* Avoid an unused argument in S_sv_2iuv_non_preserve() by usingNicholas Clark2008-01-181-2/+9
| | | | | conditional compilation to only pass it in if it's needed. p4raw-id: //depot/perl@33004
* warn if ++ or -- are unable to change the value because it's beyondNicholas Clark2008-01-171-6/+25
| | | | | | the limit of representation in NVs, using a new warnings category "imprecision". p4raw-id: //depot/perl@32990
* A couple of POD fixes by Steven SchubigerRafael Garcia-Suarez2008-01-161-1/+1
| | | p4raw-id: //depot/perl@32982
* For 5.12: saner behaviour for `length`Nicholas Clark2008-01-121-4/+8
| | | | | | (Make C<length undef> return undef). Patch mostly by Rafael, with some fine tuning by me. p4raw-id: //depot/perl@32969
* Remove the -P switchRafael Garcia-Suarez2008-01-111-1/+0
| | | p4raw-id: //depot/perl@32954
* Ensure DEBUG_LEAKING_SCALARS_ABORT can't be circumvented by fatalNicholas Clark2008-01-101-5/+19
| | | | | warnings. Add an abort() if you try to dup a freed scalar. p4raw-id: //depot/perl@32937
* Move the reg_stringify logic to Perl_sv_2pv_flagsÆvar Arnfjörð Bjarmason2008-01-101-15/+19
| | | | | | | | Message-ID: <86zlveaewk.fsf@cpan.org> with two corrections. Plus remove reg_stringify from embed.fnc and regen. p4raw-id: //depot/perl@32934
* Add DEBUG_LEAKING_SCALARS_ABORT, to call abort() if any scalars leak,Nicholas Clark2008-01-091-0/+3
| | | | | or are freed too many times. p4raw-id: //depot/perl@32918
* PL_regex_padav can simply be dup()ed. This is surprisingly satisfying.Nicholas Clark2008-01-081-18/+5
| | | p4raw-id: //depot/perl@32901
* In PL_regexp_padav, store regexps via real references, rather thanNicholas Clark2008-01-081-8/+2
| | | | | | hiding them within IVs. We can do this now that they are real SV pointers. p4raw-id: //depot/perl@32900
* Correct a long-standing ithreads reference counting anonamly - theNicholas Clark2008-01-081-2/+1
| | | | | | reference count only needs "doubling" when the scalar is pushed onto PL_regex_padav for the second time. p4raw-id: //depot/perl@32899
* Don't set the public IV or NV flags if the string converted from hasNicholas Clark2008-01-071-4/+28
| | | | | | trailing garbage. This behaviour is consistent with not setting the public IV or NV flags if the value is out of range for the type. p4raw-id: //depot/perl@32894
* Remove FIXME that is already fixed.Yves Orton2008-01-061-1/+1
| | | p4raw-id: //depot/perl@32882
* Make new regex type be 'REGEXP' and make all core qr//'s be in class Regexp ↵Yves Orton2008-01-061-1/+1
| | | | | (and related changes) p4raw-id: //depot/perl@32880
* Allow sv_setsv_flags() to copy SVt_REGEXP much like it copiesNicholas Clark2008-01-061-0/+1
| | | | | SVt_FORMAT - the just string buffer. p4raw-id: //depot/perl@32863
* Make REGEXP a type distinct from SV. (Much like AV, CV, GV, HV).Nicholas Clark2008-01-051-4/+4
| | | p4raw-id: //depot/perl@32861
* Don't allocate the NV slot for SVt_REGEXP.Nicholas Clark2008-01-051-2/+4
| | | p4raw-id: //depot/perl@32859
* BER is all very well, but it turns out that it's better to store theNicholas Clark2008-01-051-56/+14
| | | | | | | | offset as either a byte (if <256), or a 0 byte with a STRLEN before. "better" in that the reading can be inlined, and even then the object code is smaller (function calls have space overhead). So goodbye Perl_sv_read_offset() and hello SvOOK_offset(). p4raw-id: //depot/perl@32838
* Re-implement the SvOOK() hack to store the offset as a BER encodedNicholas Clark2008-01-041-37/+86
| | | | | | | | | | | number in the part of the PVX that is being released. (It will always fit, as chopping off 1 byte gives just enough space for recording a delta of up to 127). This allows SvOOK() to co-exist with SvIOK_on(), which means all the calls to SvOOK_off() [with the possibility of a call to sv_backoff()] in SvIOK_on() can be removed. This ought to make a lot of straight line code a little bit simpler. OOK()d scalars can now be SVt_PV, as the IVX isn't needed. p4raw-id: //depot/perl@32836
* Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stackMarcus Holland-Moritz2008-01-041-4/+5
| | | | | | and mortalizing them. Use these macros where possible. And also mX?PUSH[inpu] where possible. p4raw-id: //depot/perl@32821
* Add newSVpvs_flags() as a wrapper to newSVpvn_flags(), and reworkNicholas Clark2008-01-031-2/+2
| | | | | sv_2mortal(newSVpvs(...)) constructions to use it. p4raw-id: //depot/perl@32819
* Extend newSVpvn_flags() to also call sv_2mortal() if SVs_TEMP is set inNicholas Clark2008-01-031-36/+38
| | | | | | the flags. Move its implementation just ahead of sv_2mortal()'s for CPU cache locality. Refactor all code that can be to use this. p4raw-id: //depot/perl@32818
* Possible future bugs found by the creation of newSVpvn_flags().Nicholas Clark2008-01-031-1/+1
| | | | | But use newSVhek() in preference when possible. p4raw-id: //depot/perl@32813
* Typo spotted by Jarkko.Nicholas Clark2008-01-031-1/+1
| | | p4raw-id: //depot/perl@32811
* Add a new function newSVpvn_flags(), which takes a third parameter ofNicholas Clark2008-01-021-2/+32
| | | | | | | | | | flag bits. Right now the only flag bit is SVf_UTF8, which will call SvUTF8_on() on the new SV for you. Provide a wrapper newSVpvn_utf8(), which takes a boolean, and passes in SVf_UTF8 if that is true. Refactor the core to use it where possible. It makes the source code clearer and smaller, but seems to be swings and roundabouts on object code size. p4raw-id: //depot/perl@32807
* Make struct regexp the body of SVt_REGEXP SVs, REGEXPs become SVs,Nicholas Clark2008-01-021-13/+21
| | | | | | and regexp reference counting is via the regular SV reference counting. This was not as easy at it looks. p4raw-id: //depot/perl@32804
* assert() that we're not trying to free scalars a second time.Nicholas Clark2007-12-311-0/+1
| | | p4raw-id: //depot/perl@32788
* In sv_chop(), write sentinals over the part of the buffer that isNicholas Clark2007-12-291-0/+23
| | | | | | thrown away, and verify that they are present in sv_backoff(). assert that we are being asked to chop off positive amounts of buffer. p4raw-id: //depot/perl@32778
* Move all code that relies on reading the to-be-thrown-away buffer aheadNicholas Clark2007-12-291-3/+1
| | | | | of the call to sv_chop() that throws it away. p4raw-id: //depot/perl@32777
* Perl_sv_chop() can return early if it's being asked to do nothing.Nicholas Clark2007-12-291-0/+4
| | | p4raw-id: //depot/perl@32763
* First class regexps.Nicholas Clark2007-12-281-15/+20
| | | p4raw-id: //depot/perl@32751