summaryrefslogtreecommitdiff
path: root/embed.h
Commit message (Collapse)AuthorAgeFilesLines
* suidperl goes.Nicholas Clark2009-01-231-28/+2
|
* Bump coopyright year in embed.pl and various files that were just touchedRafael Garcia-Suarez2009-01-021-1/+1
| | | | (and run "make regen")
* Faster sv_utf8_upgrade()karl williamson2009-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider what currently happens when the tokenizer is scanning a string. It looks through it byte-by-byte until it finds a character that forces it to decide to go to utf8. It then calls sv_utf8_upgrade() with the portion of the string scanned so far. sv_utf8_upgrade() starts over from the beginning, and scans the string byte-by-byte until it finds a character that varies between non-utf8 and utf8. It then calls bytes_to_utf8(). bytes_to_utf8() allocates a new string that can handle the worst case expansion, 2n+1, of the entire string, and starts over from the beginning, and scans the input string byte-by-byte copying and converting each character to the output string as it goes. It doesn't return the size of the new string, so sv_utf8_upgrade() assumes it is only as big as what actually got converted, throwing away knowledge of any spare. It then returns to the tokenizer, which immediately does a grow to get space for the unparsed input. This is likely to cause a new string to be allocated and copied from the one we had just created, even if that string in actuality had enough space in it. Thus, the invariant head portion of the string is scanned 3 times, and probably 2 strings will be allocated and copied. My solution to cutting this down is to do several things. First, I added an extra flag for sv_utf8_upgrade that says don't bother to check if the string needs to be converted to utf8, just assume it does. This eliminates one of the passes. I also added a new parameter to sv_utf8_upgrade that says when you return, I want this much unused space in the string. That eliminates the extra grow. This was all done by renaming the current work-horse function from sv_utf8_upgrade_flags to be sv_utf8_upgrade_flags_grow() and making the current function name be a macro which calls the revised one with a 0 grow parameter. I also improved the internal efficiency of sv_utf8_upgrade so that when it does scan the string, it doesn't call bytes_to_utf8, but does the conversion itself, using a fast memory copy instead of the byte-oriented one for the invariant header, and it uses that header to get a better estimate of the needed size of the new string, and it doesn't throw away the knowledge of the allocated size. And, if it is clear without scanning the whole string that the conversion will fit in the already allocated string, it just uses that instead of allocating and copying a new one, using the algorithm I copied from the tokenizer. (In this case it does have to finish scanning the whole string to get the correct size.) The comments have details. It still is byte-oriented. Vectorization et. al. could yield performance improvements. One idea for that is in the comments. The patch also includes a new synonym I created which is a more accurate name than NATIVE_TO_ASCII.
* Add save_adelete()/SAVEADELETE() to save on the stack an array element deleteVincent Pit2008-12-281-0/+2
|
* Proper pluggable Method Resolution Orders. 'c3' is now implemented outside theNicholas Clark2008-12-271-2/+0
| | | | | | core, in ext/mro/mro.xs. Also move mro::_nextcan() to mro.xs. It needs direct access to S_mro_get_linear_isa_c3(), and nothing on CPAN calls it, except via methods defined in mro.pm. Hence all users already require mro;
* Explictly export Perl_mro_meta_init() so that HvMROMETA() can become part of theNicholas Clark2008-12-271-4/+0
| | | | | public API and be used outside the core. However, leave Perl_mro_meta_init() as a private implementation detail.
* Better fix for bug #6665Rafael Garcia-Suarez2008-12-261-1/+1
| | | | | | | | | | Add a parameter to S_incpush to indicate if the new directory should be appended or prepended to @INC, and use it set to TRUE when parsing the shebang line. There is also a better version of the test. This replaces commit ccb8f6a64f3dd06b4360bc27c194b28e6766a6ad.
* Convention seems to be that static definitions are also made visible byNicholas Clark2008-12-011-28/+28
| | | | | || defined(PERL_DECL_PROT), so add this where it is missing. p4raw-id: //depot/perl@34972
* Eliminate setenv_getix()Jerry D. Hedden2008-12-011-10/+0
| | | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510812010947p7df19438kc19c279bcffe4b83@mail.gmail.com> Date: Mon, 1 Dec 2008 12:47:35 -0500 p4raw-id: //depot/perl@34971
* Add S_save_pushptri32ptr() and use it to re-implement Perl_save_hints()Nicholas Clark2008-12-011-0/+14
| | | | | and Perl_save_aelem(). p4raw-id: //depot/perl@34966
* Move the implmentation of SAVEHINTS() into a new Perl_save_hints() inNicholas Clark2008-12-011-0/+6
| | | | | | scope.c. "Inlined" macro functions in scope.h are actually space inefficient. p4raw-id: //depot/perl@34965
* Expose save_pushi32ptr() and implement SAVECOPARYBASE() with it.Nicholas Clark2008-12-011-10/+2
| | | p4raw-id: //depot/perl@34963
* Expose save_pushptrptr() and implement SAVESWITCHSTACK() with it.Nicholas Clark2008-12-011-2/+2
| | | p4raw-id: //depot/perl@34960
* Refactor all of the code of the formNicholas Clark2008-11-301-0/+2
| | | | | | | | | SSCHECK(3); SSPUSHINT(i); SSPUSHPTR(ptr); SSPUSHINT(type); into a static function S_save_pushi32ptr(). p4raw-id: //depot/perl@34959
* Refactor all of the code of the formNicholas Clark2008-11-301-0/+10
| | | | | | | | | | | SSCHECK(3); SSPUSHPTR(ptr1); SSPUSHPTR(ptr2); SSPUSHINT(type); into a static function S_save_pushptrptr(). It might be possible to make some of its callers trivial macros, and so eliminate them as functions. But start with the easy part. p4raw-id: //depot/perl@34957
* Convert all the scope save functions of the formNicholas Clark2008-11-301-14/+2
| | | | | | | | | SSCHECK(2); SSPUSHPTR(o); SSPUSHINT(SAVEt_FREEOP); into a single function Perl_save_pushptr(ptr, type), which the others call. Implement the others as macros. This reduces the object code size. p4raw-id: //depot/perl@34956
* av_fake() isn't in the public API, and isn't used anywhere, so it canNicholas Clark2008-11-271-6/+0
| | | | | go. p4raw-id: //depot/perl@34944
* ywarn() is actually only used inside toke.c, so it can be static.Nicholas Clark2008-11-261-2/+10
| | | p4raw-id: //depot/perl@34941
* setenv_getix() is not used anywhere other than util.c (and the "specialNicholas Clark2008-11-261-4/+4
| | | | | | biologist word for stable" Msql-Mysql-modules-1.2219) so make it static. p4raw-id: //depot/perl@34940
* sv_add_arena() is now only called from sv.c, so it can be static.Nicholas Clark2008-11-261-2/+6
| | | p4raw-id: //depot/perl@34938
* Perl_oopsCV() is not part of the public API, not used anywhere, so canNicholas Clark2008-11-261-6/+0
| | | | | go. p4raw-id: //depot/perl@34937
* rxres_free() and rxres_restore() are only used in pp_ctl.c, so can beNicholas Clark2008-11-261-4/+12
| | | | | static. Macros PUSHSUBST() and POPSUBST() are only viable in PERL_CORE. p4raw-id: //depot/perl@34935
* pmtrans() and refkids() can be static in op.c.Nicholas Clark2008-11-261-4/+16
| | | p4raw-id: //depot/perl@34933
* pidgone() is only used in util.c, so it can be static.Nicholas Clark2008-11-261-4/+4
| | | p4raw-id: //depot/perl@34932
* Merge S_is_gv_magical() into Perl_is_gv_magical_sv().Nicholas Clark2008-11-261-10/+0
| | | p4raw-id: //depot/perl@34931
* pad_reset() is only used in pad.c, so can be static.Nicholas Clark2008-11-261-2/+22
| | | | | Protect the prototype of S_vdie() with #if defined (PERL_IN_UTIL_C) p4raw-id: //depot/perl@34929
* Exactly 1 function, in perl.c, calls Perl_magicname(), so inline it.Nicholas Clark2008-11-261-2/+0
| | | p4raw-id: //depot/perl@34927
* is_gv_magical() is only called from within gv.c.Nicholas Clark2008-11-261-2/+10
| | | p4raw-id: //depot/perl@34926
* ingroup() is only used in doio.c.Nicholas Clark2008-11-261-2/+14
| | | | | Wrap gen_constant_list in #if defined(PERL_IN_OP_C) p4raw-id: //depot/perl@34925
* force_list(), fold_constants() and gen_constant_list() can be static.Nicholas Clark2008-11-261-6/+14
| | | p4raw-id: //depot/perl@34924
* vdie() isn't used anywhere aside from util.c, so it can be static.Nicholas Clark2008-11-261-2/+2
| | | p4raw-id: //depot/perl@34923
* Perl_cv_ckproto() is not part of the public API, and not used anywhereNicholas Clark2008-11-261-2/+0
| | | | | in the core. So it can go. p4raw-id: //depot/perl@34922
* listkids() can be static in op.cNicholas Clark2008-11-261-2/+2
| | | p4raw-id: //depot/perl@34920
* Following on from change 34918, scalarkids() and scalarseq() can alsoNicholas Clark2008-11-261-4/+24
| | | | | be static in op.c, so make it so. p4raw-id: //depot/perl@34919
* "If it's not private, it's public somehow." states Rafael. The mostNicholas Clark2008-11-261-2/+2
| | | | | | reliable way I can see to keep our (unsupported) privates private is to make them static whenever we can. p4raw-id: //depot/perl@34918
* Replace Perl_my() with a small shell script. er. macro.Nicholas Clark2008-11-261-6/+0
| | | p4raw-id: //depot/perl@34917
* Promote Perl_setdefout() to the public API.Nicholas Clark2008-11-241-4/+0
| | | p4raw-id: //depot/perl@34904
* Re: [perl #60360] [PATCH] UPDATED: local $SIG{FOO} = sub {...}; sets signal ↵Chip Salzenberg2008-11-131-2/+2
| | | | | | | | | | | | handler to SIG_DFL Message-ID: <20081112234504.GI2062@tytlal.topaz.cx> Updated patch to retain source compatibility. Plus using the correct PERL_ARGS_ASSERT_SAVE_HELEM_FLAGS macro and running make regen. p4raw-id: //depot/perl@34829
* Re: [perl #60360] [PATCH] local $SIG{FOO} = sub {...}; sets signalChip Salzenberg2008-11-121-3/+3
| | | | | Message-ID: <20081111000040.GB19329@tytlal.topaz.cx> p4raw-id: //depot/perl@34819
* Update copyright year in embed.pl, and everything that it builds.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34586
* Run 'make regen' for #34567 and #34568.Marcus Holland-Moritz2008-10-241-0/+10
| | | p4raw-id: //depot/perl@34569
* Re: [5.8] Change 33727 (op.c) breaks constant folding in "elsif"Vincent Pit2008-09-131-0/+2
| | | | | Message-ID: <48CAF79A.6000001@profvince.com> p4raw-id: //depot/perl@34358
* S_isa_lookup() no longer recurses (as of Brandon's MRO changes), so weNicholas Clark2008-09-111-1/+1
| | | | | don't need to pass in name_stash as a parameter. p4raw-id: //depot/perl@34349
* Add Perl_croak_xs_usage(), which reduces a lot of explicit calls ofNicholas Clark2008-05-211-0/+2
| | | | | | | the form Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow"); down to croak_xs_usage(cv, "eee_yow"); and refactor all the core XS code to use it. This adds () to the error messages for attributes::* p4raw-id: //depot/perl@33901
* Double magic/warnings with binmode $fh, undefVincent Pit2008-04-301-1/+1
| | | | | | From: "Vincent Pit" <perl@profvince.com> Message-ID: <63615.92.128.97.94.1209490401.squirrel@92.128.97.94> p4raw-id: //depot/perl@33766
* /* This code tries to figure out just what went wrong withNicholas Clark2008-04-171-0/+2
| | | | | | | | | | | gv_fetchmethod. It therefore needs to duplicate a lot of the internals of that function. "Duplicate". <snigger>. You said a naughty word. Now sanitised. [All tests pass, but I'm not 100% confident that this code is equivalent in all reachable corner cases, and it may be possible to simplify the error reporting logic now in gv_fetchmethod_flags] p4raw-id: //depot/perl@33702
* Perl_store_cop_label() isn't meant to be part of the public API.Nicholas Clark2008-04-141-0/+2
| | | | | | (global.sym had been inconsistent with embed.fnc, but it turns out that global.sym was actually correct.) p4raw-id: //depot/perl@33677
* Split out S_refcounted_he_new_common() fromNicholas Clark2008-04-071-2/+10
| | | | | | | | | Perl_refcounted_he_new_common(), so that Perl_store_cop_label() can call it without needing to create two temporary SVs. Use it in newSTATEOP() and eliminate the two temporary SVs. Make Perl_fetch_cop_label() more defensive by not assuming that the value for ":" is always a PV. Remove its "compatibility" macro. p4raw-id: //depot/perl@33657
* Eliminate cop_label from struct cop by storing a label as the firstNicholas Clark2008-04-071-0/+2
| | | | | | entry in the hints hash. Most statements don't have labels, so this will save memory. Not sure how much. p4raw-id: //depot/perl@33656
* Define sv_insert() as a wrapper to sv_insert_flags(), and moveNicholas Clark2008-04-011-2/+0
| | | | | Perl_sv_insert() to mathoms.c p4raw-id: //depot/perl@33627