summaryrefslogtreecommitdiff
path: root/cop.h
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate cop_label from struct cop by storing a label as the firstNicholas Clark2008-04-071-11/+3
| | | | | | entry in the hints hash. Most statements don't have labels, so this will save memory. Not sure how much. p4raw-id: //depot/perl@33656
* Change 33653 (inevitably) missed one cop_label, because I mistook itNicholas Clark2008-04-061-1/+1
| | | | | for part of some other context-stack related struct. p4raw-id: //depot/perl@33655
* A macro used only once isn't a typing saving, and 3 macro definitionsNicholas Clark2008-04-061-1/+1
| | | | | | | never used are more obfuscation than clarification, so inline the only use of SAVECOPLABEL_FREE(), and remove the unthreaded variant and both SAVECOPLABEL()s. Exterminate! Exterminate! Exterminate! p4raw-id: //depot/perl@33654
* Micro-optimise the order of the context types. [Because I can :-)]Nicholas Clark2008-02-041-12/+19
| | | | | Here saves 72 bytes in pp_ctl.o. Small, but in the right direction. p4raw-id: //depot/perl@33232
* The third argument of PUSHEVAL was never used by anything. Ever.Nicholas Clark2008-01-281-1/+1
| | | p4raw-id: //depot/perl@33086
* The layout for struct block_loop under ithreads can be simplified.Nicholas Clark2008-01-261-17/+18
| | | | | | | | | | | | | 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-16/+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
* As itersave points to the initial CxITERVAR(), and the state ofNicholas Clark2008-01-261-10/+7
| | | | | | | | | SvPADMY() does not change over the duration of the scope, we can perform conditional actions at loop push time. For the non-pad case, a reference to the initial CxITERVAR() is already held on the scope stack thanks to SAVEGENERICSV(*svp); in pp_enteriter. So there is no need to save another reference to it in itersave - it's not going away. p4raw-id: //depot/perl@33076
* Restore the else block accidently eaten by change 33074.Nicholas Clark2008-01-261-0/+3
| | | p4raw-id: //depot/perl@33075
* In POPLOOP, if CxITERVAR(cx) is non-NULL, then so is itersave, andNicholas Clark2008-01-261-4/+1
| | | | | itersave is a less complex expression for the C compiler. p4raw-id: //depot/perl@33074
* Re: struct context now 12.5% smaller than 5.10Benjamin Smith2008-01-261-28/+24
| | | | | | Message-ID: <20080124215537.GB10198@vtrl.co.uk> Date: Thu, 24 Jan 2008 21:55:37 +0000 p4raw-id: //depot/perl@33070
* In struct block_loop, merge itermax and iterlval into a unionNicholas Clark2008-01-241-18/+10
| | | | | | | | | 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-5/+9
| | | | | 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-3/+6
| | | | | | 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-2/+3
| | | | | 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-11/+20
| | | | | CXp_FOREACH flag added as part of given/when. p4raw-id: //depot/perl@33057
* Eliminate the U8 sbu_once from struct subst, and shrink sbu_rflags fromNicholas Clark2008-01-211-5/+5
| | | | | I32 to U8, which reduces the size of the struct by at least 4 bytes. p4raw-id: //depot/perl@33035
* In struct block_subst, access the member once via a macro CxONCE()Nicholas Clark2008-01-211-0/+2
| | | | | which will allow the storage location to be changed. p4raw-id: //depot/perl@33034
* Tidy up context type flags.Nicholas Clark2008-01-211-10/+9
| | | p4raw-id: //depot/perl@33032
* In struct block_eval, eliminate old_in_eval and old_op_type by storingNicholas Clark2008-01-211-7/+10
| | | | | the data in blk_u16. p4raw-id: //depot/perl@33030
* In struct block_eval, access the members old_in_eval and old_op_typeNicholas Clark2008-01-211-2/+5
| | | | | | via macros CxOLD_IN_EVAL() and CxOLD_OP_TYPE(), which will allow the storage location to be changed. p4raw-id: //depot/perl@33029
* In struct block change blku_type from U8 to U16, and the "spare" U8 toNicholas Clark2008-01-211-10/+9
| | | | | | U16, with the lockstep changes in struct subst. Eliminate lval from struct block_sub, and instead store it in the U16 in struct block. p4raw-id: //depot/perl@33028
* Squeeze the context type down to 4 bits, and move the private flags toNicholas Clark2008-01-211-9/+12
| | | | | fit within the next 4 bits. p4raw-id: //depot/perl@33027
* Give G_VOID, G_SCALAR and G_ARRAY the same numeric values asNicholas Clark2008-01-211-10/+10
| | | | | OPf_WANT_VOID, OPf_WANT_SCALAR and OPf_WANT_LIST. p4raw-id: //depot/perl@33025
* Add a flag G_WANT, as a mask for the bits G_SCALAR, G_ARRAY and G_VOID.Nicholas Clark2008-01-211-0/+1
| | | p4raw-id: //depot/perl@33021
* Eliminate hasargs from structs block_sub and block_format by storingNicholas Clark2008-01-201-5/+5
| | | | | it with a private flag CXp_HASARGS in cx_type. (It's only a boolean.) p4raw-id: //depot/perl@33018
* In struct block_sub and block_format, access the members hasargs andNicholas Clark2008-01-201-1/+3
| | | | | | lval via macros CxHASARGS() and CxLVAL(), which will allow the storage location to be changed. p4raw-id: //depot/perl@33017
* Move retop first in structs block_sub, block_format and block_eval.Nicholas Clark2008-01-201-3/+6
| | | | | This simplifies some code in Perl_deb_stack_all(). p4raw-id: //depot/perl@33016
* Eliminate label from struct block_loop, as it can be accessed viaNicholas Clark2008-01-201-3/+1
| | | | | oldcop. p4raw-id: //depot/perl@33015
* Split struct block_sub into struct block_sub and struct block_format.Nicholas Clark2008-01-201-12/+25
| | | | | | (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
* Extend PUSHFORMAT() to take a second parameter to set retop, to saveNicholas Clark2008-01-201-2/+2
| | | | | NULLing it and then reassigning. p4raw-id: //depot/perl@33012
* Fix (probable) bug-by-inspection - CxREALEVAL(), CxTRYBLOCK(),Nicholas Clark2008-01-201-4/+4
| | | | | | CxFOREACH() and CxFOREACHDEF() should all be masking against CXTYPEMASK rather than their own type number. p4raw-id: //depot/perl@33011
* In struct block_loop access element label via the macro CxLABEL()Nicholas Clark2008-01-201-0/+1
| | | | | (for the places that aren't about to change) p4raw-id: //depot/perl@33010
* Add dtrace supportAndy Armstrong2008-01-111-0/+9
| | | | | | | | | Message-Id: <F4AC553F-7C7F-49C3-98C2-E04681E1004F@hexten.net> with fixups as discussed on list, plus adding usedtrace to Glossary, plus propagating all the new config variables everywhere. (Was there an automatic way to do that? I did it with emacs macros) p4raw-id: //depot/perl@32953
* Add newSVpvs_flags() as a wrapper to newSVpvn_flags(), and reworkNicholas Clark2008-01-031-1/+1
| | | | | sv_2mortal(newSVpvs(...)) constructions to use it. p4raw-id: //depot/perl@32819
* Fix up copyright years for files modified in 2007.Nicholas Clark2007-11-071-1/+1
| | | p4raw-id: //depot/perl@32237
* For an LVALUE fetch, "hv_fetch()" will recurse into "hv_store()" for aNicholas Clark2007-09-191-1/+3
| | | | | | | | | hash with magic. Field hashes have u magic, so this recursion triggers. However, key conversion replaces the original key with the converted key, so we need to ensure that conversion happens exactly once, else for a non-idempotent key conversion routine (eg ROT13) we will see double conversion in this case. p4raw-id: //depot/perl@31898
* BASEOP isn't an exact multiple of 8 bytes, so reordering pmop and copNicholas Clark2007-05-151-1/+3
| | | | | to put a 32 bit member first elimiates structure padding on LP64. p4raw-id: //depot/perl@31218
* move PL_linestr from the interpreter struct to the parser structDave Mitchell2007-04-241-1/+1
| | | p4raw-id: //depot/perl@31058
* A safer version of CopFILE, by JarkkoRafael Garcia-Suarez2007-04-231-1/+2
| | | p4raw-id: //depot/perl@31032
* Rearrange members of structures to reduce memory size on someNicholas Clark2007-03-311-2/+2
| | | | | | platforms. On LP64 structs stackinfo, refcounted_he, and magic shrink by 8 bytes, struct yy_parser by 16. p4raw-id: //depot/perl@30817
* Stop S_incline needing to temporarily write a '\0' into its passed-inNicholas Clark2007-01-261-0/+3
| | | | | | buffer. (Requires adding gv_fetchfile_flags(), savesharedpvn() and CopFILE_setn() to provide pointer/length versions of APIs) p4raw-id: //depot/perl@30015
* Fix a typo and some doubled spaces in comments.Nicholas Clark2007-01-221-1/+1
| | | p4raw-id: //depot/perl@29922
* Fix leaks in label strings allocation in COPsRafael Garcia-Suarez2006-12-201-7/+5
| | | p4raw-id: //depot/perl@29601
* Don't free the original label string when assigning it to cop_label,Rafael Garcia-Suarez2006-12-201-2/+3
| | | | | | since it comes directly from the parser. (That was making op/goto.t fail under threads and without debugging on some platforms.) p4raw-id: //depot/perl@29600
* Re: [PATCH] do not meddle in the affairs of PERL_TRACK_MEMPOOLJarkko Hietaniemi2006-12-181-0/+11
| | | | | | | Message-ID: <4586084E.8040706@iki.fi> Introduce CopLABEL() macro to deal with labels attached to COPs. p4raw-id: //depot/perl@29585
* assert() that SvPV_set() isn't used on arrays.Nicholas Clark2006-11-061-1/+1
| | | p4raw-id: //depot/perl@29221
* Fix change 28770 to cope with the strange 32 bit bool type on VMS.Nicholas Clark2006-10-161-2/+3
| | | | | | (I should have seen this one coming - the two structures weren't textually identical) p4raw-id: //depot/perl@29024
* Some notes about struct block_loopNicholas Clark2006-09-171-0/+17
| | | p4raw-id: //depot/perl@28859
* Store a pointer to the op in struct block_loop, rather than the Nicholas Clark2006-09-171-6/+14
| | | | | | | pointers to last and redo. (for ithreads also drop the next pointer, as pp_ctl.c doesn't re-write it for ithreads). This shrinks the struct to 40 bytes on ILP32 systems, and therefore struct block to 64 bytes. p4raw-id: //depot/perl@28858