Chris 'BinGOs' Williams [Thu, 14 Jul 2011 12:30:34 +0000 (13:30 +0100)]
Added -r option to corelist
This will display the release date of a given perl release.
If no perl release is specified, will list all perl releases
and release dates.
H.Merijn Brand [Thu, 14 Jul 2011 10:22:12 +0000 (11:22 +0100)]
Update POD for 'corelist' so that the help page is more actual than illustrative
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
David Mitchell [Tue, 5 Jul 2011 14:53:34 +0000 (15:53 +0100)]
make peep optimiser recurse mostly only shallowly
Long blocks of code that include logical or loop ops (i.e. those with
multiple 'branches' of ops, such as op_other, op_redo etc) cause
Perl_rpeep to recurse deeply and eventaully SEGV.
For example this crashes, due to the ENTERLOOP:
eval ("{\$x = 1 }\n" x 10000)
The deep recursion happens because the processing of the entire rest of
the code occurs in within the nested call. For example in the code
A && B; C; D; E;
the ops are structured as
A -> AND -> C -> D -> E
\ /
B
where AND->op_next points to C, while AND->op_other points to B.
rpeep() would normally process each op in the op_next sequence in turn
(i.e. A/AND/C/D/E), but when it reaches AND, it recursively calls
rpeep(B), which happens to then process B/C/D/E. Finally it returns,
and the parent rpeep processes C, finds it's already done, and exits.
Clearly, if C,D,E etc also contain conditional/loop ops, then the
recursion level gradually stacks up.
The fix for this is to add a small deferred queue to rpeep().
Whenever rpeep wants to recurse with op_other or op_lastop etc,
it instead adds it to the deferred queue. Only if the queue is full is
rpeep actually called. The hope is that by deferring, when we do
eventually process it, enough of the main op_next chain has already been
processed to ensure that the child rpeep returns very early.
In the example above, processing of AND causes B to be added to the queue,
and the main rpeep process continues processing C, D etc. Sometime later,
the queue becomes full and B is processed via a recursive call to rpeep.
B is processed, and op_next is followed to C, but C is marked as already
processed, so the child rpeep returns almost immediately.
For LOOP ops, I've stopped following op_redoop and op_nextop, since
AFAIKT the ops these point to will also be reachable vie op_next anyway.
op_lastop is the exception; in while(1){..} only op_lastop points to the
rest of the code block.
Note that this commit doesn't guarantee only shallow recursion, it just
makes deep recursion fairly unlikely.
Note also that this commit causes the order of the processing of op_next
chains to be altered; this can affect the ordering of compiler warnings
and fatal messages among potentially other things.
Nicholas Clark [Wed, 13 Jul 2011 20:39:15 +0000 (22:39 +0200)]
Only add Perl_pad_setsv to the list of symbols if -DDEBUGGING is true.
This is needed on Win32 since
cc76b5cc1552a605, which make Perl_pad_setsv part
of the public API, and thereby exported for the first time.
Father Chrysostomos [Thu, 14 Jul 2011 05:35:13 +0000 (22:35 -0700)]
[perl #93324] Don’t autovivify *B:: in Carp
While this may be bending over backwards, this avoids causing problems
for the Perl compiler suite and also for various CPAN modules that use
A, B and C packages for testing.
Father Chrysostomos [Thu, 14 Jul 2011 05:14:49 +0000 (22:14 -0700)]
perldelta update
Father Chrysostomos [Thu, 14 Jul 2011 05:14:30 +0000 (22:14 -0700)]
Ahem,
0fce7163 was not enough
Florian Ragwitz [Wed, 13 Jul 2011 17:22:52 +0000 (19:22 +0200)]
Fix a compiler warning
gimme is being set by POPBLOCK, but otherwise unused. PERL_UNUSED_VAR stops the
warning gcc generates for that.
Florian Ragwitz [Wed, 13 Jul 2011 17:22:41 +0000 (19:22 +0200)]
Remove an unused variable
Florian Ragwitz [Wed, 13 Jul 2011 17:05:01 +0000 (19:05 +0200)]
Don't include libutil.h on Linux
All it does is cause warnings on recent systems with that header installed. It's
required for some variants of FreeBSD only.
Florian Ragwitz [Wed, 13 Jul 2011 15:26:42 +0000 (17:26 +0200)]
Dual-life Term::Complete
Father Chrysostomos [Wed, 13 Jul 2011 15:39:14 +0000 (08:39 -0700)]
perldelta for the SvIsCOW fix
Father Chrysostomos [Wed, 13 Jul 2011 15:33:04 +0000 (08:33 -0700)]
perldelta for recent SvREADONLY fixes
Father Chrysostomos [Wed, 13 Jul 2011 04:50:35 +0000 (21:50 -0700)]
Merge UTF8 pad stuff
The series of commits in this branch add pad functions to the API and
make the pad fully UTF8-aware.
Previously, ‘use utf8; my $фу’ used to store raw UTF8 bytes in the
pad, without marking them as such. So things sort of worked ‘by
accident’.
Father Chrysostomos [Wed, 13 Jul 2011 04:38:17 +0000 (21:38 -0700)]
Fix perlintern links; regen known pod issues
Father Chrysostomos [Wed, 13 Jul 2011 04:32:06 +0000 (21:32 -0700)]
Add a test count to fresh_perl_utf8.t
Father Chrysostomos [Wed, 13 Jul 2011 03:41:57 +0000 (20:41 -0700)]
Add Brian Fraser to AUTHORS
Brian Fraser [Thu, 16 Jun 2011 10:57:22 +0000 (07:57 -0300)]
This cleans the "Can't localize lexical variable" error.
Plus the test case from t/run/fresh_perl.t, but in UTF-8,
in t/op/fresh_perl_utf8.t
That file currently has only that test, but I intend to
port others from fresh_perl.t to test clean stashes/GVs.
Brian Fraser [Sat, 11 Jun 2011 18:53:43 +0000 (15:53 -0300)]
Cleaned up warning messages in pad.c, plus related tests.
Brian Fraser [Sat, 11 Jun 2011 18:38:11 +0000 (15:38 -0300)]
Tests for the pad cleanup.
Brian Fraser [Sat, 11 Jun 2011 18:12:44 +0000 (15:12 -0300)]
Cleanup of pad fetching and storing. This version normalizes the data on both sides, which isn't required, but may be more efficient than leaving it to the comparison function.
Brian Fraser [Sat, 11 Jun 2011 17:39:00 +0000 (14:39 -0300)]
Added sv_eq_pvn_flags to pad.c, which will be used by later commits.
Brian Fraser [Sat, 11 Jun 2011 17:34:51 +0000 (14:34 -0300)]
Passing the flag to the pad functions in toke.c
Brian Fraser [Sat, 11 Jun 2011 17:05:29 +0000 (14:05 -0300)]
Handling of the flag parameter in Perl_allocmy, instead of looking at the global flag.
Brian Fraser [Sun, 10 Jul 2011 18:06:47 +0000 (11:06 -0700)]
pad.c: flags checking for the UTF8 flag when necessary
Brian Fraser [Sat, 11 Jun 2011 16:34:06 +0000 (13:34 -0300)]
pad.h: Added a padadd_UTF8_NAME flag for pad_add_name_pvn.
Brian Fraser [Sat, 11 Jun 2011 16:29:54 +0000 (13:29 -0300)]
Added a flags parameter to pad_findlex.
Zefram [Sun, 12 Dec 2010 21:10:22 +0000 (21:10 +0000)]
API tests for pad_findmy_*()
Zefram [Sun, 12 Dec 2010 20:09:00 +0000 (20:09 +0000)]
API test for find_rundefsv()
Zefram [Sun, 12 Dec 2010 16:08:14 +0000 (16:08 +0000)]
APIify pad functions
Move several pad functions into the core API. Document the pad
functions more consistently for perlapi. Fix the interface issues
around delimitation of lexical variable names, providing _pvn, _pvs,
_pv, and _sv forms of pad_add_name and pad_findmy.
Florian Ragwitz [Tue, 12 Jul 2011 21:51:38 +0000 (23:51 +0200)]
Stop buildtoc from generating trailing whitespace
In win32/pod.mak, at least.
Florian Ragwitz [Tue, 12 Jul 2011 20:59:56 +0000 (22:59 +0200)]
Move perlxs{,tut}.pod into the ExtUtils-ParseXS dist
Florian Ragwitz [Tue, 12 Jul 2011 21:20:12 +0000 (23:20 +0200)]
Skip .xs files in t/ dirs when comparing versions
Florian Ragwitz [Tue, 12 Jul 2011 21:18:06 +0000 (23:18 +0200)]
podcheck.t --regen after the ParseXS merge
Steffen Mueller [Tue, 12 Jul 2011 20:23:01 +0000 (22:23 +0200)]
A perltodone! ExtUtils::ParseXS uses strict
This is thanks to James Keenan's work! Finally!
Steffen Mueller [Tue, 12 Jul 2011 20:10:56 +0000 (22:10 +0200)]
Fill in ExtUtils::ParseXS versions in delta
Steffen Mueller [Tue, 12 Jul 2011 20:02:24 +0000 (22:02 +0200)]
Merge branch 'smueller/eu_typemap' into blead
Much of ExtUtils::ParseXS was rewritten and cleaned up.
It has been made somewhat more extensible and now finally
uses strictures.
The logic for parsing, merging, and dumping XS typemaps was extracted
from ExtUtils::ParseXS into a module of its own, ExtUtils::Typemaps.
ExtUtils::Typemaps offers an interface to typemap handling outside of
the scope of the XS compiler itself.
As a first use case of the improved API an extensibility, typemaps can now
be included inline into XS code with a HEREDOC-like syntax:
TYPEMAP: <<END_TYPEMAP
MyType T_IV
END_TYPEMAP
Father Chrysostomos [Tue, 12 Jul 2011 20:01:58 +0000 (13:01 -0700)]
Increase $Storable::VERSION
The recent CPAN release of 2.30 did not include the last two
changes to Storable.xs, so blead needs a new number.
Father Chrysostomos [Tue, 12 Jul 2011 18:54:15 +0000 (11:54 -0700)]
Make Internals::SvREADONLY smarter
(aka: More fun with Hash::Util)
$ perl -lMHash::Util=lock_value
$h{a} = __PACKAGE__; lock_value %h, a; $h{a} = "3"; print $h{a}'
^D
3
OK, so it didn’t really lock it. Now for more fun:
$ perl -lMHash::Util=unlock_value
$h{a} = __PACKAGE__; unlock_value %h, a; $h{a} =~ y/ia/ao/;
print __PACKAGE__
^D
moan
There are three different ways to fix this:
1) Add an SvFAKE function to Internals:: (not *more* ‘internals’ for
people [ahem, Const::Fast, ahem] to abuse!)
2) Use B::* functions in Hash::Util to check the flags (too slow)
3) Make Internals::SvREADONLY less ‘internal’, by having it deal with
readonliness in general, rather than just the SVf_READONLY flag.
The third approach seems the most logical, so that’s what this
commit does.
There is one test in t/op/tr.t that uses Internals::SvREADONLY to
detect bovinity, so I’ve changed it to use B instead, as that will
have no effect on post-install efficiency.
(This approach also fixes Const::Fast’s bugginess, but that is purely
accidental.)
Father Chrysostomos [Tue, 12 Jul 2011 19:24:29 +0000 (12:24 -0700)]
Make SvIsCOW honest about globs
SvIsCOW was ignoring the fact that it might be passed a
typeglob, which made its behaviour contradict its docs.
This fixes that and, in doing so, simplifies the
upcoming Internals::SvREADONLY fix.
Father Chrysostomos [Tue, 12 Jul 2011 18:13:31 +0000 (11:13 -0700)]
Make it possible to have read-only glob copies
(aka Fun with Hash::Util)
This script gives ‘Modification of a read-only value’:
use Hash::Util lock_value;
*foo::; # autovivify
lock_value %::, foo::::;
*foo:: = [];
So far so good. That’s to be expected. But this one crashes:
use Hash::Util lock_value;
$a{h} = *foo;
lock_value %a, h;
$a{h} = [];
Under debugging builds, it gives assertion failures.
Anyone who knows how the flags work will see immediately what’s wrong,
but for the sake of those who don’t:
The SVf_FAKE flag is set on a copy of a typeglob, meaning that assign-
ing something other than a glob to it will overwrite the glob, instead
of writing to one of its slots.
The SVf_FAKE flag on a read-only (SVf_READONLY-flagged) string means
that it’s not actually read-only, but a copy-on-write string.
SVf_READONLY on a glob means that you can’t even assign *through* it.
See the first Hash::Util example above.
The crashing occurs when the two flags are combined.
sv_force_normal_flags assumes that anything marked fake AND read-only
is a copy-on-write string, so it proceeds to gut it, even if it’s
actually just corrupting a glob.
So this commit changes that check to take typeglobs into account.
Steffen Mueller [Tue, 12 Jul 2011 19:57:49 +0000 (21:57 +0200)]
Document full changeset in ExtUtils::ParseXS
Steffen Mueller [Tue, 12 Jul 2011 19:52:51 +0000 (21:52 +0200)]
Bump ExtUtils::ParseXS version to a dev version
Steffen Mueller [Tue, 12 Jul 2011 19:42:52 +0000 (21:42 +0200)]
Document the TYPEMAP XS keyword
It can be used for embedding typemaps in XS code. Very convenient
when generating XS!
Steffen Mueller [Tue, 12 Jul 2011 19:22:52 +0000 (21:22 +0200)]
Document the ExtUtils::ParseXS changes in perldelta
Steffen Mueller [Mon, 16 May 2011 18:24:33 +0000 (20:24 +0200)]
Attempt band-aid fix for win32 build failure
Steffen Mueller [Sun, 17 Apr 2011 15:13:43 +0000 (17:13 +0200)]
Add is_empty method to EU::Typemaps
Steffen Mueller [Sun, 17 Apr 2011 12:16:36 +0000 (14:16 +0200)]
Use lower case method name for current_line_number
My fault for botching this up originally, sorry.
Steffen Mueller [Sun, 17 Apr 2011 11:37:27 +0000 (13:37 +0200)]
Lose $Fallback global
Steffen Mueller [Sun, 17 Apr 2011 11:36:22 +0000 (13:36 +0200)]
Lose the $Overload global
Steffen Mueller [Sun, 17 Apr 2011 11:18:13 +0000 (13:18 +0200)]
Remove superfluous global "$errors"
Steffen Mueller [Sun, 17 Apr 2011 11:15:52 +0000 (13:15 +0200)]
Make $FH no longer a global
This is lying of course. It's now in the global $self->{FH},
but this is still the first step to fix its globalness.
Steffen Mueller [Sun, 17 Apr 2011 09:14:22 +0000 (11:14 +0200)]
Fix some error messages
Steffen Mueller [Sat, 16 Apr 2011 14:58:57 +0000 (16:58 +0200)]
Error handling/message improvements
- Move line number calculation to separate method
- Make death/Warn/blurt proper methods
They pretended to be methods all along, but never were.
- Pass XS file name and line no. to typemap parser
... for better error messages from the typemap parser in
case of embedded typemaps
Steffen Mueller [Sat, 16 Apr 2011 14:57:36 +0000 (16:57 +0200)]
Allow overriding line numbers and files while parsing strings
When parsing typemaps from strings, we used to print in-string
line numbers and <string> as the file name. In case of embedded
typemaps in XS code, we really want to refer back to the line
number and name of the XS file. This is now possible.
Steffen Mueller [Sat, 16 Apr 2011 13:39:18 +0000 (15:39 +0200)]
Support for embedded typemaps in XS
This implements embedded typemap documents with a heredoc-like
syntax. In your XS, use a block like the following:
TYPEMAP: <<END
Foo* T_SOMETHING
INPUT
T_SOMETHING
code
END
Steffen Mueller [Sat, 16 Apr 2011 12:57:14 +0000 (14:57 +0200)]
Update docs and exports to be in line with reality
Steffen Mueller [Sat, 19 Feb 2011 16:01:26 +0000 (17:01 +0100)]
check_conditional_preprocessor_statements is not a method
Also, lose some unsightly undef()s.
Steffen Mueller [Sat, 19 Feb 2011 15:55:34 +0000 (16:55 +0100)]
Make get_alias (nee GetAlias) a method
Steffen Mueller [Sat, 19 Feb 2011 15:51:18 +0000 (16:51 +0100)]
Make print_section a method
As with previous changes, checking whether a localization of $_ or
something along those lines is acceptable remains to be done.
Steffen Mueller [Sat, 19 Feb 2011 15:49:24 +0000 (16:49 +0100)]
Transform FOO_handlers to methods
Steffen Mueller [Sat, 19 Feb 2011 15:38:13 +0000 (16:38 +0100)]
More methods (merge_section)
Steffen Mueller [Sat, 19 Feb 2011 15:36:43 +0000 (16:36 +0100)]
Make PushXSStack a method
Steffen Mueller [Sat, 19 Feb 2011 15:34:57 +0000 (16:34 +0100)]
Transform some functions into methods on the proto-object
Steffen Mueller [Sat, 19 Feb 2011 13:02:03 +0000 (14:02 +0100)]
Some simple tests for errors
Steffen Mueller [Sat, 19 Feb 2011 13:01:48 +0000 (14:01 +0100)]
Better error checking/handling
Steffen Mueller [Fri, 18 Feb 2011 21:18:02 +0000 (22:18 +0100)]
Eliminate four unsightly magical hash refs
Previously, we'd be generating and passing around four lookup tables for
C-type to XS-type (type kind), C-type to prototype, XS-type to input map
code, and XS-type to output map code. This is now all handled by
ExtUtils::Typemaps.
Steffen Mueller [Sat, 19 Feb 2011 13:01:25 +0000 (14:01 +0100)]
Make trailing whitespace a newline at all times
Steffen Mueller [Fri, 18 Feb 2011 21:17:50 +0000 (22:17 +0100)]
use warnings
Steffen Mueller [Fri, 18 Feb 2011 20:36:32 +0000 (21:36 +0100)]
Make get_(in|out)putmap more flexible
They now also accept ctypes which are resolved to xstypes via the
typemap section.
Steffen Mueller [Sun, 13 Feb 2011 22:30:56 +0000 (23:30 +0100)]
Add targetable method
This does the same thing for a simple output map as the make_targetable
function in ExtUtils::ParseXS::Utilities does for all output maps. The
latter function is intended to be superseded by this new method.
Steffen Mueller [Sun, 13 Feb 2011 10:22:15 +0000 (11:22 +0100)]
Add comment explaining where terrible code comes from
... and it is not brought by the stork.
Steffen Mueller [Fri, 11 Feb 2011 18:01:18 +0000 (19:01 +0100)]
Document inception of EU::Typemaps
Steffen Mueller [Fri, 11 Feb 2011 17:42:53 +0000 (18:42 +0100)]
Bless singleton
Steffen Mueller [Fri, 11 Feb 2011 17:37:41 +0000 (18:37 +0100)]
Nah, implicit is bad
Steffen Mueller [Fri, 11 Feb 2011 17:35:31 +0000 (18:35 +0100)]
Lose now obsolete process_single_typemap()
This was the actual typemap parser. It is now parsed by
ExtUtils::Typemaps, so we don't need it any more!
Steffen Mueller [Fri, 11 Feb 2011 17:31:44 +0000 (18:31 +0100)]
Make ExtUtils::ParseXS use ExtUtils::Typemaps
This is just the quick'n'dirty conversion to make it use
EU::Typemaps. Eventually, we want to use it in its full object-oriented
goodness!
Steffen Mueller [Sun, 13 Feb 2011 20:00:53 +0000 (21:00 +0100)]
Do not use Carp, fix propagation of replace/skip
Using Carp in a module this early in the toolchain can cause ugly
failure. Carp can trigger loading overload. overload::StrVal can trigger
loading Scalar::Util. Scalar::Util::PP requires B. miniperl doesn't like
loading shared libraries.
This problem with Carp just shadowed the underlying problem that the
replace/skip options weren't propagated correctly.
Steffen Mueller [Sun, 13 Feb 2011 19:22:03 +0000 (20:22 +0100)]
Defer loading main module
Steffen Mueller [Sun, 13 Feb 2011 19:13:45 +0000 (20:13 +0100)]
More whitespace bug-compatibility
Steffen Mueller [Sun, 13 Feb 2011 10:20:03 +0000 (11:20 +0100)]
More compatibility testing
Steffen Mueller [Sat, 12 Feb 2011 17:54:38 +0000 (18:54 +0100)]
Add test of EU::Typemap output against old ParseXS code
This is testing for string equivalency, not code equivalency. But it's
better than nothing.
Steffen Mueller [Sat, 12 Feb 2011 17:52:00 +0000 (18:52 +0100)]
More bug-compatibility with old ExtUtils::ParseXS
Steffen Mueller [Fri, 11 Feb 2011 21:52:30 +0000 (22:52 +0100)]
Reinstate prototype default and warning about invalid prototypes
Steffen Mueller [Fri, 11 Feb 2011 18:24:21 +0000 (19:24 +0100)]
Add method to get ANSIfied code
This is done to all of the code in EU::PXS anyway, so why not
have a nice method for it?
Steffen Mueller [Fri, 11 Feb 2011 17:21:10 +0000 (18:21 +0100)]
Implement 'skip' option for merging typemaps
This implements the 'first come first serve' style merging that
ExtUtils::ParseXS currently does: It prefers the typemap entries that
exist already over new ones. This is because the order of processed
typemaps is such that the default typemaps come last.
Steffen Mueller [Fri, 11 Feb 2011 16:20:17 +0000 (17:20 +0100)]
Implement 'replace' option when merging typemaps
And by proxy, this had to be implemented in the three add_* methods.
Also adds more tests for merging with conflicts.
Steffen Mueller [Fri, 11 Feb 2011 16:09:10 +0000 (17:09 +0100)]
Allow merging typemaps from file
Steffen Mueller [Fri, 11 Feb 2011 15:50:12 +0000 (16:50 +0100)]
Add method to generate the prototype lookup hash
Akin to the methods in the parent commit that generate the lookup hash
for TYPEMAP/INPUT/OUTPUT, this method will generate the lookup has for
typemap's prototypes as required by ExtUtils::ParseXS at this time.
Steffen Mueller [Fri, 11 Feb 2011 15:42:46 +0000 (16:42 +0100)]
Methods to get typemaps in ParseXS compatible format
Essentially, these extra methods export the typemap information in the
format expected by ExtUtils::ParseXS at this time. Down the road, we may
want EU::PXS to simply pass around an ExtUtils::Typemaps object.
Steffen Mueller [Fri, 11 Feb 2011 13:37:33 +0000 (14:37 +0100)]
Reduce code duplication by using the same prototype regexp
Steffen Mueller [Thu, 10 Feb 2011 16:12:23 +0000 (17:12 +0100)]
Teach EU::Typemaps about the _ prototype
I am in a hurry and this makes things correct, but really, this should
maybe use EU::ParseXS' regular expression.
Steffen Mueller [Thu, 10 Feb 2011 15:51:53 +0000 (16:51 +0100)]
Bump ExtUtils::Typemaps version
Just to make sure there really will never be a confusion or
collision with the similarly named module that has been living
on CPAN.
Steffen Mueller [Thu, 10 Feb 2011 15:51:18 +0000 (16:51 +0100)]
Simplify "remove" logic after previous refactoring
Steffen Mueller [Thu, 10 Feb 2011 15:45:29 +0000 (16:45 +0100)]
Hash lookup for output sections
More O(1) for everyone.
Also fixes a tiny issue with an error message from the inputmap
conversion.
Steffen Mueller [Thu, 10 Feb 2011 15:41:09 +0000 (16:41 +0100)]
Convert input sections to hash lookup
Die, O(n), die!
Steffen Mueller [Thu, 10 Feb 2011 15:26:10 +0000 (16:26 +0100)]
Start refactoring EU::Typemaps
Use a hash lookup for avoiding collisions.
Steffen Mueller [Thu, 10 Feb 2011 13:19:54 +0000 (14:19 +0100)]
Remove note about being untested
This code is actually in production use.
Steffen Mueller [Thu, 10 Feb 2011 13:18:57 +0000 (14:18 +0100)]
update copyright
Steffen Mueller [Thu, 10 Feb 2011 13:17:17 +0000 (14:17 +0100)]
Add a trailing 's' to the name of EU::Typemap
This is to prevent collisions on case-insensitive file systems with
lib/typemap.