summaryrefslogtreecommitdiff
path: root/cop.h
Commit message (Collapse)AuthorAgeFilesLines
* Document various CopFILEfoo functionsKarl Williamson2020-11-291-0/+26
|
* cop.h: Extend core-only portionKarl Williamson2020-11-291-1/+3
| | | | | This encloses some #defines in a PERL_CORE section, as their only use is in the macro immediately following, already confined to core.
* Various COPHH macros have a non-const parameterKarl Williamson2020-11-201-6/+6
| | | | | The pod says these are const, but they won't compile if actually called with one.
* Document PERL_SIKarl Williamson2020-11-111-0/+6
|
* autodoc.pl: Enhance apidoc_section featureKarl Williamson2020-11-061-3/+3
| | | | | | | | | | | This feature allows documentation destined for perlapi or perlintern to be split into sections of related functions, no matter where the documentation source is. Prior to this commit the line had to contain the exact text of the title of the section. Now it can be a $variable name that autodoc.pl expands to the title. It still has to be an exact match for the variable in autodoc, but now, the expanded text can be changed in autodoc alone, without other files needing to be updated at the same time.
* Remove redundant documentationKarl Williamson2020-09-051-29/+0
| | | | | | Now that we can get automatic links in perlapi, remove the redundant stripped-down documentation that goes there in favor of the better documentation in perlcall.
* Document IN_PERL_(RUN|COMPILE)TIMEKarl Williamson2020-09-051-3/+12
|
* Reorganize perlapiKarl Williamson2020-09-041-8/+0
| | | | | This uses a new organization of sections that I came up with. I asked for comments on p5p, but there were none.
* Change some =head1 to apidoc_section linesKarl Williamson2020-09-041-2/+2
| | | | | apidoc_section is slightly favored over head1, as it is known only to autodoc, and can't be confused with real pod.
* cop.h: remove obsolete commentDavid Mitchell2020-08-281-6/+0
| | | | | The macro which the comment describes is long gone, but the comment got missed.
* cop.h: Comments, white spaceKarl Williamson2020-08-221-4/+4
|
* Create new PUSHSTACKi for regcomp.cKarl Williamson2020-03-111-0/+1
| | | | See previous commit.
* cop.h: Add commentKarl Williamson2020-03-111-0/+2
|
* Note that certain flags are documentedKarl Williamson2019-12-171-0/+2
| | | | | | | | | | | This is useful in Devel::PPPort for generating its api-info data. That useful feature of D:P allows someone to find out what was the first release of Perl to have a function, macro, or flag. And whether using ppport.h backports it further. I went through apidoc.pod and looked for flags that were documented but that D:P didn't know about. This commit adds entries for each so that D:P can find them.
* Faster feature checksTony Cook2019-10-301-0/+6
| | | | | | | | | | | | | | | Perform only a bit check instead of a much more expensive hash lookup to test features. For now I've just added a U32 to the cop structure to store the bits, if we need more we could either add more bits directly, or make it a pointer. We don't have the immediate need for a pointer that warning do since we don't dynamically add new features during compilation/runtime. The changes to %^H are retained so that caller() can be used from perl code to check the features enabled at a given caller's scope.
* Update documentation, comments, metadata to reference GitHub as canonical ↵Dan Book2019-10-201-2/+2
| | | | | | | | | | | | | | | | repository (#1186) * Update repository and bugtracker URLs to GitHub in makemeta regen META files * Update POD and comments to reference GitHub as canonical repository * Update Porting/corelist.pl to recognize GitHub issue tracker * remove "A note on camel and dromedary" * Remove redundant 'Committing your changes' section
* Mailling list archaeology, restoring old contentMax Maischein2019-10-111-9/+10
| | | | | | | | | http://xray.mpe.mpg.de does not serve the mailing list archives anymore and is not available via the Wayback machine either. This patch restores the content of a link to an URL "we" hopefully control better. The message ID is likely 20040713143217.GB1424@plum.flirble.org , to help future searches.
* Perl5 git is on httpsMax Maischein2019-10-111-4/+4
|
* Un-revert "[MERGE] add+use si_cxsubix field"David Mitchell2019-09-231-0/+5
| | | | | | | | original merge commit: v5.31.3-198-gd2cd363728 reverted by: v5.31.4-0-g20ef288c53 The commit following this commit fixes the breakage, which that means the revert can be undone.
* Revert "[MERGE] add+use PL_curstackinfo->si_cxsubix field"v5.31.4Max Maischein2019-09-201-5/+0
| | | | | | | | | | | | This reverts commit d2cd363728088adada85312725ac9d96c29659be, reversing changes made to 068b48acd4bdf9e7c69b87f4ba838bdff035053c. This change breaks installing Test::Deep: ... not ok 37 - Test 'isa eq' completed ok 38 - Test 'isa eq' no premature diagnostication ...
* add PL_curstackinfo->si_cxsubix fieldDavid Mitchell2019-09-191-0/+5
| | | | | | | | | | | | | This tracks the most recent sub/eval/format context pushed onto the context stack. Then make dopopto_cursub use it. The previous value is saved in the cxt struct, and is restored whenever the context is popped. This adds a tiny overhead for every sub call, but speeds up other operations, such as determining the caller context when returning a value from a sub - this has to be dpne for every sub call where the last expression is context sensitive, so its often a win.
* Change pod for macros that require "literal strings"Karl Williamson2019-09-021-4/+4
| | | | | Now that Devel::PPPort has the ability to handle these, we can loosen the syntax for clarity.
* Document CopLABEL[_len[_flags]]Karl Williamson2019-09-021-0/+18
|
* use hex for the call_*()/eval_sv() flag definitionsTony Cook2019-07-081-12/+12
| | | | | while I expect most C programmers have these powers of two engraved into their brains, using hex makes this more obvious
* (perl #134177) add G_RETHROW flag to eval_sv()Tony Cook2019-07-081-0/+1
| | | | and update eval_pv() to use it.
* Fix apidoc macro entriesKarl Williamson2019-06-251-7/+7
| | | | | | | | | | This makes various fixes to the text that is used to generate the documentation. The dominant change is to add the 'n' flag to indicate that the macro takes no arguments. A couple should have been marked with a D (for deprecated) flag, and a couple were missing parameters, and a couple were missing return values. These were spotted by using Devel::PPPort on them.
* Add 'n' flag to various =for apidoc linesKarl Williamson2019-05-301-4/+4
| | | | | | This indicates to not output the macro with parentheses for parameters. Currently that doesn't happen anyway, but a future commit will change things so this is required (so that a bug can be fixed)
* revert smartmatch to 5.27.6 behaviourZefram2017-12-291-8/+16
| | | | | | | | | | | | | The pumpking has determined that the CPAN breakage caused by changing smartmatch [perl #132594] is too great for the smartmatch changes to stay in for 5.28. This reverts most of the merge in commit da4e040f42421764ef069371d77c008e6b801f45. All core behaviour and documentation is reverted. The removal of use of smartmatch from a couple of tests (that aren't testing smartmatch) remains. Customisation of a couple of CPAN modules to make them portable across smartmatch types remains. A small bugfix in scope.c also remains.
* internally change "when" to "whereso"Zefram2017-12-051-5/+5
| | | | | The names of ops, context types, functions, etc., all change in accordance with the change of keyword.
* remove unused CXp_FOR_DEF and OPpITER_DEFZefram2017-11-291-2/+0
| | | | | These were used to identify foreach loops that qualify as topicalizers. That's no longer a relevant classification.
* make loop control apply to "given"Zefram2017-11-291-8/+3
| | | | A "given" construct is now officially a one-iteration loop.
* revise block_givwhen for sole use by "when"Zefram2017-11-291-5/+4
| | | | This context frame type doesn't need to cater for "given" any more.
* better document macros taking literal stringsZefram2017-11-121-8/+8
| | | | | | | | | | When giving a function-style prototype for a macro taking a literal string parameter, put a string literal in place of a type for that parameter. This goofy appearance makes it obvious that this isn't really a function, and clues the reader in that the parameter can't actually be an arbitrary expression of the right type. Also change the nonsensical "NUL-terminated literal string" to "literal string" to describe these parameters. Fixes [perl #116286].
* make 'struct jmpenv' size independent of DEBUGGINGDavid Mitchell2017-08-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | RT #131942 My commit v5.27.1-114-g9449f0d added a field je_old_stack_hwm to the jmpenv structure on debugging builds. However, one field in the interpreter structure is a JMPENV (rather than JMPENV*), so this can make the interpreter structure size vary on debugging and non-debugging builds. This is usually a no-no, since it breaks re.pm, which recompiles the various re functions with DEBUGGING enabled, even on non-debugging fields. This was supposed to be handled by the extra '!defined DEBUGGING_RE_ONLY' condition, and indeed all core XS modules including re.xs work ok. However, it seems to have broken several CPAN modules. I still don't understand why, but the easiest fix is to just always include the debugging je_old_stack_hwm field in all builds.
* PL_curstackinfo->si_stack_hwm: gently restoreDavid Mitchell2017-07-161-1/+2
| | | | | | | | | | | | | | | | | | RT #131732 With v5.27.1-66-g87058c3, I introduced a DEBUGGING-only mechanism in the runops loop for checking whether an op extended the stack by as many slots as values it returned on the stack. It did this by setting a high-water-mark just before calling each pp function, and checking its result on return. It saved and restored the old value of PL_curstackinfo->si_stack_hwm whenever it entered or left a runops loop or did a JMPENV_PUSH / JMPENV_POP. However, the restoring could restore to an old value that was smaller than the current value, leading to false-positive stack-extend panics. So only restore if the old value was larger. In particular this was causing false positives in DBI.
* save si_stack_hwm across JMPENV_PUSHDavid Mitchell2017-07-031-0/+18
| | | | | | | | | When continuing after an exception (JMPENV_PUSH() returns 3), restore the value of PL_curstackinfo->si_stack_hwm. This is a recently added variable on debugging builds that detects attempts to push stuff on the stack without extending it. After an exception its value may be invalid and trigger a false panic.
* paranoia: parenthesize macro parametersLukas Mai2017-06-241-1/+1
|
* fix #ifdef directives with extra tokensLukas Mai2017-06-241-1/+1
|
* add PL_curstackinfo->si_stack_hwmDavid Mitchell2017-06-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | On debugging builds only, add a mechanism for checking pp function calls for insufficient stack extending. It works by: * make the runops loop set a high-water-mark (HWM) variable equal to PL_stack_sp just before calling each pp function; * make EXTEND() etc update this HWM; * on return from the pp function, panic if PL_stack_sp is > HWM. This detects whether pp functions are pushing more items onto the stack than they are requesting space for. There's a possibility of false positives if the code is doing weird stuff like direct manipulation of stacks via PL_curstack, SWITCHSTACK() etc. It's also possible that one pp function "knows" that a previous pp function will have already grown the stack enough. Currently the only place in core that seems to do this is pp_enteriter, which allocates 1 stack slot so that pp_iter doesn't have to check each time it returns &PL_sv_yes/no. To accommodate this, the new macro EXTEND_SKIP() has been added, that tells perl that it's safely skipping an EXTEND() here.
* remove eval's usage of SvSCREAMDavid Mitchell2016-11-121-2/+6
| | | | | | | | Currently the SvSCREAM flag is set on the sv pointed to by cx->blk_eval.cur_text, to indicate that it is ref counted. Instead, use a spare bit in the blk_u16 field of the eval context. This is to reduce the number of odd special cases for the SvSCREAM flag.
* CX_POP_SAVEARRAY(): use more distinctive var nameDavid Mitchell2016-05-231-2/+2
| | | | | | | | | | | Under -Wshadow, CX_POP_SAVEARRAY's local var 'av' can generate this warning: warning: declaration shadows a local variable [-Wshadow] So rename it to cx_pop_savearay_av to reduce the risk of a clash. (See http://nntp.perl.org/group/perl.perl5.porters/236444)
* Improve code comments for some ctx stuffDavid Mitchell2016-03-301-6/+6
| | | | | | | | | * in pp_return(), some comments were out of date about how leave_adjust_stacks() is called ; * add a comment to all the functions that pp_return() tail-calls to the effect that they can be tail-called; * make it clearer when/why OPf_SPECIAL is set on OP_LEAVE; * CXt_LOOP_PLAIN can be a while loop as well as a plain block.
* silence -Wparentheses-equalityDavid Mitchell2016-03-281-2/+2
| | | | | | | | | | | | | | | | | | Clang has taken it upon itself to warn when an equality is wrapped in double parentheses, e.g. ((foo == bar)) Which is a bit dumb, as any code along the lines of #define isBAR (foo == BAR) if (isBAR) {} will trigger the warning. This commit shuts clang up by putting in a harmless cast: #define isBAR cBOOL(foo == BAR)
* perlapi: Clarify that a literal string must end in a NULKarl Williamson2016-02-031-8/+8
| | | | Some entries already had this. For those, it standardizes the text.
* make gimme consistently U8David Mitchell2016-02-031-1/+1
| | | | | | | | | | | | | The value of gimme stored in the context stack is U8. Make all other uses in the main core consistent with this. My primary motivation on this was that the new function cx_pushblock(), which I gave a 'U8 gimme' parameter, was generating warnings where callers were passing I32 gimme vars to it. Rather than play whack-a-mole, it seemed simpler to just uniformly use U8 everywhere. Porting/bench.pl shows a consistent reduction of about 2 instructions on the loop and sub benchmarks, so this change isn't harming performance.
* MULTICALL *shouldn't* clear savestackDavid Mitchell2016-02-031-4/+1
| | | | | | | | | | | | | | | | | | | About 25 commits ago in this branch I added a commit: MULTICALL should clear scope after each call To fix RT #116577, which reported that lexicals were only being freed at the end of the MULTICALL, not after each individual call to the sub. In that commit, I added a LEAVE_SCOPE() to the end of the MULTICALL() definition. However, after further thought I realise that's wrong. If a multicall sub does something like { my $x = $_*2; $x }, then the returned value would be freed before the XS code which calls MULTICALL() has a chance to do anything with it (e.g. test for truth, or add it to the return args or whatever). So I think popping the save stack should be the responsibility of the caller of MULTICALL(), rather than of MULTICALL() itself.
* add blk_old_tmpsfloor shortcutDavid Mitchell2016-02-031-0/+1
| | | | | | | | Add #define blk_old_tmpsfloor cx_u.cx_blk.blku_old_tmpsfloor to match all the other 'struct block' fields which have similar short cuts
* dMULTICALL: remove unused varsDavid Mitchell2016-02-031-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | dMULTICALL declares several vars that are used either to maintain state across multiple calls, or to pass values to PUSHSUB etc, where those macros expected to obtain some of their args by values being implicitly passed via local vars. Since PUSHSUB has been replaced by cx_pushsub() which now has all parameters explicitly passed, there is no longer any need for those vars. So this commit eliminates them: newsp hasargs There are also a couple vars which are no longer used due to changes to the implementation over time; these can also be eliminated: cx multicall_cv Finally, this branch introduced a new var, saveix_floor; rename it to multicall_saveix_floor for consistency with other dMULTICALL vars. Although none of these vars are listed in the documentation, its possible that some code out there may rely on them in some way, and will need to be fixed up.
* convert CX_{PUSH|POP}{WHEN|GIVEN} to inline fnsDavid Mitchell2016-02-031-20/+0
| | | | Replace CX_PUSHGIVEN() with cx_pushgiven() etc.
* convert CX_PUSHLOOP*/POPLOOP to inline fnsDavid Mitchell2016-02-031-41/+0
| | | | Replace CX_PUSHLOOP_FOR() with cx_pushfloop_for() etc.