summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2020-03-03 00:45:05 +0100
committerKarl Williamson <khw@cpan.org>2020-03-09 07:55:49 -0600
commit044d25c73ce10d2b29008b875209d414303ccff7 (patch)
tree26ad09e5baa999baf53f72a2025f63212943e377 /embed.fnc
parent433b3e2b7846f8a9c2506397c0b4d1394bf7700d (diff)
downloadperl-044d25c73ce10d2b29008b875209d414303ccff7.tar.gz
optimize sort by inlining comparison functions
This makes special-cased forms such as sort { $b <=> $a } even faster. Also, since this commit removes PL_sort_RealCmp, it fixes the issue with nested sort calls mentioned in gh #16129
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc21
1 files changed, 15 insertions, 6 deletions
diff --git a/embed.fnc b/embed.fnc
index 1a46fa16da..4386da6aed 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2879,17 +2879,26 @@ i |HV* |opmethod_stash |NN SV* meth
#endif
#if defined(PERL_IN_PP_SORT_C)
-S |I32 |sv_ncmp |NN SV *const a|NN SV *const b
-S |I32 |sv_i_ncmp |NN SV *const a|NN SV *const b
-S |I32 |amagic_ncmp |NN SV *const a|NN SV *const b
-S |I32 |amagic_i_ncmp |NN SV *const a|NN SV *const b
-S |I32 |amagic_cmp |NN SV *const str1|NN SV *const str2
+I |I32 |sv_ncmp |NN SV *const a|NN SV *const b
+I |I32 |sv_ncmp_desc |NN SV *const a|NN SV *const b
+I |I32 |sv_i_ncmp |NN SV *const a|NN SV *const b
+I |I32 |sv_i_ncmp_desc |NN SV *const a|NN SV *const b
+I |I32 |amagic_ncmp |NN SV *const a|NN SV *const b
+I |I32 |amagic_ncmp_desc |NN SV *const a|NN SV *const b
+I |I32 |amagic_i_ncmp |NN SV *const a|NN SV *const b
+I |I32 |amagic_i_ncmp_desc |NN SV *const a|NN SV *const b
+I |I32 |amagic_cmp |NN SV *const str1|NN SV *const str2
+I |I32 |amagic_cmp_desc |NN SV *const str1|NN SV *const str2
+I |I32 |cmp_desc |NN SV *const str1|NN SV *const str2
# ifdef USE_LOCALE_COLLATE
-S |I32 |amagic_cmp_locale|NN SV *const str1|NN SV *const str2
+I |I32 |amagic_cmp_locale |NN SV *const str1|NN SV *const str2
+I |I32 |amagic_cmp_locale_desc|NN SV *const str1|NN SV *const str2
+I |I32 |cmp_locale_desc|NN SV *const str1|NN SV *const str2
# endif
S |I32 |sortcv |NN SV *const a|NN SV *const b
S |I32 |sortcv_xsub |NN SV *const a|NN SV *const b
S |I32 |sortcv_stacked |NN SV *const a|NN SV *const b
+I |void |sortsv_flags_impl |NULLOK SV** array|size_t num_elts|NN SVCOMPARE_t cmp|U32 flags
#endif
#if defined(PERL_IN_PP_SYS_C)