summaryrefslogtreecommitdiff
path: root/scope.c
Commit message (Collapse)AuthorAgeFilesLines
* When saving ints, if the value is small enough save it with the type.Nicholas Clark2010-05-051-1/+11
| | | | This uses a new type, SAVEt_INT_SMALL.
* When saving I32s, if the value is small enough save it with the type.Nicholas Clark2010-05-051-1/+11
| | | | This uses a new type, SAVEt_I32_SMALL.
* For SAVEt_I16, save the value with the type.Nicholas Clark2010-05-041-2/+4
|
* For SAVEt_I8, save the value with the type.Nicholas Clark2010-05-041-2/+4
|
* For SAVEt_BOOL, save the value with the type.Nicholas Clark2010-05-031-4/+3
|
* For SAVEt_ALLOC, store the number of save stack entries used with the type.Nicholas Clark2010-05-031-8/+9
|
* For SAVEt_REGCONTEXT, store the number of save stack entries used with the type.Nicholas Clark2010-05-021-0/+3
|
* Fix c6bf6a65 - 64 bit big endian builds were broken.Nicholas Clark2010-05-031-1/+1
|
* For SVt_CLEAR, store the pad offset with the type.Nicholas Clark2010-05-021-4/+9
| | | | This saves 1 slot on the save stack for each lexical encountered at run time.
* On the save stack, store the save type as the bottom 6 bits of a UV.Nicholas Clark2010-05-011-13/+15
| | | | This makes the other 26 (or 58) bits available for save data.
* Globs that are in symbol table can be un-globbedLubomir Rintel (GoodData)2010-04-261-3/+12
| | | | | | | | | | | If a symbol table entry is undefined when a glob is assigned into it, it gets a FAKE flag which makes it possible to be downgraded when non-glob is subsequently assigned into it. It doesn't really matter, until we decide to localize it -- it wouldn't be possible to restore its GP upon context return if it changed type, therefore we must not do that. This patch turns off FAKE flag when localizing a GV and restores it when the context is left. A test case is included.
* Move PERL_ASYNC_CHECK() from the runloop to control flow OPs.Nicholas Clark2010-04-151-0/+2
| | | | | | | | | For the typical code this gives a 5% speedup, and removes the cost of "safe signals". Tight looping code will show less gains, but should never be slower. Subtle bugs might remain - there might be constructions that enter the runloop (where signals used to be dispatched) but don't contain any PERL_ASYNC_CHECK() calls themselves.
* use cBOOL for bool castsDavid Mitchell2010-04-151-1/+1
| | | | | | | | | | | | | bool b = (bool)some_int doesn't necessarily do what you think. In some builds, bool is defined as char, and that cast's behaviour is thus undefined. So this line in mg.c: const bool was_temp = (bool)SvTEMP(sv); was actually setting was_temp to false even when the SVs_TEMP flag was set. Fix this by replacing all the (bool) casts with a new cBOOL() cast macro that (hopefully) does the right thing.
* fix minor casting issueDavid Mitchell2010-04-131-2/+2
|
* RT 8857: premature free in local of tied elementDavid Mitchell2010-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [The original bug report concerned local($_) remained tied, but while looking at it, Nicholas found some related code that popped up premature free errors. This commit fixes the freeing issue rather than the issue of the original bug report ] Background: local $a[0] does, approximately: svp = av_fetch(av); SAVE(av,*svp); sv = newSV(); *svp = sv; This used to leak when av was tied, as the new sv only got embedded in *svp, which for tied arrays is a temporary placeholder rather than somewhere within AvARRAY. This leak was fixed in 2002 by adding the following: if (SvTIED_mg(sv, PERL_MAGIC_tiedelem)) sv_2mortal(sv); which worked, except for the following: sub f { local $_[0] } f($_) for ($tied[0]); Here, @_ is a real array not a tied one, yet its first element is a PERL_MAGIC_tiedelem which trigged the test above. So the sv got mortalised *and* stored in the array, so got freed twice. The fix is to test the *array/hash* for tied-ness rather than the element.
* improve -Dl debugging outputDavid Mitchell2010-03-301-0/+2
| | | | | In particular, distinguish between scope and context stack push/pops, show depth of JUMPENV stack, and show STACKINFO push/pops
* Fix compiler warning:Jerry D. Hedden2009-11-131-1/+1
| | | | scope.c:96:8: warning: extra tokens at end of #endif directive
* Add ENTER_with_name and LEAVE_with_name to automaticly check for matching ↵Gerard Goossen2009-11-121-0/+6
| | | | ENTER/LEAVE when debugging is enabled
* SvREFCNT_dec already checks if the SV is non-NULL (continued)Vincent Pit2009-11-081-6/+2
|
* Introduce save_hdelete() and SAVEHDELETE()Vincent Pit2009-07-251-0/+15
| | | | save_hdelete() is just like save_delete() except that it takes an SV instead of char buffer.
* Add a new SAVEf_KEEPOLDELEM flag to save_scalar_at() and save_{a,h}elem_flags()Vincent Pit2009-07-251-3/+12
| | | | When set, save_scalar_at() doesn't replace the given SV by a fresh new one. local magic is not called in this case.
* Introduce save_aelem_flags()Vincent Pit2009-07-251-3/+3
| | | | It's the symmetric of save_helem_flags(). save_aelem() is now a macro wrapping around save_aelem_flags().
* Add save_adelete()/SAVEADELETE() to save on the stack an array element deleteVincent Pit2008-12-281-0/+18
|
* Fix for tainting regression in a test of Text::Template spotted byNicholas Clark2008-12-031-0/+4
| | | | | Andreas' smoker. p4raw-id: //depot/perl@34987
* The temporary SV created in Perl_save_helem_flags() to store the keyNicholas Clark2008-12-011-2/+1
| | | | | | can be freed immediately after it is used, as it is unrelated to anything else. This folds SvREFCNT_dec()s on two code paths into one. p4raw-id: //depot/perl@34973
* Change 34966 should also have removed the SSCHECK(4); fromNicholas Clark2008-12-011-1/+0
| | | | | Perl_save_hints(). p4raw-id: //depot/perl@34970
* Implement Perl_save_delete() using save_pushptri32ptr().Nicholas Clark2008-12-011-5/+1
| | | p4raw-id: //depot/perl@34968
* Re-order Perl_save_delete() to PTR, INT, PTR.Nicholas Clark2008-12-011-2/+3
| | | p4raw-id: //depot/perl@34967
* Add S_save_pushptri32ptr() and use it to re-implement Perl_save_hints()Nicholas Clark2008-12-011-9/+17
| | | | | and Perl_save_aelem(). p4raw-id: //depot/perl@34966
* Move the implmentation of SAVEHINTS() into a new Perl_save_hints() inNicholas Clark2008-12-011-0/+19
| | | | | | scope.c. "Inlined" macro functions in scope.h are actually space inefficient. p4raw-id: //depot/perl@34965
* For SAVEHINTS(), re-order the savestack to be (?:PTR, )? INT, PTR.Nicholas Clark2008-12-011-1/+1
| | | | | This brings it to the same order as save_aelem() or save_pushi32ptr(). p4raw-id: //depot/perl@34964
* Expose save_pushi32ptr() and implement SAVECOPARYBASE() with it.Nicholas Clark2008-12-011-2/+2
| | | p4raw-id: //depot/perl@34963
* Expose save_pushptrptr() and implement SAVESWITCHSTACK() with it.Nicholas Clark2008-12-011-2/+2
| | | p4raw-id: //depot/perl@34960
* Refactor all of the code of the formNicholas Clark2008-11-301-23/+21
| | | | | | | | | SSCHECK(3); SSPUSHINT(i); SSPUSHPTR(ptr); SSPUSHINT(type); into a static function S_save_pushi32ptr(). p4raw-id: //depot/perl@34959
* Refactor all of the code of the formNicholas Clark2008-11-301-56/+26
| | | | | | | | | | | SSCHECK(3); SSPUSHPTR(ptr1); SSPUSHPTR(ptr2); SSPUSHINT(type); into a static function S_save_pushptrptr(). It might be possible to make some of its callers trivial macros, and so eliminate them as functions. But start with the easy part. p4raw-id: //depot/perl@34957
* Convert all the scope save functions of the formNicholas Clark2008-11-301-42/+3
| | | | | | | | | SSCHECK(2); SSPUSHPTR(o); SSPUSHINT(SAVEt_FREEOP); into a single function Perl_save_pushptr(ptr, type), which the others call. Implement the others as macros. This reduces the object code size. p4raw-id: //depot/perl@34956
* This feels like a more robust location than that of change 34954.Nicholas Clark2008-11-301-2/+2
| | | p4raw-id: //depot/perl@34955
* Proposed fix for -T -d:NYTProf regression. Probably this is a "missing"Nicholas Clark2008-11-301-0/+2
| | | | | part of change 24943. p4raw-id: //depot/perl@34954
* Re: [perl #60360] [PATCH] UPDATED: local $SIG{FOO} = sub {...}; sets signal ↵Chip Salzenberg2008-11-131-8/+8
| | | | | | | | | | | | handler to SIG_DFL Message-ID: <20081112234504.GI2062@tytlal.topaz.cx> Updated patch to retain source compatibility. Plus using the correct PERL_ARGS_ASSERT_SAVE_HELEM_FLAGS macro and running make regen. p4raw-id: //depot/perl@34829
* Re: [perl #60360] [PATCH] local $SIG{FOO} = sub {...}; sets signalChip Salzenberg2008-11-121-9/+9
| | | | | Message-ID: <20081111000040.GB19329@tytlal.topaz.cx> p4raw-id: //depot/perl@34819
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-2/+4
| | | | | | Message-ID: <25940.1225611819@chthon> Date: Sun, 02 Nov 2008 01:43:39 -0600 p4raw-id: //depot/perl@34698
* Add MUTABLE_GV(), and eliminate (V *) casts in *.c.Nicholas Clark2008-10-311-5/+5
| | | | | | Can't easily do gv.h, as GvGP() (at least) needs to split into two macros - one const for reading, one non-const for writing. p4raw-id: //depot/perl@34679
* Eliminate (SV *) casts from the rest of *.c, picking up one (further)Nicholas Clark2008-10-301-24/+24
| | | | | erroneous const in dump.c. p4raw-id: //depot/perl@34675
* Eliminate (AV *) casts in *.c.Nicholas Clark2008-10-291-8/+8
| | | p4raw-id: //depot/perl@34650
* Every remaining (HV *) cast in *.cNicholas Clark2008-10-281-6/+6
| | | p4raw-id: //depot/perl@34629
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* Clarify which save types are in mathoms, which aren't used, and whichNicholas Clark2008-10-161-9/+14
| | | | | still are in use. p4raw-id: //depot/perl@34494
* Chainsaw DEBUG_S out, as suggested by Vincent Pit.Rafael Garcia-Suarez2008-02-261-4/+0
| | | p4raw-id: //depot/perl@33376
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-0/+83
| | | | | | | | | | | | 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
* Investigation reveals that the work of restoring the iterator to theNicholas Clark2008-01-261-9/+12
| | | | | | | | | | | | | | | | | 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