summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Add Perl_bytes_cmp_utf8() to compare character sequences in different encodingsNicholas Clark2010-11-112-0/+45
| | | | | | | | | | | | | | | | | | | | | | | Convert sv_eq_flags() and sv_cmp_flags() to use it. Previously, to compare two strings of characters, where was was in UTF-8, and one was not, you had to either: 1: Upgrade the second to UTF-8 2: Compare the resulting octet sequence 3: Free the temporary UTF-8 string or: 1: Attempt to downgrade the first to bytes. If it can't be, they aren't equal 2: Else compare the resulting octet sequence 3: Free the temporary byte string Which for the general case involves a malloc()/free() and at least two O(n) scans per comparison. Whereas this approach has no allocation, a single O(n) scan, which terminates as early as the best case for the second approach.
* [perl #78964] Fix ext/XS-APItest/t/overload.tJerry D. Hedden2010-11-111-1/+1
| | | | | | | | | Attached patch fixes the following warning from 'make test': ext/XS-APItest/t/overload...................................."my" variable $got masks earlier declaration in same scope at t/overload.t line 81. ok
* Test that Opcode loads without warnings.Nicholas Clark2010-11-091-3/+13
| | | | This will fail if there are untagged ops.
* Tidy up ext/Opcode/t/Opcode.t.Nicholas Clark2010-11-091-10/+10
| | | | | Convert a loop with a die into regular tests. Don't declare lexicals ahead of use. Don't even declare a lexical @o3, which isn't used.
* Convert ext/Opcode/t/Opcode.t to Test::More.Nicholas Clark2010-11-091-39/+39
| | | | The tests (including the still-TODO) mostly date from 1996.
* Fix error in tryAMAGICunDEREF() introduced in 25a9ffce153b0e67.Nicholas Clark2010-11-092-22/+60
| | | | tryAMAGICunDEREF() isn't used anywhere in the core. Add tests for it.
* Delete paragraphs from mro.pm’s podFather Chrysostomos2010-11-081-16/+0
| | | | which are no longer relevant
* Avoid a declaration after statement, accidentally added by 6079961fee8cf49c.Nicholas Clark2010-11-081-1/+2
| | | | | Code in ext/ isn't subject to the same compiler warnings regime as the top-level core files, hence why this was missed.
* In B.xs, remove the now unused first argument from make_sv_object().Nicholas Clark2010-11-081-35/+30
| | | | | After the previous change, all callers were passing in NULL and letting it generate a new mortal SV for them.
* In B.xs, use PPCODE rather than a typemap for output of T_SV_OBJNicholas Clark2010-11-082-56/+47
| | | | | This actually reduces both source code size and object code size (the latter by almost 1K on this platform).
* B::MAGIC::LENGTH(), not B::MAGIC::LEN(). Fixes #78864Nicholas Clark2010-11-081-1/+1
| | | | | b2adfa9b5e1682df inadvertently changed the name of the accessor for mg->mg_len to B::MAGIC::LENGTH. Fix this.
* In B.xs refactor cc_opclassname() to make_op_object().Nicholas Clark2010-11-082-34/+25
| | | | | | | | | | | | | | All bar one of the callers to cc_opclassname() were using it in the same way - to pass as the second argument of newSVrv(), whose first argument was a new mortal, and return value was used with sv_setiv() and PTR2IV(). So clearly *that* is the common code needed. Inline the existing code (all 1 line of it) in the other location that called cc_opclassname(). As the typemap was using cc_opclassname(), replace the 4 implicit uses of it with explicit PPCODE sections. Curiously, removing the use of this typemap actually reduces the line count of B.xs On this platform, this reduces the object code size by almost .5K.
* Merge the implementation of B::COP::{io,warnings} using ALIAS.Nicholas Clark2010-11-081-14/+5
| | | | On this platform, this reduces the object size by about .5K.
* In B.xs, refactor make_warnings_object() to take a COP * instead of STRLEN *.Nicholas Clark2010-11-081-2/+3
|
* Merge the implementation of B::COP::{filegv,stash} using ALIAS.Nicholas Clark2010-11-081-7/+7
| | | | | On this platform, this reduces the object size by about 400 bytes for a threaded build.
* Merge the implementation of B::COP::{file,stashpv} using ALIAS.Nicholas Clark2010-11-081-6/+6
| | | | | On this platform, this reduces the object size by about .5K, for an unthreaded build.
* Merge the implementation of B::BM::TABLE with B::PV::{PV,PVX,PVBM} using ALIAS.Nicholas Clark2010-11-081-13/+7
| | | | On this platform, this reduces the object code size by about .5K.
* Remove unneeded PREFIXes from B.xs.Nicholas Clark2010-11-081-20/+20
|
* Merge the implementation of B::PV::PVBM with PVX and PV, using ALIAS.Nicholas Clark2010-11-081-12/+12
|
* Merge the implementation of B::PV::{PVX,PV} using ALIAS.Nicholas Clark2010-11-081-5/+6
| | | | On this platform, this reduces the object size by .5K.
* Refactor B::PV::PV to use newSVpvn_flags() for both arms of the if.Nicholas Clark2010-11-081-4/+9
| | | | newSVpvn_flags(NULL, whatever, SVs_TEMP) is equivalent to sv_newmortal().
* Merge the implementation of B::REGEXP::{REGEXP,precomp} using ALIAS.Nicholas Clark2010-11-081-11/+10
|
* In B::REGEX::precomp, use newSVpvn_flags() instead of newSVpvn().Nicholas Clark2010-11-081-5/+3
| | | | | | Using newSVpvn_flags() and SVt_TEMP and an explicit push is one API call. newSVpvn() and RETVAL results in a second API call, sv_2mortal(), in the return typemap.
* In B.xs, move the version dependant regexp code to be adjacent.Nicholas Clark2010-11-081-23/+21
|
* Move the aliasing of B::IV::RV as B::PV::RV from XS to Perl code.Nicholas Clark2010-11-082-12/+7
| | | | | | This results in the same CV being used twice, rather than two CVs being created that point to the same XS code implementation, shrinking the memory usage of B slightly (168 bytes on this platform). It also is fewer source lines. :-)
* Add new ops in Opcode, so it does not warn at compilationRafael Garcia-Suarez2010-11-061-3/+3
| | | | The ops are the recently-introduced reach, rvalues, rkeys and transr.
* G_VOID, G_SCALAR, and G_ARRAY are not separate bits anymoreNiko Tyni2010-11-061-1/+10
| | | | | | | | Commit 2f8edad0d37e91319b6ba10b3745327ea49c179 made G_ARRAY equal to G_SCALAR | G_VOID, contrary to perlcall.pod. Bring the documentation up to date and add a test to prevent a similar (although unlikely) accident in the future.
* Tweak the test from 98517ccb8d5e8751 to work with PERL_UNICODE set.Nicholas Clark2010-11-051-2/+2
| | | | | | One should always generate the golden B::Concise output with PERL_UNICODE set so that ${^OPEN} is set, as the test system knows how to take it out, not put it in.
* Avoid creating lots of mortals in B::walkoptree()Nicholas Clark2010-11-052-17/+53
| | | | | | | | | | | When calling out to the user-supplied method, re-use the same reference and object where possible. Only create a new one if the user supplied method modified the reference or object passed to it. The previous implementation had a comment "Use the same opsv. Rely on methods not to mess it up." but it was actually generating a new reference for every call, and also a new object for every recursive call. So massive churn of objects, and large accumulation of mortals on the temp stack.
* B::Concise was failing to traverse some children of PMOPsNicholas Clark2010-11-052-4/+28
| | | | | | | | Notably the substcont of s/// was being missed. The bug was introduced as part of c0939ceec1b3e902, "Re: [patch] teach B::Concise to see XS code", which did rather more than it said on the tin.
* Stop B from crashing on y/å/ø/Father Chrysostomos2010-11-042-1/+11
|
* Some tests for B::walkoptree.Nicholas Clark2010-11-041-0/+60
| | | | | Quite likely coverage isn't that good, but some tests are better than none. More tests welcome.
* Create &B::{IV,PV}::as_string using typeglob assignment rather than goto &Nicholas Clark2010-11-041-2/+2
| | | | | Typeglob assignment avoids compiler work creating the optree for a second subroutine, and runtime work executing that optree.
* Avoid needing to stub B::OPf_KIDS by loading the XS earlier.Nicholas Clark2010-11-041-19/+25
| | | | | | | | This will also inline the constant in the code of walkoptree_slow(). Things are complicated by the fact that B's BOOT code needs $VERSION set, and pushes to @EXPORT_OK. Move the 'use strict' much earlier.
* Remove two use of dXSI32; superfluous because xsubpp automatically adds it.Nicholas Clark2010-11-042-3/+0
|
* Add Perl_amagic_deref_call() to implement the bulk of tryAMAGICunDEREF_var().Nicholas Clark2010-11-032-10/+6
| | | | | | | | | This removes around 300 bytes of object code from each place it was previously inlined. It also provides a better interface - quite a lot of the core currently bodges things by creating a local variable C<SV **sp = &sv> to use the macro. Change the XS::APItest wrapper to amagic_deref_call().
* Add tests for tryAMAGICunDEREF_var().Nicholas Clark2010-11-034-10/+117
|
* Increase B::Concise’s versionFather Chrysostomos2010-11-021-1/+1
|
* y///rFather Chrysostomos2010-11-022-3/+4
|
* Increase DynaLoader’s versionFather Chrysostomos2010-11-011-1/+1
|
* Avoid buffer overflow in dl_win32.cJan Dubois2010-11-011-0/+4
| | | | | This fixes the DynaLoader related part of bug 78710 http://rt.perl.org/rt3//Public/Bug/Display.html?id=78710
* Correct the return type for B::MAGIC::MOREMAGIC.Nicholas Clark2010-11-011-3/+2
| | | | | | | b2adfa9b5e1682df accidentally changed the return type from SV to B::SV. Clearly there aren't enough tests. However, the code prior to b2adfa9b5e1682df was buggy (now fixed) in that it could put a NULL on the perl stack. The stack should only be valid SV pointers.
* Tidy B interpreter struct accessors in B.xsNicholas Clark2010-11-011-18/+17
| | | | | | | | 1: Express B::amagic_generation and B::comppadlist "longhand", rather than creating macros solely for the benefit of xsubpp. 2: As no functions remain needing prefix stripping, eliminate the MODULE definition for B with the PREFIX of B_. 3: Merge the two BOOK blocks.
* Merge B's interpreter structure accesses for SV* types into intrpvar_sv_common.Nicholas Clark2010-11-011-68/+64
| | | | On this platform this reduces the object size by 4.5K.
* All callers of get_op_bitspec() in Opcode.xs pass len, so don't call strlen().Nicholas Clark2010-11-011-2/+0
| | | | This commit brought to you by the campaign for elimination of strlen().
* Small refactoring of op_names_init() and put_op_bitspec() in Opcode.xsNicholas Clark2010-11-011-7/+3
| | | | | | | | | Change op_names_init() to use memset() rather than a longhand loop, and to call put_op_bitspec() with an explicit length by using STR_WITH_LEN(). As all calls to put_op_bitspec() now pass in a length, remove the code to call strlen() if the passed-in length is zero. This commit brought to you by the campaign for elimination of strlen().
* Merge the implementation of B::sv_{undef,no,yes} using ALIAS.Nicholas Clark2010-11-011-12/+10
| | | | On this platform, this reduces the object code size by around .75K.
* Merge the XS implementation of all B::MG accessors using ALIAS.Nicholas Clark2010-10-311-80/+59
| | | | On this platform, this reduces the object code size by over 5K.
* Merge the implementation of B::{main_root,main_start} using ALIAS.Nicholas Clark2010-10-311-8/+9
|
* Merge the implementation of B::{dowarn,sub_generation} using ALIAS.Nicholas Clark2010-10-311-8/+9
|