summaryrefslogtreecommitdiff
path: root/intrpvar.h
Commit message (Collapse)AuthorAgeFilesLines
* Simplify embedvar.h, removing a level of macro indirection for PL_* variables.Nicholas Clark2011-08-111-328/+329
| | | | | | | For the default (non-multiplicity) configuration, PERLVAR*() macros now directly expand their arguments to tokens such as C<PL_defgv>, instead of expanding to C<PL_Idefgv>. This removes over 350 lines from F<embedvar.h>, which defined macros to map from C<PL_Idefgv> to C<PL_defgv> and so forth.
* In intrpvar.h, move all the USE_LOCALE_NUMERIC variables together.Nicholas Clark2011-07-181-6/+2
| | | | | | | a453c1697467fe60 added PL_numeric_radix_sv at the end of the interpreter struct to avoid breaking binary compatibility. However, as we now explicitly no longer guarantee compatibility across major releases, there's no reason not to move it next to the other variables related to it.
* Change inversion lists to SVsKarl Williamson2011-07-031-1/+1
| | | | | | The inversion list is an opaque object, currently implemented as an SV. Even if it ends up being an HV in the future, Nicholas is of the opinion that it should be presented to the world as an SV*.
* Store C<study>'s data in in mg_ptr instead of interpreter variables.Nicholas Clark2011-07-011-4/+1
| | | | | This allows more than one C<study> to be active at the same time. It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
* Merge PL_scream{first,next} into one allocated buffer.Nicholas Clark2011-07-011-1/+0
| | | | | Effectively, PL_screamnext is now PL_screamfirst + 256. The actual interpreter variable PL_screamnext is eliminated.
* Reorder interpreter struct to remove alignment holesNicholas Clark2011-06-121-11/+10
| | | | On a LP64 system the interpreter struct should now be 8 bytes smaller.
* In perlvar.h, move the always-present globals above those conditionally compiledNicholas Clark2011-06-121-24/+23
| | | | | Rename PL_interp_size_5_10_0 to PL_interp_size_5_16_0, as it is only intended to track interpreter size within (forwards) binary compatible maintenance branches.
* Microperl doesn't do signal handlers, ifdef some handling codeDavid Leadbeater2011-03-281-0/+2
|
* intrpvar.h: Add comment about PERLVARIKarl Williamson2011-02-241-1/+2
|
* intrpvar.h: Need to initialize PL_utf8_foldableKarl Williamson2011-02-211-1/+1
|
* handy.h: isIDFIRST_utf8() changed to use XIDStartKarl Williamson2011-02-171-0/+2
| | | | | | | | | | Previously this used a home-grown definition of an identifier start, stemming from a bug in some early Unicode versions. This led to some problems, fixed by #74022. But the home-grown solution did not track Unicode, and allowed for characters, like marks, to begin words when they shouldn't. This change brings this macro into compliance with Unicode going-forward.
* Init PL_cop_seqmax to a high value under DEBUGGINGDavid Mitchell2011-02-071-1/+10
| | | | So that we get to test the effect of the value wrapping back to zero
* Add PL_foldable - a list of chars that participate in foldsKarl Williamson2011-02-021-0/+4
|
* intrpvar.h: Clarify commentKarl Williamson2011-02-021-1/+2
|
* make PL_perlio an array of PerlIOl, not PerlIO *David Mitchell2010-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Layers in PerlIO are implemented as a linked list of PerlIOl structs; eaxch one has a 'next' field pointing to the next layer. Now here's the clever bit: When PerlIO* pointers are passed around to refer to a particular handle, these are actually pointers to the 'next' field of the *parent* layer (so to access the flags field say of a PerlIOl, you have to double-defref it, e.g. (*f)->flags). The big advantage of this is that it's easy for a layer to pop itself; when you call PerlIO_pop(f), f is a pointer to the parent's 'next' field, so pop(f) can just do *f = (*f)->next. This means that there has to be a fake 'next' field above the topmost layer. This is where PL_perlio comes in: it's a pointer to an arena of arrays of pointers, each one capable of pointing to a PerlIOl structure. When a new handle is created, a spare arena slot is grabbed, and the address of that slot is returned. This also allows for a handle with no layers. What this commit does is change PL_perlio from being an array of PerlIO* into an array of PerlIOl structures - i.e. each element in the array goes from being a single pointer, to having several fields. These will be made used of in follow-up commits.
* Improve custom OP support.Ben Morrow2010-11-141-0/+2
| | | | | | | | | | | | | | | | | Change the custom op registrations from two separate hashes to one hash holding structure pointers, and add API functions to register ops and look them up. This will make it easier to add new properties of custom ops in the future. Copy entries across from the old hashes where necessary, to preserve compatibility. Add two new properties, in addition to the already-existing 'name' and 'description': 'class' and 'peep'. 'class' is one of the OA_*OP constants, and allows B and other introspection mechanisms to work with custom ops that aren't BASEOPs. 'peep' is a pointer to a function that will be called for ops of this type from Perl_rpeep. Adjust B.xs to take account of the new properties, and also to give custom ops their registered name rather than simply 'custom'.
* Eliminate PL_dirtyFlorian Ragwitz2010-11-141-2/+0
| | | | | It now only exists as a compatibility macro for extensions that want to introspect it.
* Add ${^GLOBAL_PHASE}Florian Ragwitz2010-11-141-0/+3
| | | | This exposes the current top-level interpreter phase to perl space.
* regexec.c: Don't give up on fold matching earlyKarl Williamson2010-11-071-0/+4
| | | | | | | | | | | | | | | | | | | | As noted in the comments of the code, "a" =~ /[A]/i doesn't work currently (except that regcomp.c knows about the ASCII characters and corrects for it, but not always, for example in cases like "a" =~ /\p{Upper}/i. This patch catches all those). It works by computing a list of all characters that (singly) fold to another one, and then checking each of those. The maximum length of the list is 3 in the current Unicode standard. I believe that a better long-term solution is to do this at compile rather than execution time, by generating a closure of everything matched. But this can't be done now because the data structure would need to be extensively revamped to list all non-byte characters, and user-defined \p{} matches are not known at compile-time. And it doesn't handle the multi-char folds. There is a separate ticket for those.
* new API functions op_scope and op_lvalueZefram2010-10-261-1/+1
| | | | | | The function scope() goes into the API as op_scope(), and mod() goes into the API as op_lvalue(). Both marked experimental, because their behaviour is a little quirky and not trivially dequirkable.
* Note the U8-sized space in intrpvar.h created by 737c24fc85ea612b.Nicholas Clark2010-10-221-0/+1
|
* replace PL_doextract with better kinds of variableZefram2010-10-211-1/+0
| | | | | | | | PL_doextract had two unrelated jobs, neither best served by an interpreter global variable. The first was to track the -x command-line switch. That is replaced with a local variable in S_parse_body(). The second was to track whether the lexer is in the middle of a =pod section. That is replaced with an element in PL_parser.
* embed.pl -> regen/embed.plFather Chrysostomos2010-10-131-1/+1
| | | | so newcomers can find it more easily
* Remove MEMBER_TO_FPTR.Ben Morrow2010-10-061-9/+9
| | | | This is left over from PERL_OBJECT (see beeff2, 16c915, and so on).
* stop do_clean_named_objs() leaving dangling refsDavid Mitchell2010-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently perl does 3 major scans of the SV arenas, so the action of perl_destroy() is a bit like this: for (all arena SVs) { if (its a ref to an object) undef the ref (and thus probably free the object) } for (all arena SVs) { if (it's a typeglob and at least one of its slots holds an object) { set SVf_BREAK on the gv SvREFCNT_dec(gv) } } return if $PERL_DESTRUCT_LEVEL < 1; PL_in_clean_all = 1 for (all arena SVs) { set SVf_BREAK on the sv SvREFCNT_dec(sv) } The second scan is problematic, in that by randomly zapping GVs, it can leave dangling pointers to freed GVs. This is while perl-level destructors may still be called, meaning perl users can see corrupted state. Note also that at this point PL_in_clean_all hasn't been set, so sv_free() may put out 'Attempt to free unreferenced scalar' warnings. This commit fixes this by only freeing the affected slots of the GV, rather than freeing the GV itself. Thus makes it more like the first pass, which undefs RVs, and ensures no dangling refs.
* documentation on hooking the peephole optimiserZefram2010-09-101-2/+44
| | | | | Signed-off-by: Florian Ragwitz <rafl@debian.org> [rafl@debian.org: Changed tabs to spaces in perlguts chunks for consistency]
* Reorder interpreter struct to remove alignment hole created by 9a87bd09eea1d037Nicholas Clark2010-09-081-5/+1
| | | | | | | nice_chunk_size was U32, and had been paired with another 32 bit value to ensure that all 64 bit quantities were naturally 64 bit aligned. There already was a 32 bit "hole" elsewhere - reorder the two unpaired 32 bit values next to each other.
* Remove offer_nice_chunk(), PL_nice_chunk and PL_nice_chunk_size.Nicholas Clark2010-09-081-2/+1
| | | | | | | | | | | | | | | | | | These provided a non-public API for the hash and array code to donate free memory direct to the SV head allocation routines, instead of returning it to the malloc system with free(). I assume that on some older mallocs this could offer significant benefits. However, my benchmarking on a modern malloc couldn't detect any significant effect (positive or negative) on removing the code. Its (continued) presence, however, has downsides a: slightly more code complexity b: slightly larger interpreter structure c: in the steady state, if net creation of SVs is zero, 1 chunk of allocated but unused memory will exist (per thread) So I think it best to remove it.
* make recursive part of peephole optimiser hookableZefram2010-08-261-1/+3
| | | | | | | | New variable PL_rpeepp makes it possible for extensions to hook the per-op-chain part of the peephole optimiser (which recurses into side chains). The existing variable PL_peepp still allows hooking the per-sub part of the peephole optimiser, maintaining perfect backward compatibility.
* Check API compatibility when loading xs modulesFlorian Ragwitz2010-07-261-0/+1
| | | | | | | | | | | | | This adds PL_apiversion, allowing the API version of a running interpreter to be introspected. It is used in the new XS_APIVERSION_BOOTCHECK macro, which is added to the _boot function of every XS module, to compare it against the API version the module has been compiled against. If the versions do not match, an exception is thrown. This doesn't fully prevent binary incompatible extensions to be loaded. It merely compares PERL_API_* between compile- and runtime, and does not attempt to solve the problem of identifying binary incompatible perls with the same API version (i.e. the same perl version configured with and without DEBUGGING).
* Generic hooks into Perl_block_{start,end}.Ben Morrow2010-07-121-0/+3
| | | | | | | | | | These take the form of a vtable pushed onto the new PL_blockhooks array. This could probably do with a API around it later. Separate pre_end and post_end hooks are needed to capture globals before the stack is unwound (like needblockscope in the existing code). The intention is that once a vtable is installed it never gets removed, so where necessary extensions using this will need to use a hinthv element to determine whether to do anything or not.
* identify a few vars in intrpvar.hDavid Mitchell2010-06-071-12/+12
|
* add PL_signalhook to hook into signal dispatchDavid Mitchell2010-06-041-0/+2
| | | | | This is initially intended for threads::shared and shouldn't (yet) be considered part of the public API.
* PL_in_load_module only has values 0 and 1, so can be a bool instead of int.Nicholas Clark2010-05-211-2/+2
|
* unwinding target nominated by separate globalZefram2010-04-251-0/+1
| | | | | | | | When unwinding due to die, the new global PL_restartjmpenv points to the JMP_ENV at which longjmping should stop and control should be transferred to PL_restartop. This replaces the previous use of cxstack[cxstack_ix+1].blk_eval.cur_top_env, located in a nominally-discarded context frame.
* qr/\X/ expansionKarl Williamson2009-12-051-0/+10
|
* PL_scopestack_name needs to be present, -DDEBUGGING or not.Nicholas Clark2009-11-181-3/+3
| | | | | | -DDEBUGGING and not need to be binary compatible with each other. Fixes the test failures in ext/re caused by d343c3ef45381352 for threaded builds without -DDEBUGGING.
* Add ENTER_with_name and LEAVE_with_name to automaticly check for matching ↵Gerard Goossen2009-11-121-0/+3
| | | | ENTER/LEAVE when debugging is enabled
* somewhat fix failing regex tests. but break lots of other stuff at the same timeYves Orton2009-10-191-0/+3
|
* Remove obsolete interpreter variable PL_utf8_alnumcRafael Garcia-Suarez2009-09-131-1/+0
|
* Document PL_opfreehookVincent Pit2009-07-151-0/+12
|
* The op_free() hook doesn't need to return an OP*, so introduce a new typedef ↵Vincent Pit2009-07-151-1/+1
| | | | for OP hooks
* Add a pluggable hook in op_free()Vincent Pit2009-07-081-0/+2
|
* Use only one block of memory for both PL_psig_name and PL_psig_ptr.Nicholas Clark2009-05-211-1/+2
|
* Remove binary compatibility scaffolding for the change to PL_bitcount.Nicholas Clark2009-05-201-10/+0
|
* Replace run-time on-demand initialisation of PL_bitcount with a constant table.Nicholas Clark2009-05-201-0/+8
| | | | | | | | | | | | | | | | (The table is 256 bytes; the run-time initialisation code is larger than this!) Adapt generate_uudmap.c to generate the initalisation block for PL_bitcount, writing the code to bitcount.h, using the same approach as uudmap.h. To preserve binary compatibility: for MULTIPLICITY: keep Ibitcount in the interpreter structure, but remove all the macros that access it. PL_bitcount is a new symbol in the object file, which won't clash with anything as that name wasn't used before. otherwise: keep PL_bitcount as a char *, but initialise it at compile time to a new constant array PL_bitcount array. Remove the code that attempts to Safefree() it at interpreter destruction time.
* Document the purpose of PL_psig_ptr and PL_psig_name.Nicholas Clark2009-05-191-1/+5
|
* Add Perl_mro_register() to register Method Resolution Orders,Nicholas Clark2008-12-271-0/+6
| | | | | | Perl_mro_get_from_name() to retrieve MROs by name, and PL_registered_mros to store them in. Abolish the static array of mros, and instead register the dfs and c3 MRO structures.
* The vestigial PL_pad_reset_pending can actually be bool, rather thanNicholas Clark2008-11-261-5/+4
| | | | | | I32. This permits some space saving rejigging of the interpreter struct. p4raw-id: //depot/perl@34930
* Note where there is a U8 of space.Nicholas Clark2008-11-181-0/+2
| | | p4raw-id: //depot/perl@34887