summaryrefslogtreecommitdiff
path: root/embed.fnc
Commit message (Collapse)AuthorAgeFilesLines
* regcomp.c: Fix memory leak regressionNicholas Clark2011-06-021-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.
* Store the compiled format in mg_ptr instead of after SvCUR() - fixes RT #89218Nicholas Clark2011-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Formats are compiled down to a sequence of U32 opcodes in doparseform(). Previously the block of opcodes was stored in the buffer of SvPVX() after the raw string by extending the buffer, and calculating the first U32 aligned address after SvCUR(). A flag bit on the scalar was set to signal this hackery, tested with SvCOMPILED() The flag bit used happened to be the same as one of the two used by to signal Boyer-Moore compiled scalars. The assumption was that no scalar can be used for both. Unfortunately, this isn't quite true. Given that the scalar is alway upgraded to PVMG to add PERL_MAGIC_fm magic, to clear the cached compiled version, there's no extra memory cost in using mg_ptr in the MAGIC struct to point directly to the block of U32 opcodes. The test for "is there a compiled version" can switch to mg_find(..., PERL_MAGIC_fm) returning a pointer, and the use of a flag bit abolished. Retain SvCOMPILED() and SvCOMPILED_{on,off}() as compatibility for XS code on CPAN - the first is always 0, the other two now no-ops.
* S_doparseform() should return void, not OP*, as it should use Perl_die not DIENicholas Clark2011-05-301-1/+1
| | | | | | | | | | | a1b950687051c32e added an error condition in S_doparseform() but used DIE(...) to report it. DIE is defined as C<return Perl_die>, which acts as a hint to the compiler about the control flow [as Perl_die() never returns], but also forces the return type to be OP *. Whilst this is appropriate for pp functions, it's not for S_doparseform() - a1b950687051c32e had to change the return type to OP* and return NULL, just to appease DIE(). Hence use Perl_die() instead, remove return statements, and remove the didn't-return-NULL (dead) code from pp_formline.
* utf8.c: Add _flags version of to_utf8_fold()Karl Williamson2011-05-031-2/+4
| | | | | | | | | | 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.
* embed.fnc: Allow NULL arg to to_utf8_case()Karl Williamson2011-05-031-1/+1
| | | | | | | Code within the function doesn't assume that the parameter is non-null, and in fact the specials are retrieved by swash_init(). Having the parameter null just means that no specials will be retrieved in the current call.
* Add depth parameter to reg_namedseqKarl Williamson2011-03-201-1/+1
|
* regcomp.c: Avoid locale in optimizer unless necessaryKarl Williamson2011-03-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | This is further work along the lines in RT #85964 and commit af302e7fa58415c2d8454c8cbef7bccd8b504257. It reverts, for the the most part, commits aa19b56b2f07e9eabf57540f00d312d8093e9d28 (Remove unused parameter) and c613755a4b4fc8e64a77639d47d7e208fee68edc (/l in synthetic start class). Those commits caused the synthetic start class to often be marked as matching under locale rules, even if there was no part of the regular expression that used locale. This led to RT #85964, which made apparent that there were a number of assumptions in the optimizer about locale that were no longer necessarily true. This new commit changes things so that locale has to be somewhere in the regex in order to get the synthetic start class to include /l. In other words, this reverts the effect of those commits to regular expression which have /l -- we go back to the old way of doing things for non-locale regexes. This limits any bugs that may have been introduced by the addition of /l (and being able to match only sub-parts of a regex under locale) to the relatively uncommon regexes which actually use it. There are a number of bugs that have surfaced for the locale rules regexes that have gone unreported; and some say locale rules regexes should be deprecated.
* Revert "regcomp.c: Rmv unused parameter"Karl Williamson2011-03-171-1/+2
| | | | | This reverts commit c45df5a16bb5a26a06275cc63f2c3e6b1d708184. The parameter is about to be put back in.
* regcomp.c: Rmv unused parameterKarl Williamson2011-03-081-2/+1
| | | | This silences a compiler warning
* regcomp.c: Rmv unused parameterKarl Williamson2011-03-081-2/+1
| | | | This silences a compiler warning
* regcomp.c: Rmv unused parameterKarl Williamson2011-03-081-2/+1
| | | | This silences a compiler warning
* regcomp.c: Merge identical functionsKarl Williamson2011-03-081-2/+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-0/+2
| | | | | | | | | | | | | | | | | | 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.
* regcomp.c: accept NULL as inversion list paramKarl Williamson2011-02-271-1/+1
| | | | | | | Change the function add_range_to_invlist() to accept NULL as the inversion list, in which case it creates it. A common usage of this function is to create the list if it doesn't exist before calling it, so this just makes that code once.
* 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.
* exporting a static function doesnt workKarl Williamson2011-02-141-2/+2
|
* foldEQ_utf8: Add version with flags parameterKarl Williamson2011-02-141-1/+4
| | | | | 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/+4
|
* exporting a static function doesn't workTony Cook2011-02-101-2/+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/+3
| | | | | | 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
* regcomp: Add/subtract consts to match embed.fncKarl Williamson2011-02-061-1/+1
|
* Two more swash inversion list exports necessary for build on Win32.George Greer2011-02-051-2/+2
|
* export the functions required by reTony Cook2011-02-051-2/+2
| | | | eg. see http://www.nntp.perl.org/group/perl.daily-build.reports/2011/02/msg91288.html
* _swash_inversion_hash Rmv X from embed, add constKarl Williamson2011-02-021-1/+1
| | | | This shouldn't be called from XS code.
* Add initial inversion list objectKarl Williamson2011-02-021-1/+18
| | | | | | | | | | | | | | | 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-1/+1
| | | | 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.
* embed.fnc: Add inline function capabilityKarl Williamson2011-01-291-0/+6
| | | | This patch adds to embed.pl the capability to generate static inline functions.
* Break out the generated function Perl_keywords() into keywords.c, a new file.Nicholas Clark2011-01-241-1/+3
| | | | | | | | 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.
* embed.fnc: Silence 'no docs' messageKarl Williamson2011-01-101-1/+1
| | | | I mistakenly added the 'd' flag to the entry for check_utf8_print().
* 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-2/+2
| | | | | | | 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).
* Fix typos (spelling errors) in Perl sources.Peter J. Acklam) (via RT2011-01-071-1/+1
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81904] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 > Signed-off-by: Abigail <abigail@abigail.be>
* Rename tied_handle_method() to tied_method(), and make it non-static.Nicholas Clark2011-01-051-3/+3
| | | | It can be used for (at least) the call to "SPLICE" from pp_splice.
* The mg parameter to S_tied_handle_method() can be const MG *Nicholas Clark2011-01-051-1/+1
|
* Split the flags and argc parameters to S_tied_handle_method().Nicholas Clark2011-01-051-1/+1
| | | | | Previously they were combined into one numeric value, using a bitshift. This was a false economy.
* [perl #36347] Object destruction incompleteFather Chrysostomos2011-01-021-0/+3
| | | | | | | | | | | | | | | | | | | 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
|
* The io argument to report_evil_fh() is always GvIO(gv), so need not be passed.Nicholas Clark2010-12-281-1/+1
|
* Extract the OP_phoney_* code from report_evil_fh() into report_wrongway_fh()Nicholas Clark2010-12-281-0/+2
| | | | | Previously Perl_report_evil_fh()'s body was just an if/else at the top level - a good sign that it is actually implementing two disjoint functions.
* Move do_chomp() from pp.c to doop.c, and make it static.Nicholas Clark2010-12-271-2/+1
| | | | It was never part of the public API, and only ever used by pp_{s,}cho{,m}p.
* Merge Perl_do_chop() and Perl_do_chomp().Nicholas Clark2010-12-271-2/+1
| | | | | | They share code for dealing with PVAVs, PVHVs, read only values and handling PL_encoding. They are not part of the public API, and Google codesearch shows no users outside the core.
* Convert Perl_do_chomp() to the same prototype as Perl_do_chop().Nicholas Clark2010-12-271-1/+1
| | | | Pass in an SV to hold the count, rather than returning the count.
* recursive-descent expression parsingZefram2010-12-111-0/+4
| | | | | | New API functions parse_fullexpr(), parse_listexpr(), parse_termexpr(), and parse_arithexpr(), to parse an expression at various precedence levels.
* Add mg_findextFlorian Ragwitz2010-11-301-0/+1
|