summaryrefslogtreecommitdiff
path: root/embed.fnc
Commit message (Collapse)AuthorAgeFilesLines
* Merge Perl_magic_setisa() and Perl_magic_clearisa(), to remove duplicated logic.Nicholas Clark2009-05-211-1/+1
|
* Merge the bulk of Perl_magic_clearsig() into Perl_magic_setsig().Nicholas Clark2009-05-201-1/+1
| | | | | | | | | | | | The comment at the top of Perl_magic_clearsig() said: XXX Some of this code was copied from Perl_magic_setsig. A little refactoring might be in order. and it was not wrong. Perl_magic_clearsig() is almost equivalent to Perl_magic_setsig() with the new signal handler as "DEFAULT". Externally, the sv parameter to Perl_magic_setsig() was Not NULL, so use a NULL sv to signal that the code is being called as Perl_magic_clearsig(), for the places where the behaviour of the two diverges.
* Add S_sv_dup_inc_multiple(), used in place of loops that call sv_dup_inc().Nicholas Clark2009-05-181-0/+4
| | | | Just 4 uses already give a size saving with gcc -Os.
* Inline S_glob_2pv() into Perl_sv_2pv_flags(). (Existing bugs included.)Nicholas Clark2009-05-121-1/+0
| | | | Change 27942 missed this. (675c862fe1d4abfd048dce5f1958cca54b16c501)
* Convert xsutils.c and lib/attributes.pm to a regular XS extension.Nicholas Clark2009-04-121-2/+0
|
* Change Perl_newCONSTSUB() so that a NULL sv generates an empty list return.Nicholas Clark2009-03-291-1/+1
| | | | Don't call DESTROY if it's a constant subroutine.
* In Perl_newCONSTSUB(), sv should not be NULL.Nicholas Clark2009-03-291-1/+1
|
* In Perl_sv_setsv_cow(), dstr can be NULL.Nicholas Clark2009-03-281-1/+1
|
* For S_incpush(), dir is never NULL, and len is always > 0.Nicholas Clark2009-02-221-1/+1
|
* Optimise S_incpush() by avoiding repeatedly copying libdir to subdir.Nicholas Clark2009-02-221-1/+1
| | | | | | | | | Specifically, copy it once with newSVsv(), then pass libdir to S_incpush_if_exists(), and if that creates a new SV, use newSVsv() there to re-do the copy. Otherwise reset the length of the passed-in SV (which is subdir), back to the length of libdir, effectively truncating it back to be equal to libdir. This avoids repeated copying of the same bytes over the same memory that already holds those bytes.
* Unwind the implicit loop in S_init_perllib(), by writing the code out longhand.Nicholas Clark2009-02-221-1/+1
| | | | | Call it only once, remove the old_vers parameter, and all the related conditional code.
* Pass the length of the string to S_incpush_use_sep(), where known.Nicholas Clark2009-02-171-1/+1
|
* Ensure that the pointer to S_incpush_use_sep() is never NULL.Nicholas Clark2009-02-151-1/+1
|
* Loop in S_init_perllib(), only calling S_incpush*() with INCPUSH_ADD_OLD_VERSNicholas Clark2009-02-151-1/+1
| | | | | | | | | | | the second time (and only for those entries at had it). Implement the loop by calling init_perllib() twice, to avoid a rats nest of re-indenting. Add a new flag to S_incpush() INCPUSH_NOT_BASEDIR, to supress pushing the base directory a second time on the secnod call. With this change, re-ordering of @INC from version-orientated to prefix- orientated is partly complete. ARCHLIB and PRIVLIB remain at their old place in the @INC order.
* Refactor the separator splitting loop of S_incpush() into a S_incpush_use_sep().Nicholas Clark2009-02-151-1/+3
| | | | | | Add a parameter to S_incpush() to optionally pass in the length. As S_incpush() treats the directory parameter as const char, remove some malloc()s elsewhere that were copying data on the assumption that it was not const safe.
* Refactor S_incpush() to take 1 flags parameter, instead of 5 positional booleansNicholas Clark2009-02-151-1/+1
| | | | (which are impossible to remember).
* For -I, need to also unshift version and architecture libs onto @INC (RT#6665)Nicholas Clark2009-02-151-1/+1
| | | | (20189146be79a0596543441fa369c6bf7f85103f only added the given directory.)
* suidperl goes.Nicholas Clark2009-01-231-18/+1
|
* Update the documentation of get_sv() to note that it calls Perl_gv_fetchpv(),Nicholas Clark2009-01-211-1/+1
| | | | | and hence the 'create' argument is actually 'flags'. Fix core code and documentation that used TRUE or FALSE to use 0 or GV_ADD.
* Update the documentation of get_av() to note that it calls Perl_gv_fetchpv(),Nicholas Clark2009-01-211-1/+1
| | | | | and hence the 'create' argument is actually 'flags'. Fix code and documentation that used TRUE or FALSE to use 0 or GV_ADD.
* Update the documentation of get_hv() to note that it calls Perl_gv_fetchpv(),Nicholas Clark2009-01-211-1/+1
| | | | | and hence the 'create' argument is actually 'flags'. Fix code and documentation that used TRUE or FALSE to use 0 or GV_ADD.
* Changing get_isa_hash() to static means that it needs to be wrapped inNicholas Clark2009-01-031-1/+1
| | | | an #if defined(PERL_IN_UNIVERSAL_C).
* get_isa_hash() is only used in S_isa_lookup(), so it can be static. Also, it hasNicholas Clark2009-01-031-2/+1
| | | | | never been in a released version of perl, so this change has no compatibility implications.
* Faster sv_utf8_upgrade()karl williamson2009-01-021-1/+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/+1
|
* Break out the set-the-MRO logic from the XS_mro_set_mro into Perl_mro_set_mro(),Nicholas Clark2008-12-271-0/+2
| | | | which can be called from C code (such as the guts of extensions).
* Proper pluggable Method Resolution Orders. 'c3' is now implemented outside theNicholas Clark2008-12-271-1/+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-2/+2
| | | | | public API and be used outside the core. However, leave Perl_mro_meta_init() as a private implementation detail.
* Add Perl_mro_register() to register Method Resolution Orders,Nicholas Clark2008-12-271-0/+2
| | | | | | Perl_mro_get_from_name() to retrieve MROs by name, and PL_registered_mros to store them in. Abolish the static array of mros, and instead register the dfs and c3 MRO structures.
* Repurpose struct mro_meta to allow it to store cached linear ISA for arbitaryNicholas Clark2008-12-271-0/+5
| | | | | | | method resolution orders. mro_linear_dfs becomes a hash holding the different MROs' private data. mro_linear_c3 becomes a shortcut pointer to the current MRO's private data.
* Remove "b" flag for sv_utf8_upgrade_nomg in embed.fncRafael Garcia-Suarez2008-12-271-1/+1
| | | | | This is only a macro, without a Perl_ implementation. Hopefully this fixes the Win32 build.
* Update comments and documentation dealing with utfKarl2008-12-261-0/+1
|
* 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.
* It looks like the previous patch is working fine on UNIXish boxes,Steve Peters2008-12-191-1/+0
| | | | | but is failing on Windows. Anyways sv_utf8_upgrade_nomg() is a macro anyways, so moving the documentation to sv.h.
* Subject: PATCH 5.10 documentationSteve Peters2008-12-191-0/+1
| | | | | | From: karl williamson <public@khwilliamson.com> Date: Tue, 16 Dec 2008 16:00:34 -0700 Message-ID: <49483312.80804@khwilliamson.com>
* Silence a compiler warning introduced by 34963Steve Hay2008-12-021-1/+1
| | | p4raw-id: //depot/perl@34982
* Convention seems to be that static definitions are also made visible byNicholas Clark2008-12-011-14/+14
| | | | | || defined(PERL_DECL_PROT), so add this where it is missing. p4raw-id: //depot/perl@34972
* Eliminate setenv_getix()Jerry D. Hedden2008-12-011-3/+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/+4
| | | | | 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/+1
| | | | | | 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-3/+2
| | | p4raw-id: //depot/perl@34963
* Expose save_pushptrptr() and implement SAVESWITCHSTACK() with it.Nicholas Clark2008-12-011-2/+3
| | | p4raw-id: //depot/perl@34960
* Refactor all of the code of the formNicholas Clark2008-11-301-0/+1
| | | | | | | | | 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/+4
| | | | | | | | | | | 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-5/+6
| | | | | | | | | 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
* S_mro_get_linear_isa_*() should have an *un*signed level.Nicholas Clark2008-11-271-2/+2
| | | | | [Unless it's a signed concept, use an usigned type.] p4raw-id: //depot/perl@34948
* av_fake is undead. :-(Nicholas Clark2008-11-271-1/+0
| | | | | Hopefully it will get the message this time. p4raw-id: //depot/perl@34947
* Note (hopefully) all the use cases of all the rest of the non-public butNicholas Clark2008-11-271-14/+39
| | | | | exported APIs. p4raw-id: //depot/perl@34946
* av_fake() isn't in the public API, and isn't used anywhere, so it canNicholas Clark2008-11-271-1/+0
| | | | | go. p4raw-id: //depot/perl@34944
* Note where (nearly) all the other private non-static functions are used.Nicholas Clark2008-11-261-1/+147
| | | p4raw-id: //depot/perl@34942