summaryrefslogtreecommitdiff
path: root/perl.c
Commit message (Collapse)AuthorAgeFilesLines
* full API for cop hint hashesZefram2010-10-211-2/+2
| | | | | | | | | | | | | Expose cop hint hashes as a type COPHH, with a cophh_* API which is a macro layer over the refcounted_he_* API. The documentation for cophh_* describes purely API-visible behaviour, whereas the refcounted_he_* documentation describes the functions mainly in terms of the implementation. Revise the cop_hints_* API, using the flags parameter consistently and reimplementing in terms of cophh_*. Use the cophh_* and cop_hints_* functions consistently where appropriate. [Modified by the committer to update two calls to Perl_refcounted_he_fetch recently added to newPMOP.]
* add lex_start to the APIZefram2010-10-211-1/+1
| | | | | lex_start() is added to the API, marked experimental, and documented. It also gains a flags parameter for foreseeable future use.
* replace PL_doextract with better kinds of variableZefram2010-10-211-18/+15
| | | | | | | | PL_doextract had two unrelated jobs, neither best served by an interpreter global variable. The first was to track the -x command-line switch. That is replaced with a local variable in S_parse_body(). The second was to track whether the lexer is in the middle of a =pod section. That is replaced with an element in PL_parser.
* remove filter inheritance option from lex_startZefram2010-10-211-1/+1
| | | | | | | | The only uses of lex_start that had the new_filter parameter false, to make the new lexer context share source filters with the previous lexer context, were uses with rsfp null, which therefore never invoked source filters. Inheriting source filters from a logically unrelated file seems like a silly idea anyway.
* Create populate_isa() to de-duplicate logic to populate @ISA.Nicholas Clark2010-10-091-9/+38
| | | | | | | Previously yylex() was conditionally populating @AnyDBM_File::ISA (if it was not set, and the token dbmopen was seen), and init_predump_symbols() was populating @IO::File::ISA (unconditionally, but this is so early that nothing previously could have set it). This refactoring eliminates code duplication.
* eval_sv: followup fix to 4aca2f62efDavid Mitchell2010-10-031-4/+5
| | | | | My original fix broke the 'goto redo_body' path. Not that anything tests for this!
* better documentation for eval_sv() and G_KEEPERRDavid Mitchell2010-10-031-1/+2
|
* eval_sv() and eval_pv() don't fail on syntax errDavid Mitchell2010-10-031-7/+6
| | | | | | [perl #3719] eval_sv("some syntax err") cleared $@ and didn't return a failure indication. This also affected eval_pv() which calls eval_sv(). Fix this and add lots of tests.
* call defout/stderr destructors lastDavid Mitchell2010-09-201-5/+0
| | | | | | | | When calling the destructors for IO objects embedded in arena GVs, process PL_defoutgv and PL_stderrgv last. Yes, the test suite expects STDOUT to still work at this point. Indeed, one test in ref.t calls print from STDOUT's destructor (which is why pp_print needed a slight tweak to handle a null GV properly).
* fix PL_psig_pend freeingDavid Mitchell2010-09-201-2/+0
| | | | | | Commit 31c91b4357905486e81f901ad079da5735bdb7ba added a block of code to free PL_psig_pend in a signal-safe way, but omitted to remove the original unsafe freeing code above it. Removed with this commit.
* [perl #40388] perl_destruct() leaks PL_main_cvDavid Mitchell2010-09-201-0/+4
| | | | Well yes, it does, kinda; but it's harmless. Add a comment to that effect.
* [perl #40389] perl_destruct() leaks PL_defstashDavid Mitchell2010-09-201-0/+2
| | | | | | | | | | | | | | | | | With PERL_DESTRUCT_LEVEL >= 1, PL_defstash is explicitly freed, but doesn't actually get freed at that point due to a reference loop between %:: and *::. Break that loop to ensure that PL_defstash gets freed at that point. Actually, its not as serious as it sounds, as it would get freed a bit later anyway by sv_clean_all(), but this new way has these benefits: * it gets freed where you expect it to be * it gets freed cleanly, rather than by the more brutal sv_clean_all() (which can leave dangling pointers to freed SVs) * since its freed while *not* under the influence of PL_in_clean_all = TRUE, it's more likely to flag up bugs related to double-freeing etc. Indeed, the two previous commits to this are a result of that.
* function interface to parse Perl statementZefram2010-09-061-1/+1
| | | | | | | | | | | | | yyparse() becomes reentrant. The yacc stack and related resources are allocated in yyparse(), rather than in lex_start(), and they are localised to yyparse(), preserving their values from any outer parser. yyparse() now takes a parameter which determines which production it will parse at the top level. New API function parse_fullstmt() uses this facility to parse just a single statement. The top-level single-statement production that is used for this then messes with the parser's head so that the parsing stops without seeing EOF, and any lookahead token seen after the statement is pushed back to the lexer.
* PL_my_cxt_list is only available with PERL_IMPLICIT_CONTEXTTony Cook2010-09-011-0/+2
|
* PL_my_cxt_list leaksJirka Hruška2010-09-011-0/+4
| | | | | | [perl #77352] PL_my_cxt_list was never freed
* Remove CALL_FPTR and CPERLscope.Ben Morrow2010-08-201-1/+1
| | | | | | | | | | | | | | | | These are left from PERL_OBJECT, which was an implementation of multiplicity using C++ objects. PERL_OBJECT was removed in 5.8, but the macros seem to have been cargo-culted all over the core (including in places where they would have been inappropriate originally). Since they now do exactly nothing, it's cleaner to remove them. I have left the definitions in perl.h, under #ifndef PERL_CORE, since some CPAN XS code uses them (also often incorrectly). I have also left STATIC alone, since it seems potentially more useful and is much more ingrained. The only appearance of these macros this patch doesn't touch is in Devel-PPPort, because that's a CPAN module.
* For both opmini.o and perlmini.o define PERL_EXTERNAL_GLOB and PERL_IS_MINIPERLNicholas Clark2010-08-161-0/+3
| | | | | | Previously only opmini.o was compiled with -DPERL_EXTERNAL_GLOB, and only perlmini.o with -DPERL_IS_MINIPERL. Add "PERL_EXTERNAL_GLOB" to the output of (mini)perl -V if it is defined.
* DEBUG_LEAKING_SCALARS: add sv_debug_parentDavid Mitchell2010-08-011-2/+3
| | | | | Rather than just recording whether an SV was cloned (sv->sv_debug_cloned), record the address of the SV we were cloned from.
* Check API compatibility when loading xs modulesFlorian Ragwitz2010-07-261-0/+2
| | | | | | | | | | | | | This adds PL_apiversion, allowing the API version of a running interpreter to be introspected. It is used in the new XS_APIVERSION_BOOTCHECK macro, which is added to the _boot function of every XS module, to compare it against the API version the module has been compiled against. If the versions do not match, an exception is thrown. This doesn't fully prevent binary incompatible extensions to be loaded. It merely compares PERL_API_* between compile- and runtime, and does not attempt to solve the problem of identifying binary incompatible perls with the same API version (i.e. the same perl version configured with and without DEBUGGING).
* Add Perl_init_dbargs(), to set up @DB::args without losing SV references.Nicholas Clark2010-07-211-3/+18
|
* Remove -w recommendation in perl -hDavid Golden2010-06-071-1/+1
| | | | | | | | | Abigail already said it best: I do not think 'perl -h' is the place to give recommendations on how code should be written. 'perl -h' gives a list and a brief explanation of the command line switches. IMO, it should do just that, and nothing else.
* When assigning to $^P, don't zero $DB::single, $DB::trace and $DB::signal.Nicholas Clark2010-05-291-3/+6
| | | | | | | Previously, whenever a true value was assigned to $^P, all 3 were set to 0. Now only set them to 0 if they aren't already SvIOK(). Resolves RT #72422.
* Make HvFILL() count the allocated buckets, instead of reading a stored value.Nicholas Clark2010-05-211-1/+0
| | | | | Add a function Perl_hv_fill to perform the count. This will save 1 IV per hash, and on some systems cause struct xpvhv to become cache aligned.
* unwinding target nominated by separate globalZefram2010-04-251-0/+4
| | | | | | | | When unwinding due to die, the new global PL_restartjmpenv points to the JMP_ENV at which longjmping should stop and control should be transferred to PL_restartop. This replaces the previous use of cxstack[cxstack_ix+1].blk_eval.cur_top_env, located in a nominally-discarded context frame.
* In Perl_get_debug_opts(), restructure the message into fewer string literals.Nicholas Clark2010-04-171-26/+26
| | | | This reduces the object code size slightly.
* In S_usage(), restructure the storage of the help message into fewer literals.Nicholas Clark2010-04-171-36/+36
| | | | This reduces the object code size slightly.
* revert "revert perl -h changes"David Golden2010-04-131-2/+6
| | | | | Reapplies commit 482d21b3db741a7f6b59279ab7ad289307e2186b that was reverted in commit bb87c82accf79d3e15da7fc9b646232a4c2bd47c
* Fix comments about @INC orderingRafael Garcia-Suarez2010-03-081-2/+2
|
* revert perl -h changesDavid Golden2010-02-111-6/+2
|
* keep -h to 80 characters or lessDavid Golden2010-02-101-2/+2
|
* Help new users learn how to get helpDavid Golden2010-02-101-0/+4
|
* Improvements to 31c9a3 - CPAN code did depend on the previous behaviour of ↵Nicholas Clark2010-02-061-0/+24
| | | | | | | | | | | | | | | | | | | blessing filehandles into FileHandle It turns out that it's not quite as simple as blessing into IO::File. If you do (just) that, then it breaks any existing code that does C<require IO::Handle;> to allow it to call methods on file handles, because they're blessed into IO::File, which isn't loaded. (Note this code doesn't assume that methods in IO::Seekable are there to be called) So, it all should work if you also set @IO::File:::ISA correctly? That way, code that assumes that methods from IO::Handle can be called will work. However, gv.c now starts complaining (but not failing) if IO::Handle, IO::Seekable and Exporter aren't present, because it goes looking for methods in them. So the solution seems to be to set @IO::File::ISA *and* create (empty) stashes for the other 3 packages. Patch appended, but not applied.
* Add USE_PERL_ATOF to the list of -V's compile-time options.Nicholas Clark2010-01-211-0/+3
|
* Changed Copyright year as suggested by karl williamson in ↵Abigail2010-01-131-2/+3
| | | | http://nntp.perl.org/group/perl.perl5.porters/155493
* include sv_debug_serial field in debugging outputDavid Mitchell2010-01-081-2/+3
|
* Sort the initialisers to non_bincompat_options[], and fix a whitespace "error".Nicholas Clark2010-01-051-4/+4
|
* Add USE_ATTRIBUTES_FOR_PERLIO to the list of -V's compile-time options.Nicholas Clark2010-01-051-0/+3
|
* Free the PL_scopestack_nameGerard Goossen2009-12-181-0/+3
| | | | | | | | | | | | | Free the PL_scopestack_name Gerard Goossen From 4652807944b1b7efc8a66b3fe8d7562d23a2189f Mon Sep 17 00:00:00 2001 From: Gerard Goossen <gerard@ggoossen.net> Date: Fri, 18 Dec 2009 15:09:49 +0100 Subject: [PATCH 2/2] Free the PL_scopestack_name Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
* Correct some #ifdef USE_ITHREADS / USE_MULTIMax Maischein2009-12-171-2/+0
|
* Silence Win32 compiler warningNicholas Clark2009-12-041-1/+1
| | | | | | | Subject: Re: Smoke [5.11.2] v5.11.2-105-gc2123ae FAIL(F) MSWin32 Win2000 SP4 (x86/1 cpu) Message-ID: <20091204140536.GD2582@plum.flirble.org> (amended to fix the obvious typo)
* Change perl -v version formatDavid Golden2009-11-141-3/+5
| | | | | | | | | | | | | | | | | | New format: This is perl 5, version 11, subversion 1 (v5.11.1) ... The rationale for this change is that the Perl 5 interpreter will never increment PERL_REVISION from 5 to 6, so we want people to start focusing on the PERL_VERSION number as most significant and PERL_SUBVERSION as equivalent to a "release number". In other words, "perl 5" is a language, this is the 11th version of it, and the second release of that version (counting from zero). Among other things, this makes the output of -v and -V more consistent. The old v-string style is included for familiarity and usage in code. For builds from git, it will include the same extended format as it did before, e.g. "(v5.11.1-176-gaf24cc9*)"
* Add ENTER_with_name and LEAVE_with_name to automaticly check for matching ↵Gerard Goossen2009-11-121-0/+3
| | | | ENTER/LEAVE when debugging is enabled
* Make my_exit behave the same as the Perl exit. And add tests for itGerard Goossen2009-11-081-14/+0
| | | | | | | Rationale: This makes the behaviour of my_exit consistent, so it no longer depends on whether a subroutine was called using call_sv or as a normal using an entersub op. Previously, the exit code was sometimes converted to an exception.
* Add assertions about there being no leftover scopes when enter perl_destruct.Gerard Goossen2009-11-081-0/+3
|
* Add a line directive to op.c and perl.c such that error messages refer to ↵Gerard Goossen2009-11-061-0/+1
| | | | the original files insted of to the copied files perlmini.c and opmini.c
* Add Perl_ck_warner_d(), which combines Perl_ckwarn_d() and Perl_warner().Nicholas Clark2009-10-121-11/+11
| | | | | Replace ckWARN_d{,2,3,4}() && Perl_warner() with it, which trades reduced code size for 1 more function call if warnings are not enabled.
* Add Perl_ck_warner(), which combines Perl_ckwarn() and Perl_warner().Nicholas Clark2009-10-121-3/+2
| | | | | | | Replace ckWARN{,2,3,4}() && Perl_warner() with it, which trades reduced code size (about 0.2%), for 1 more function call if warnings are not enabled. However, if we're now in the L1 or L2 cache when we weren't previously, that's still going to be a speed win.
* In Perl_moreswitches(), merge 2 string constants in the code implementing -v.Nicholas Clark2009-10-051-3/+2
|
* $^O is initalised to OSNAME, so no need to return the latter from Internals::V.Nicholas Clark2009-10-051-3/+1
| | | | Saves having object code to build one SV that Config::_V can find out by itself.
* Move initialising PL_osname from S_init_predump_symbols to perl_construct().Nicholas Clark2009-10-051-3/+2
|