| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
This will fail if there are untagged ops.
|
|
|
|
|
| |
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.
|
|
|
|
| |
The tests (including the still-TODO) mostly date from 1996.
|
|
|
|
| |
tryAMAGICunDEREF() isn't used anywhere in the core. Add tests for it.
|
|
|
|
| |
which are no longer relevant
|
|
|
|
|
| |
Code in ext/ isn't subject to the same compiler warnings regime as the
top-level core files, hence why this was missed.
|
|
|
|
|
| |
After the previous change, all callers were passing in NULL and letting it
generate a new mortal SV for them.
|
|
|
|
|
| |
This actually reduces both source code size and object code size (the latter
by almost 1K on this platform).
|
|
|
|
|
| |
b2adfa9b5e1682df inadvertently changed the name of the accessor for
mg->mg_len to B::MAGIC::LENGTH. Fix this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
On this platform, this reduces the object size by about .5K.
|
| |
|
|
|
|
|
| |
On this platform, this reduces the object size by about 400 bytes for a threaded
build.
|
|
|
|
|
| |
On this platform, this reduces the object size by about .5K, for an unthreaded
build.
|
|
|
|
| |
On this platform, this reduces the object code size by about .5K.
|
| |
|
| |
|
|
|
|
| |
On this platform, this reduces the object size by .5K.
|
|
|
|
| |
newSVpvn_flags(NULL, whatever, SVs_TEMP) is equivalent to sv_newmortal().
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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. :-)
|
|
|
|
| |
The ops are the recently-introduced reach, rvalues, rkeys and transr.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Quite likely coverage isn't that good, but some tests are better than none.
More tests welcome.
|
|
|
|
|
| |
Typeglob assignment avoids compiler work creating the optree for a second
subroutine, and runtime work executing that optree.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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().
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This fixes the DynaLoader related part of bug 78710
http://rt.perl.org/rt3//Public/Bug/Display.html?id=78710
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
On this platform this reduces the object size by 4.5K.
|
|
|
|
| |
This commit brought to you by the campaign for elimination of strlen().
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
| |
On this platform, this reduces the object code size by around .75K.
|
|
|
|
| |
On this platform, this reduces the object code size by over 5K.
|
| |
|
| |
|