summaryrefslogtreecommitdiff
path: root/proto.h
Commit message (Collapse)AuthorAgeFilesLines
* Add op_wrap_finally() convenience functionPaul "LeoNerd" Evans2022-01-201-0/+5
|
* Add a builtin:: namespace, with true/false/isboolPaul "LeoNerd" Evans2021-11-291-0/+2
| | | | | | | | This finishes the perl-visible API required for RFC 0008 https://github.com/Perl/RFCs/blob/master/rfcs/rfc0008.md It also begins the "builtin::" namespace of RFC 0009 https://github.com/Perl/RFCs/blob/master/rfcs/rfc0009.md
* Add a phase_name() macro.Felipe Gasper2021-11-251-0/+2
|
* Add CopFILEAVn() and use it when cleaning up COP pointersTony Cook2021-11-151-0/+5
| | | | | | | | | | | | | | On threaded builds CopFILEAV() calls gv_fetchfile(), which always created the *{"::_<filenamehere"} glob, so the attempted clean up here could recreate the glob, even if it has already been removed when cleaning up a string eval. To avoid this, add CopFILEAVn() that never creates the glob, nor the AV so that the clean up never adds new objects. This change makes the check for PL_phase unnecessary, but that check is much cheaper than the call for gv_fetchfile_flags() that the macro hides, so retain the check.
* sv.c: add Perl_sv_grow_fresh & Perl_sv_setvpn_freshRichard Leach2021-11-011-0/+6
|
* Split the XPVHV body into two variants "normal" and "with aux"Nicholas Clark2021-10-111-0/+3
| | | | | | | | Default to the smaller body, and switch to the larger body if we need to allocate a C<struct xpvhv_aux> (eg need an iterator). This restores the previous small size optimisation for hashes used as objects.
* Inline S_hv_auxinit_internal() into S_hv_auxinit()Nicholas Clark2021-10-111-3/+0
| | | | The previous commit eliminated the only other use of S_hv_auxinit_internal().
* Don't leak in hv_common when croaking about PL_strtabNicholas Clark2021-09-231-4/+8
| | | | | | | | | | | | | | | | hv_common can perform read-only actions on PL_strtab, but not write actions. The code that detects this and croaks had been just after the allocation of a new HE *, and hence was leaking it. Re-order the code to avoid the leak. The leak usually wasn't noticeable as HEs are allocated from arenas, and arenas are correctly freed during full destruction. However, building with -DPURIFY replaces arenas with individual allocations, making this leak visible. It's unlikely to have been hit by any production code, but it was causing leaks during the regression tests. Also change embed.fnc so that S_new_HE's prototype is not declared under -DPURIFY, as the static function itself is not defined in this case. This fixes a compiler warning.
* Add _mg() versions of the sv_setrv* familyPaul "LeoNerd" Evans2021-08-251-0/+6
|
* Add sv_setrv_inc()Paul "LeoNerd" Evans2021-08-251-0/+3
|
* Add sv_setrv_noinc()Paul "LeoNerd" Evans2021-08-251-0/+3
|
* Create `defer` syntax and `OP_PUSHDEFER` opcodePaul "LeoNerd" Evans2021-08-251-0/+5
| | | | | | | | | | | | | | | Adds syntax `defer { BLOCK }` to create a deferred block; code that is deferred until the scope exits. This syntax is guarded by use feature 'defer'; Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field gives the start of an optree to be deferred until scope exit. That op pointer will be stored on the save stack and invoked as part of scope unwind. Included is support for `B::Deparse` to deparse the optree back into syntax.
* utf8.c: Make new static fcn more flexibleKarl Williamson2021-08-231-1/+1
| | | | | This commit allows this function to be called with NULL parameters when the result of these is not needed.
* utf8.c: Split a static fcnKarl Williamson2021-08-231-0/+3
| | | | | | | | | This adds a new function for changing the case of an input code point. The difference between this and the existing function is that the new one returns an array of UVs instead of a combination of the first code point and UTF-8 of the whole thing, a somewhat awkward API that made more sense when we used swashes. That function is retained for now, at least, but most of the work is done in the new function.
* Delete Perl_ptr_table_clear, marked as deprecated since v5.14.0Nicholas Clark2021-08-211-4/+0
|
* Add utf8_to_utf16Karl Williamson2021-08-141-0/+3
|
* Improve utf16_to_utf8_reversed()Karl Williamson2021-08-141-0/+3
| | | | | | Instead of destroying the input by first swapping the bytes, this calls a base function with the order to use. The non-reverse function is changed to call the base function with the non-reversed order.
* utf8.c: Refactor is_utf8_char_helper()Karl Williamson2021-08-141-2/+2
| | | | | | | | | Now that the DFA is used by the only callers to this to eliminate the need to check for e.g., wrong continuation bytes, this function can be refactored to use a switch statement, which makes it clearer, shorter, and faster. The name is changed to indicate its private nature
* Make macro isUTF8_CHAR_flags an inline fcnKarl Williamson2021-08-141-0/+7
| | | | This makes it use the fast DFA for this functionality.
* is_utf8_valid_partial_char_flags: Use DFAKarl Williamson2021-08-141-3/+3
| | | | | | | | The DFA macro for determining if a sequence is valid UTF-8 was deliberately made general enough to accommodate this use-case, in which only a partial character is acceptable. Change the code to use the DFA. The helper function's name is changed to indicate it is private
* utf8.c: Rename formal param to static fcnKarl Williamson2021-08-071-1/+1
| | | | The new mname is more mnemonic
* uvoffuni_to_utf8_flags_msgs: Avoid extra conditionalsKarl Williamson2021-08-071-1/+1
| | | | | | | The previous commit for EBCDIC paved the way for moving some checks for a code point being for Perl extended UTF-8 out of places where they cannot succeed. The resultant simplifications more than compensate for the two extra case statements added by this commit.
* utf8.c: Change formal parameter name to fcnKarl Williamson2021-08-071-1/+1
| | | | This will make more sense of the next commit
* Add helper function for longest UTF8 sequenceKarl Williamson2021-08-071-0/+6
| | | | | | | | | This specialized functionality is used to check the validity of Perl's extended-length UTF-8, which has some ideosyncratic characteristics from the shorter sequences. This means this function doesn't have to consider those differences. It will be used in the next commit to avoid some work, and to eventually enable is_utf8_char_helper() to be simplified.
* utf8.c: Fold 2 overlapping fcns into oneKarl Williamson2021-08-071-9/+0
| | | | | | | | One of these functions is now only called from the other, and there is significant overlap in their logic. This commit refactors them into one resulting function, which is half the code, and more straight forward.
* utf8.c: Generalize static fcnKarl Williamson2021-08-071-2/+2
| | | | | | | | | I've always been uncomfortable with the input constraints this function had. Now that it has been refactored into using a switch(), new cases for full generality can be added without affecting performance, and some conditionals removed before calling it. The function is renamed to reflect its more generality
* utf8.c: Change name of static functionKarl Williamson2021-08-071-1/+1
| | | | | This changes only portions of the capitalization, and the new version is more in keeping with other function names.
* Create and use 32 and 64 bit msbit_pos() fcnsKarl Williamson2021-07-301-0/+12
| | | | | | | | | | | | | The existing code to determine the position of the most significant 1 bit in a word is extracted from variant_byte_number(), and generalized to use the deBruijn method previously added that works on any bit in the word, rather than the existing method which looks just at the msb of each byte. The code is moved to a new function in preparation for being called from other places. A U32 version is created, and on 64 bit platforms, a second, parallel, version taking a U64 argument is also created. This is because future commits may care about the word size differences.
* Create and use 32 and 64 bit lsbit_pos() fcnsKarl Williamson2021-07-301-0/+12
| | | | | | | | | | The existing code to determine the position of the least significant 1 bit in a word is extracted from variant_byte_number() and moved to a new function in preparation for being called from other places. A U32 version is created, and on 64 bit platforms, a second, parallel, version taking a U64 argument is also created. This is because future commits may care about the word size differences.
* Add 64bit single-1bit_pos()Karl Williamson2021-07-301-0/+8
| | | | | | | | | | | | | This will prove useful in future commits on platforms that have 64 bit capability. The deBruijn sequence used here, taken from the internet, differs from the 32 bit one in how they treat a word with no set bits. But this is considered undefined behavior, so that difference is immaterial. Apparently figuring this out uses brute force methods, and so I decided to live with this difference, rather than to expend the time needed to bring them into sync.
* Create and use single_1bit_pos32()Karl Williamson2021-07-301-0/+6
| | | | | | This moves the code from regcomp.c to inline.h that calculates the position of the lone set bit in a U32. This is in preparation for use by other call sites.
* Add inline av_fetch_simple and av_store_simple functionsRichard Leach2021-07-031-0/+12
|
* Rename scalarseq() to a somewhat more meaningful voidnonfinal()Paul "LeoNerd" Evans2021-06-161-2/+2
|
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-84/+84
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* Call magic on all elements on %SIG delocalizationLeon Timmermans2021-06-021-0/+3
|
* regcomp.c: Extract code from a too-large-functionKarl Williamson2021-05-311-0/+3
| | | | | S_regclass() is unwieldy. This commit splits it into two nearly equal size parts. More could be done.
* Add Perl_av_new_alloc() function and newAV_alloc_x/z() macrosRichard Leach2021-05-261-0/+12
|
* Do not cache utf8 offsets for non-canonical lengthsLeon Timmermans2021-05-241-2/+2
| | | | In particular, if the length is beyond the end, it should not be stored as the end.
* try isn't treated as a sub call like eval isTony Cook2021-02-141-0/+5
| | | | | | | | | | | | | The try change added code to pp_return to skip past try contexts when looking for the sub/sort/eval context to return from. This was only needed because cx_pusheval() sets si_cxsubix to the current frame and try uses that function to push it's context, that value is then used by the dopopto_cursub() macro to shortcut walking the context stack. Since we don't need to treat try as a sub for return, list vs array checks or lvalue sub checks, don't set si_cxsubix on try.
* A totally new optree structure for try/catch involving three new optypesPaul "LeoNerd" Evans2021-02-141-0/+5
|
* Add a newTRYCATCHOP(); migrate the custom code out of perly.y into itPaul "LeoNerd" Evans2021-02-141-0/+5
|
* regexec.c: Make internal function staticKarl Williamson2021-02-101-6/+4
| | | | | This used to be called from utf8.c, but no longer; no need to make it other than static. This allows the compiler to better optimize.
* Allow blanks within and adjacent to {...} constructsKarl Williamson2021-01-201-1/+1
| | | | | This was the consensus in http://nntp.perl.org/group/perl.perl5.porters/258489
* Allow empty lower bound in /{,n}/Karl Williamson2021-01-201-5/+0
| | | | | | | | This change has been planned for a long time, bringing Perl into parity with similar languages, but it took many deprecation cycles to be able to reach the point where it could safely go in. This fixes GH #18264
* Revamp regcurly(), regpiece() use of itKarl Williamson2021-01-201-2/+5
| | | | | | | | | | | | | | | | | | | | This commit copies portions of new_regcurly(), which has been around since 5.28, into plain regcurly(), as a baby step in preparation for converting entirely to the new one. These functions are used for parsing {m,n} quantifiers. Future commits will add capabilities not available using the old version. The commit adds an optional parameter, to return to the caller information it gleans during parsing. regpiece() is changed by this commit to use this information, instead of itself reparsing the input. Part of the reason for this commit is that changes are planned soon to what is legal syntax. With this commit in place, those changes only have to be done once. This commit also extracts into a function the calculation of the quantifier bounds. This allows the logic for that to be done in one place instead of two.
* add a bareword_filehandles feature, which is enabled by defaultTony Cook2021-01-041-0/+3
| | | | This disables use of bareword filehandles except for the built-in handles
* Remove my_l?stat from public APIKarl Williamson2020-12-061-6/+2
| | | | | They are not documented, and if you try to use them, you get a compile error.
* Evaluate arg once in all forms of SvTRUEKarl Williamson2020-12-061-0/+18
| | | | 5.32 did this for one form; now all do.
* Document various CopFILEfoo functionsKarl Williamson2020-11-291-0/+4
|
* perlapi: Note proper rplcemnt for pad_compname_typeKarl Williamson2020-11-221-0/+1
|