summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Remove the VM/ESA port.Nicholas Clark2012-08-312-200/+1
| | | | | VM/ESA was a mainframe OS. IBM ended service on it in June 2003. It was superseded by Z/VM.
* Silence ParseXS warning about abusing the CODE sectionSteffen Mueller2012-08-318-71/+90
| | | | | | | See RT #114198. DynaLoader was warning about somewhat dubious use of RETVAL with a CODE section but without an OUTPUT section. This fixes that problem, but I have obviously not been able to test on all affected operating systems.
* Opcode.pm: wrap long pod linesFather Chrysostomos2012-08-261-17/+24
|
* Increase $Opcode::VERSION to 1.24Father Chrysostomos2012-08-261-1/+1
|
* Remove boolkeys opFather Chrysostomos2012-08-261-1/+1
|
* Banish boolkeysFather Chrysostomos2012-08-251-1/+1
| | | | | | | | | | | | | | Since 6ea72b3a1, rv2hv and padhv have had the ability to return boo- leans in scalar context, instead of bucket stats, if flagged the right way. sub { %hash || ... } is optimised to take advantage of this. If the || is in unknown context at compile time, the %hash is flagged as being maybe a true boolean. When flagged that way, it returns a bool- ean if block_gimme() returns G_VOID. If rv2hv and padhv can already do this, then we don’t need the boolkeys op any more. We can just flag the rv2hv to return a boolean. In all the cases where boolkeys was used, we know at compile time that it is true boolean context, so we add a new flag for that.
* Add empty inline_invlist.cKarl Williamson2012-08-251-2/+7
| | | | | | | | | | This will be used for things need to handle inversion lists in the three files that currently use them. I'm putting this in a separate hdr, because inversion lists are very internal-only, so should not be grouped in with things that there is an external API for. It is a dot-c file so that the functions can continue to be declared with embed.fnc, and porting/args_assert.t will continue to work, as it looks only in .c files.
* Increase $B::Concise::VERSION to 0.93Father Chrysostomos2012-08-251-1/+1
|
* Optimise %hash in sub { %hash || ... }Father Chrysostomos2012-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In %hash || $foo, the %hash is in scalar context, so it has to iterate through the buckets to produce statistics on bucket usage. If the || is in void context, the value returned by hash is only ever used as a boolean (as || doesn’t have to return it). We already opti- mise it by adding a boolkeys op when it is known at compile time that || will be in void context. In sub { %hash || $foo } it is not known at compile time that it will be in void context, so it wasn’t optimised. This commit optimises it by flagging the %hash at compile time as being possibly in ‘true boolean’ context. When that flag is set, the rv2hv and padhv ops call block_gimme() to see whether || is in void context. This speeds things up signficantly. Here is what I got after optimis- ing rv2hv but before doing padhv: $ time ./miniperl -e '%hash = 1..10000; sub { %hash || 1 }->() for 1..100000' real 0m0.179s user 0m0.101s sys 0m0.005s $ time ./miniperl -e 'my %hash = 1..10000; sub { %hash || 1 }->() for 1..100000' real 0m5.446s user 0m2.419s sys 0m0.015s (That example is slightly misleading because of the closure, but the closure version takes 1 sec. when optimised.)
* close the Peek.t temp file so the END block can unlink itTony Cook2012-08-241-0/+1
| | | | This was leaving detritus on Win32 builds
* Use FooBAR convention for new pad macrosFather Chrysostomos2012-08-223-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a while, I realised that it can be confusing for PAD_ARRAY and PAD_MAX to take a pad argument, but for PAD_SV to take a number and PAD_SET_CUR a padlist. I was copying the HEK_KEY convention, which was probably a bad idea. This is what we use elsewhere: TypeMACRO ----===== AvMAX CopFILE PmopSTASH StashHANDLER OpslabREFCNT_dec Furthermore, heks are not part of the API, so what convention they use is not so important. So these: PADNAMELIST_* PADLIST_* PADNAME_* PAD_* are now: Padnamelist* Padlist* Padname* Pad*
* PATCH: Devel::Peek doesn't compile under C++Karl Williamson2012-08-221-1/+1
| | | | | Commit c9795579db61c900bacee2790bdceb7bad3dd45d introduced an error in C++: it's missing a cast.
* Peek.t: Test that DeadCode doesn’t crashFather Chrysostomos2012-08-221-0/+8
| | | | | I broke it, but Karl Williamson’s commit (the previous) with my tweaks fixes it. This function was not at all exercised by the test suite.
* Devel::Peek: Fix so compiles under C++Karl Williamson2012-08-223-5/+10
| | | | | | | | | | Commit 86b9d29366aea0e71ad75b61d04f56f1fe5b0d4d created a new PADLIST type. However, this broke the compilation of Devel::Peek with C++. This commit gets it to compile again, and pass our regression test suite. [Modified by the committer to use the correct PADLIST_ macros; other- wise it will crash.]
* Increase $XS:APItest::VERSION to 0.43Father Chrysostomos2012-08-211-1/+1
|
* Increase $B::VERSION to 1.38Father Chrysostomos2012-08-211-1/+1
|
* More PAD APIsFather Chrysostomos2012-08-211-6/+6
| | | | | | | | | | | | | | | | If we are making padlists their own type, and no longer AVs, it makes sense to add APIs for pads, too, so that CPAN code that needs to change now will only have to change once if we ever stop pads them- selves from being AVs. There is no reason pad names have to be SVs, so I am adding sep- arate APIs for pad names, too. The AV containing pad names is now officially a PADNAMELIST, which is accessed, not via *PADLIST_ARRAY(padlist), but via PADLIST_NAMES(padlist). Future optimisations may even merge the padlist with its name list so I have also added macros to access the parts of the name list directly from the padlist.
* Increase $B::Xref::VERSION from 1.03 to 1.04Father Chrysostomos2012-08-211-1/+1
|
* Stop padlists from being AVsFather Chrysostomos2012-08-214-6/+89
| | | | | | | | | | | | | | | | | | | | | In order to fix a bug, I need to add new fields to padlists. But I cannot easily do that as long as they are AVs. So I have created a new padlist struct. This not only allows me to extend the padlist struct with new members as necessary, but also saves memory, as we now have a three-pointer struct where before we had a whole SV head (3-4 pointers) + XPVAV (5 pointers). This will unfortunately break half of CPAN, but the pad API docs clearly say this: NOTE: this function is experimental and may change or be removed without notice. This would have broken B::Debug, but a patch sent upstream has already been integrated into blead with commit 9d2d23d981.
* newCONSTSUB needs its own CV.Craig A. Berry2012-08-171-5/+5
| | | | | | | | | | | It had been using one called simply C<cv> but that name is already taken in the (opaque) argument list generated by the XS_EUPXS wrapper around the function name. And that cv is actually used by boilerplate code generated from PPCODE, but only when there is an ALIAS section present, which there wasn't before c0810f8ef84, but now is. So declare and use our own CV and leave the one passed in alone.
* Remove the UTS port.Nicholas Clark2012-08-171-9/+0
| | | | | | UTS was a mainframe version of System V created by Amdahl, subsequently sold to UTS Global. The port has not been touched since before 5.8.0, and UTS Global is now defunct.
* Tweak the test from 35f7559499c4a614 to work with PERL_UNICODE set.Nicholas Clark2012-08-151-4/+4
|
* XS::APItest::newCONSTSUB was not handling SV reference counts correctly.Nicholas Clark2012-08-142-3/+34
| | | | | | newCONSTSUB() and newCONSTSUB_flags() take ownership of (one reference to) the passed-in SV. As the XS wrapper is passing in a SV taken from the stack, it needs to up the reference count by one in order to avoid later bugs.
* Use ALIAS to provide XS::APItest::newCONSTSUB and newCONSTSUB_flagsNicholas Clark2012-08-143-13/+14
| | | | | | | | | | Previously both C routines were wrapped with newCONSTSUB_type, which used a "type" parameter to determine which C code to call. Use an ALIAS to bind the code to two names, and eliminate the "type" parameter. This makes the test code clearer. It's not perfect, as the XS wrapper XS::APItest::newCONSTSUB has a flags parameter whereas the underlying C code does not, but fixing this would require considerably more XS hackery.
* Bump $Win32CORE::VERSIONSteve Hay2012-08-131-1/+1
| | | | The .c file was changed by 2e94d7323a.
* re.pm: Nits in podKarl Williamson2012-08-111-15/+23
| | | | | This has clarifications, grammar changes, and reflowing to fit into 79 columns
* OptreeCheck.pm: typoFather Chrysostomos2012-08-101-1/+1
|
* B::Concise: Two unused varsFather Chrysostomos2012-08-101-2/+0
| | | | | | One was made unnecessary by 35f7559499. The other was added by 35f7559499 and never used. I forgot to clean up once I had things working.
* Newlines in a runperl() prog cause trouble so use progfile insteadSteve Hay2012-08-102-13/+29
| | | | | This fixes "Format not terminated at -e line 2, at end of line" errors on Windows (at least) coming from the new tests added by commit 35f7559499.
* B::Concise: Document formatsFather Chrysostomos2012-08-081-1/+2
|
* B::Concise: Dump formats upon requestFather Chrysostomos2012-08-082-7/+63
|
* B::Concise: Fix -nobannerFather Chrysostomos2012-08-082-2/+9
| | | | It was only working when B::Concise was passed a code ref.
* Increase $B::Concise::VERSION to 0.92Father Chrysostomos2012-08-081-1/+1
|
* Fix Devel::Peek’s tests for format changesFather Chrysostomos2012-08-051-2/+2
|
* Add a depth field to formatsFather Chrysostomos2012-08-051-2/+4
| | | | | Instead of lengthening the struct, we can reuse SvCUR, which is cur- rently unused.
* Make PL_(top|body|form)target PVIVsFather Chrysostomos2012-08-051-3/+11
| | | | | | | | | | | | | These are only used for storing a string and an IV. Making them into full-blown SVt_PVFMs is overkill. FmLINES was only being used on these three scalars. So make it use the SvIVX field. struct xpvfm no longer needs an xfm_lines member, because SVt_PVFMs no longer use it. This also causes a TODO test in taint.t to start passing, but I do not fully understand why. But at least that’s progress. :-)
* Add PERL_NO_GET_CONTEXT to Win32COREDaniel Dragan2012-07-301-0/+1
| | | | | Win32CORE is already ithreads aware, but was still making Perl_get_context calls. This fixes that. Smaller machine code is the result.
* Make undef &foo remove call checkersFather Chrysostomos2012-07-291-1/+10
| | | | | | | | | The fact that the call checker is stored in magic is an implementation detail. cv_undef does not free magic, so the call checker lives on. If we were to move the parameter prototype into magic internally, we would not want undef to stop clearing it. To me, the current situa- tion with call checkers is similar.
* Optimize a single character [class] into EXACTishKarl Williamson2012-07-241-4/+4
| | | | | Things like /[s]/ or /[s]/i can be optimized as if they did not have the brackets, /s/ or /s/i.
* Bump B's VERSION and note the changes in perldelta.pod.Nicholas Clark2012-07-241-1/+1
|
* Expose all GV flags matching qr/GVf_/ as constants in B.Nicholas Clark2012-07-241-2/+2
| | | | Previously only those matching qr/GVf_IMPORTED/ were exposed.
* Expose all CV flags matching qr/CVf_/ as constants in B.Nicholas Clark2012-07-241-11/+3
| | | | | | Previously most were exposed as constants, but often B was not taught about flags added to cv.h. Determining the flags by parsing cv.h also permits the removal of various version-specific logic from the Makefile.PL
* Expose all SV flags matching qr/SV(?:[fps]|pad)_/ as constants in B.Nicholas Clark2012-07-241-2/+1
| | | | Previously only a subset were exposed as constants.
* In ext/B/Makefile.PL, order the list of files to scan lexically.Nicholas Clark2012-07-241-4/+5
| | | | | | It doesn't actually matter which order the files are scanned for constants, but it's neater and slightly clearer where to add new files if there is an obvious order.
* ensure that the env var SV after C<{FOO}='x'> is PV onlyChip Salzenberg2012-07-243-2/+6
|
* Only generate above-Uni warning for \p{}, \P{}Karl Williamson2012-07-191-8/+17
| | | | | | | | | | | This warning was being generated inappropriately during some internal operations, such as parsing a program; spotted by Tom Christiansen. The solution is to move the check for this situation out of the common code, and into the code where just \p{} and \P{} are handled. As mentioned in the commit's perldelta, there remains a bug [perl #114148], where no warning gets generated when it should
* Magic flags harmonization.Chip Salzenberg2012-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | In restore_magic(), which is called after any magic processing, all of the public OK flags have been shifted into the private OK flags. Thus the lack of an appropriate public OK flags was used to trigger both get magic and required conversions. This scheme did not cover ROK, however, so all properly written code had to make sure mg_get was called the right number of times anyway. Meanwhile the private OK flags gained a second purpose of marking converted but non-authoritative values (e.g. the IV conversion of an NV), and the inadequate flag shift mechanic broke this in some cases. This patch removes the shift mechanic for magic flags, thus exposing (and fixing) some improper usage of magic SVs in which mg_get() was not called correctly. It also has the side effect of making magic get functions specifically set their SVs to undef if that is desired, as the new behavior of empty get functions is to leave the value unchanged. This is a feature, as now get magic that does not modify its value, e.g. tainting, does not have to be special cased. The changes to cpan/ here are only temporary, for development only, to keep blead working until upstream applies them (or something like them). Thanks to Rik and Father C for review input.
* Simplify ck_grepFather Chrysostomos2012-07-143-20/+20
| | | | | | | | | | | | | | | | | | Back in perl 5.000, ck_grep would call ck_sort (which was still the case until 354dd559d99 just recently) and the latter would traverse its way through the op_next pointers to find an op that tried to escape the block, setting its op_next pointer to null. Then ck_grep would traverse op_next pointers itself to find the place where ck_sort stopped. That caused problems for grep which were fixed in 748a93069b (perl 5.001). It was fixed by setting op_next to 0 on the first op, so that the loop in ck_grep would not do anything. But that loop was left there. This commit removes it. There are also a couple of things I missed when disentangling ck_grep and ck_sort in commit /354dd559d9. I accidentally put if (o->op_flags & OPf_STACKED) inside if (o->op_flags & OPf_STACKED). And the OPf_SPECIAL flag was only being set for sort’s use, so ck_grep doesn’t need to copy that.
* [perl #113710] Make __SUB__ work in sort blockFather Chrysostomos2012-07-142-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the peephole optimiser encounters a __SUB__, it looks to see whether the current sub is clonable. If it is not, it inlines the __SUB__ as a const op. This works most of the time. A forward declaration will cause the sub definition to reuse the existing stub. When that happens, the sub visible during compilation in PL_compcv is not the sub that the op tree will finally be attached to. But the peephole optimiser is called after that, with PL_compcv set to the other CV (what was a stub). ck_sort was calling the peephole optimiser on the sort block ahead of time. So this caused __SUB__ to point to the wrong subroutine. By removing the CALL_PEEP call from ck_sort and adding logic to the peephole optimiser itself to traverse the sort block (it is not in the usual op_next chain), this bug is eliminated. I modified the DEFER macro to work as a single statement. You don’t want to know how much time I spent debugging the bus errors that were occurring because if(foo) DEFER; didn’t do what I though. It turns out that grepstart and mapstart, which also use ck_sort, had their blocks go through the peephole optimiser twice, because grepwhile already has special-casing in the peephole optimiser. This also has the side-effect of making map and grep slightly more efficient, in that they no longer execute a scope op (which is just pp_null). By temporarily disconnecting the subtree before running the optimiser, ck_sort was hiding a possible optimisation (skipping the scope op).
* silence warning about use of --libpodsRobin Barker2012-07-131-1/+0
| | | | | --lipods warns, and I don't think it is needed in this test, so I have removed it