summaryrefslogtreecommitdiff
path: root/embed.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove Perl_modFather Chrysostomos2011-08-021-1/+0
| | | | | | | After mod was renamed to op_lvalue, this stub was added temporarily to provide a smoother transition for the compilers. The compiler maintainer is happy with its extirpation at this stage. See ticket #78908.
* Add finalize_optree function which can take over all the compile time ↵Gerard Goossen2011-07-281-0/+2
| | | | | | | | | | | | checking/finalization now being done by the peephole optimizer. This function takes the optree after it is finished building. It takes over some of the checking and final conversions which are currently being done by the peephole optimizer. Add the moment this is an unnecessary extra step after the peephole optimizer, but with a separate code generation step, the current peephole optimizer can't exists and this function will take over all its essential compile time functions.
* Add core_prototype; make pp_prototype use itFather Chrysostomos2011-07-261-0/+1
| | | | | | | | | | | | | | | | This commit moves the code for generating core prototypes into a sepa- rate function, core_prototype, in op.c. This serves two porpoises: • It allows the lock and tie exceptional cases to be incorporated into the main prototype=generation code, which requires the use of a static function in op.c. • It allows other parts of the core (e.g., the upcoming \&CORE::foo feature) to use the same code. The docs for it are in a section boringly entitled ‘Functions in op.c’, for lack of a better name. This, I believe, is the only op.c function that is in perlintern currently, so it’s hard to see what to name a section that will, at least for now, contain nothing else.
* Perl_my_p{open,close} do not exist under PERL_IMPLICIT_SYS.Nicholas Clark2011-07-241-2/+4
| | | | | PERL_IMPLICIT_SYS only builds on Win32. Correct embed.fnc to reflect the reality.
* Change was_lvalue_sub back to X; spell out the only use of itFather Chrysostomos2011-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | OK, now I understand what’s happening. If there is a public macro (PUSHSUB) that contains a call to a pri- vate function (was_lvalue_sub), that function has to be exported, so that non-core code can call it. But if it is marked X, there is no was_lvalue_sub shorthand macro visible to non-core code, so when the PUSHSUB macro is expanded in such code, the was_lvalue_sub(...) bit becomes a call to the function literally named was_lvalue_sub, as opposed to Perl_lvalue_sub (and is compiled that way on forgiving platforms). Making it A makes that macro available to non-core code, but also implies that it is available for direct use by extensions, which is not the case with was_lvalue_sub. So, this commit makes it X again, but spells it out in PUSHSUB, so there is no need for the function’s macro to be available when PUSHSUB is expanded. Hence, there is no need for the was_lvalue_sub macro to exist, so this commit also removes it. See also these three commits: c73b0699db 7b70e81778 777d901444
* Added a flags parameter to pad_findlex.Brian Fraser2011-07-121-1/+1
|
* APIify pad functionsZefram2011-07-121-11/+15
| | | | | | | Move several pad functions into the core API. Document the pad functions more consistently for perlapi. Fix the interface issues around delimitation of lexical variable names, providing _pvn, _pvs, _pv, and _sv forms of pad_add_name and pad_findmy.
* A not X for was_lvalue_sub in embed.fnc.Craig A. Berry2011-07-111-1/+1
| | | | | | 7b70e8177801df4e142684870ce037d584f72e7b was my (wrong) suggestion, and it made the symbol only visible when PERL_CORE was defined, which it isn't in List::Util.
* Propagate (non-)lvalue context through nested callsFather Chrysostomos2011-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, this code would fail: $foo = "foo"; sub foo :lvalue{ return index "foo","o" } sub bar :lvalue { foo } $x = bar; (It would fail for ‘return $]’ as well. Whether it’s a PADTMP or a read-only scalar makes no difference.) foo would think it was being called in true lvalue context, because the entersub op that called it (in bar) was marked that way, bar being an lvalue sub as well. The PUSHSUB macro in cop.h needed to be modified to account for dynamic, or indetermine, context (i.e., indeterminable at compile time). This happens when an entersub op is an argument to return or the last statement in a subroutine. In those cases it has to propa- gate the context from the caller. So what we now do is this: Both lvalue and in-args flags are turned on for an entersub op when op_lvalue is called with OP_LEAVESUBLV as the type. Then PUSHSUB copies into the context stack only those flags that are set both on the current entersub op and in the context stack for the previous sub call.
* Restrict some inversion list functionsKarl Williamson2011-07-031-4/+4
| | | | | These functions are internal only with names beginning with underscore. I hadn't realized that their definitions could be restricted.
* Allow utf8.c to access 4 inversion list functionsKarl Williamson2011-07-031-4/+6
|
* Change 4 inversion list functions from S_ to Perl_Karl Williamson2011-07-031-4/+4
| | | | | This is in preparation for them to be called from another file. Note that they are still protected by an #ifdef in embed.fnc.
* Change names of some inversion list functionsKarl Williamson2011-07-031-4/+4
| | | | | | The names now begin with an underscore to emphasize that they are for internal use only. This is in preparation for making them accessible beyond regcomp.c.
* Add 3 methods for inversion listsKarl Williamson2011-07-031-0/+3
| | | | This adds inversion, cloning, and set subtraction
* Add an element to inversion list data structureKarl Williamson2011-07-031-0/+2
| | | | | This element is restricted to either 0 or 1. The comments detail how its use enables an inversion list to be efficiently inverted.
* Add length element to inversion listsKarl Williamson2011-07-031-0/+1
| | | | | Future changes will make the length no longer the same as SvCUR, so create an element to hold the correct length
* Add iterator for inversion listsKarl Williamson2011-07-031-0/+3
|
* regcomp.c: Rmv no longer called functionKarl Williamson2011-07-031-1/+0
| | | | | | | | | | | | | | This hasn't been used since 626725768b7b17463e9ec7b92e2da37105036252 Author: Nicholas Clark <nick@ccl4.org> Date: Thu May 26 22:29:40 2011 -0600 regcomp.c: Fix memory leak regression here was a remaining memory leak in the new inversion lists data structure under threading. This solves it by changing the implementation to use a SVpPV instead of doing our own memory management. Then the already existing code for handling SVs returns the memory when done.
* regcomp.c: Remove no longer called functionKarl Williamson2011-07-031-1/+0
| | | | | | The invlist_destroy function was misleading, as it has changed to just decrement the reference count, which may or may not lead to immediate destruction
* regcomp.c: Revise inversion list APIKarl Williamson2011-07-031-2/+2
| | | | | | | These are static functions so no external effect. Revise the calling sequence of two functions so that they can know enough to free memory if appropriate of the other parameters. This hides from the callers the need for tracking when to free memory.
* Factor stack adjustments on leave in a new static functionVincent Pit2011-06-261-0/+1
| | | | This is just a refactoring. There should be no functional changes.
* add do_ncmp fn and make pp_ncmp, pp_eq etc use itDavid Mitchell2011-06-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | Extract most of the body of pp_ncmp() (numeric compare) into a separate function, do_ncmp(), then make the following ops use it: pp_ncmp pp_lt pp_le pp_eq pp_ne pp_ge pp_gt This removes a lot of similar or duplicated code, most of which is dedicated to handling the various combinations of IV verses UV verses NV verses NaN. The various ops first check for, and directly process, the simple and common case of both args being SvIOK_notUV(), and pass the processing on to do_ncmp() otherwise. Benchmarking seems to indicate (but with a lot of noise) that the SvIOK_notUV case is slightly faster than before, and the do_ncmp() branch slightly slower.
* op_lvalue .= _flagsFather Chrysostomos2011-06-241-1/+0
| | | | | | | | | | Add flags param to op_lvalue, so that the caller can ask it not to croak when encountering an unmodifiable op (upcoming). This is in preparation for making the \$ prototype accept any lvalue. There is no mathom, as the changes that this will support are by no means suitable for maint.
* regcomp.c: Fix memory leak regressionNicholas Clark2011-05-261-1/+0
| | | | | | | | There was a remaining memory leak in the new inversion lists data structure under threading. This solves it by changing the implementation to use a SVpPV instead of doing our own memory management. Then the already existing code for handling SVs returns the memory when done.
* add hfree_next_entry(), hv_free_ent_ret()David Mitchell2011-05-191-0/+1
| | | | | | | | | | | | | Move body of hfreeentries()' central loop into a new function, hfree_next_entry(); leaving hfreeentries() as a simple loop that calls hfree_next_entry() until there are no entries left. This will in future allow sv_clear() to free a hash iteratively rather than recursively. Similarly, turn hv_free_ent() into a thin wrapper around a new function, hv_free_ent_ret(), which doesn't free HeVAL(), but rather just returns the SV instead.
* utf8.c: Add _flags version of to_utf8_fold()Karl Williamson2011-05-031-2/+2
| | | | | | | | | | And also to_uni_fold(). The flag allows retrieving either simple or full folds. The interface is subject to change, so these are marked experimental and their names begin with underscore. The old versions are turned into macros calling the new versions with the correct extra parameter.
* Make push/shift $scalar accept only unblessed aryrefsFather Chrysostomos2011-04-181-1/+0
| | | | See ticket #80626.
* Add depth parameter to reg_namedseqKarl Williamson2011-03-201-1/+1
|
* regcomp.c: Merge identical functionsKarl Williamson2011-03-081-1/+0
| | | | | These two functions now have identical code, so merge them, but use a macro in case they ever need to diverge again.
* Avoid miniperl SEGVing when processing -I on the #! lineNicholas Clark2011-03-051-1/+5
| | | | | | | | | | | | | | | | | | A side-effect of change 3185893b8dec1062 was to force av in S_incpush() to be NULL, whilst other flag variables were still set as if it were non-NULL, for certain cases, only when compiled with -DPERL_IS_MINIPERL The "obvious" fix is to also set all the flag variables to 0 under -DPERL_IS_MINIPERL, to make everything consistent. However, this confuses (at least) the local version of gcc, which issues warnings about passing a NULL value (av, known always to be NULL) as a not-NULL parameter, despite the fact that all the relevant calls are inside blocks which are actually dead code, due to the if() conditions being const variables set to 0 under -DPERL_IS_MINIPERL. So to avoid future bug reports about compiler warnings, the least worst thing to do seems to be to use #ifndef to use the pre-processor to eliminate the dead code, and related variables.
* regcomp.c: Add parameters to fcnsKarl Williamson2011-02-271-2/+2
| | | | | | A pointer to the list of multi-char folds in an ANYOF node is now passed to the routines that set the bit map. This is in preparation for those routines to add to the list
* regcomp.c: Add fcn add_cp_to_invlist()Karl Williamson2011-02-271-0/+1
| | | | | This is just an inline shorthand when a single code point is all that is needed. A macro could have been used instead, but this just seemed nicer.
* regcomp.c: Factor code into a function.Karl Williamson2011-02-271-0/+1
| | | | A future commit uses this same code, so put it into a common place.
* 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.
* foldEQ_utf8: Add version with flags parameterKarl Williamson2011-02-141-1/+1
| | | | | The parameter doesn't do anything yet. The old version becomes a macro calling the new version with 0 as the flags.
* regcomp.c: Put two static functions in embed.fncKarl Williamson2011-02-141-0/+2
|
* Fix up \cX for 5.14Karl Williamson2011-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Throughout 5.13 there was temporary code to deprecate and forbid certain values of X following a \c in qq strings. This patch fixes this to the final 5.14 semantics. These are: 1) a utf8 non-ASCII character will croak. This is the same behavior as pre-5.13, but it gives a correct error message, rather than the malformed utf8 message previously. 2) \c{ and \cX where X is above ASCII will generate a deprecated message. The intent is to remove these capabilities in 5.16. The original agreement was to croak on above ASCII, but that does violate our stability policy, so I'm deprecating it instead. 3) A non-deprecated warning is generated for all other \cX; this is the same as throughout the 5.13 series. I did not have the tuits to use \c{} as I had planned in 5.14, but \N{} can be used instead.
* Move grok_bslash_c to dquote.c and make staticKarl Williamson2011-02-091-1/+1
| | | | No other changes were made
* Move grok_blsash_o and make staticKarl Williamson2011-02-091-1/+1
| | | | | | This function is only used in the same places as dquote_static.c is used, so move it there, and we won't have to worry about changing its API will break something. No other changes made
* Add initial inversion list objectKarl Williamson2011-02-021-0/+15
| | | | | | | | | | | | | | | Going forward the intent is to convert from swashes to the better-suited inversion list data structure. This adds rudimentary inversion lists that have only the functionality needed for 5.14. As a result, they are as much as possible static to one file. What's necessary for 5.14 is enough to allow folding of ANYOF nodes to be moved from regexec to regcomp. Why they are needed for that is to generate as compact as possible class definitions; otherwise, very long linear lists might be generated. (They still may be, but that's inherent in the problem domain; this generates as compact as possible, combining overlapping ranges, etc.) The only two non-trivial methods in this object are from published algorithms.
* embed.fnc: Add E flag to regcurly entryKarl Williamson2011-01-291-3/+3
| | | | On C++ builds, it wasn't getting seen in extensions.
* Use embed.pl inline capabilities for regcurlyKarl Williamson2011-01-291-0/+3
| | | | Change the regcurly definition to use the new inline abilities.
* Break out the generated function Perl_keywords() into keywords.c, a new file.Nicholas Clark2011-01-241-1/+0
| | | | | | | | As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is no longer static, and the two macro definitions move from toke.c to perl.h Previously, one had to cut and paste the output of perl_keywords.pl into the middle of toke.c, and it was not clear that it was generated code.
* Move all the generated file header printing into read_only_top()Nicholas Clark2011-01-231-4/+4
| | | | | | | | | Previously all the scripts in regen/ had code to generate header comments (buffer-read-only, "do not edit this file", and optionally regeneration script, regeneration data, copyright years and filename). This change results in some minor reformatting of header blocks, and standardises the copyright line as "Larry Wall and others".
* Add check_utf8_print()Karl Williamson2011-01-091-0/+1
| | | | | | | This new function looks for problematic code points on output, and warns if any are found, returning FALSE as well. What it warns about may change, so is marked as experimental.
* regen/opcode.pl should only generate prototypes for pp_* functions that exist.Nicholas Clark2011-01-091-1/+0
| | | | | | | It now generates prototypes for all functions that implement OPs. Hence Perl_unimplemented_op no longer needs a special-case prototype. As it is now generating a prototype for Perl_do_kv, no need for regen/embed.pl to duplicate this. Convert the last two users of the macro do_kv() to Perl_do_kv(aTHX).
* Generate pp_* prototypes in pp_proto.h, and remove pp.symNicholas Clark2011-01-091-366/+1
| | | | | | | | | | | Eliminate the #define pp_foo Perl_pp_foo(pTHX) macros, and update the 13 locations that relied on them. regen/opcode.pl now generates prototypes for the PP functions directly, into pp_proto.h. It no longer writes pp.sym, and regen/embed.pl no longer reads this, removing the only ordering dependency in the regen scripts. opcode.pl is now responsible for prototypes for pp_* functions. (embed.pl remains responsible for ck_* functions, reading from regen/opcodes)
* Rename tied_handle_method() to tied_method(), and make it non-static.Nicholas Clark2011-01-051-0/+3
| | | | It can be used for (at least) the call to "SPLICE" from pp_splice.
* [perl #36347] Object destruction incompleteFather Chrysostomos2011-01-021-0/+1
| | | | | | | | | | | | | | | | | | | do_clean_objs only looks for objects referenced by RVs, so blessed array references and lexical variables (and probably other SVs, too) are not DESTROYed. This commit adds a new visit() call to sv_clean_objs, which curses (DESTROYs and un-blesses, leaving the reference count as it is) any objects that are still left after do_clean_named_io_objs. The new do_curse routine (a pointer to which is passeds to visit()) follows do_clean_named_io_objs’ example and explicitly skips the STDOUT and STDERR handles, in case destructors need to use them. The cursing code, which is now called from two places, is moved out of sv_clear and put in its own routine. The check that the reference count is zero does not apply when called from sv_clean_objs, so the new S_curse routine takes a boolean argument that determines whether that check should take place.
* Argument op to report_evil_fh() is always PL_op->op_type, so need not be passedNicholas Clark2010-12-281-1/+1
|