diff options
| author | Mattias EngdegÄrd | 2022-03-21 11:20:37 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-04-04 09:49:31 +0200 |
| commit | f365607bc059169e5aa9f98c8418661d6fc6477d (patch) | |
| tree | 314277594e4d2eed8c9deb3ffd0cfe67820cf45e /src/eval.c | |
| parent | 530f163a7f4f1f0ead119b8d3c3dd9fa882af9b2 (diff) | |
| download | emacs-f365607bc059169e5aa9f98c8418661d6fc6477d.tar.gz emacs-f365607bc059169e5aa9f98c8418661d6fc6477d.zip | |
Inline call0..8
Inlining these trivial functions gives a healthy speed boost to many
common functions such as `sort`, `mapcar` etc.
* src/eval.c (call0, ..., call8): Move functions...
* src/lisp.h (call0, ..., call8): ...here and declare them inline.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/eval.c b/src/eval.c index 7269582333c..a1cebcd0257 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2766,76 +2766,6 @@ apply1 (Lisp_Object fn, Lisp_Object arg) | |||
| 2766 | return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg); | 2766 | return NILP (arg) ? Ffuncall (1, &fn) : CALLN (Fapply, fn, arg); |
| 2767 | } | 2767 | } |
| 2768 | 2768 | ||
| 2769 | /* Call function fn on no arguments. */ | ||
| 2770 | Lisp_Object | ||
| 2771 | call0 (Lisp_Object fn) | ||
| 2772 | { | ||
| 2773 | return Ffuncall (1, &fn); | ||
| 2774 | } | ||
| 2775 | |||
| 2776 | /* Call function fn with 1 argument arg1. */ | ||
| 2777 | Lisp_Object | ||
| 2778 | call1 (Lisp_Object fn, Lisp_Object arg1) | ||
| 2779 | { | ||
| 2780 | return CALLN (Ffuncall, fn, arg1); | ||
| 2781 | } | ||
| 2782 | |||
| 2783 | /* Call function fn with 2 arguments arg1, arg2. */ | ||
| 2784 | Lisp_Object | ||
| 2785 | call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) | ||
| 2786 | { | ||
| 2787 | return CALLN (Ffuncall, fn, arg1, arg2); | ||
| 2788 | } | ||
| 2789 | |||
| 2790 | /* Call function fn with 3 arguments arg1, arg2, arg3. */ | ||
| 2791 | Lisp_Object | ||
| 2792 | call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) | ||
| 2793 | { | ||
| 2794 | return CALLN (Ffuncall, fn, arg1, arg2, arg3); | ||
| 2795 | } | ||
| 2796 | |||
| 2797 | /* Call function fn with 4 arguments arg1, arg2, arg3, arg4. */ | ||
| 2798 | Lisp_Object | ||
| 2799 | call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, | ||
| 2800 | Lisp_Object arg4) | ||
| 2801 | { | ||
| 2802 | return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4); | ||
| 2803 | } | ||
| 2804 | |||
| 2805 | /* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5. */ | ||
| 2806 | Lisp_Object | ||
| 2807 | call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, | ||
| 2808 | Lisp_Object arg4, Lisp_Object arg5) | ||
| 2809 | { | ||
| 2810 | return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5); | ||
| 2811 | } | ||
| 2812 | |||
| 2813 | /* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6. */ | ||
| 2814 | Lisp_Object | ||
| 2815 | call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, | ||
| 2816 | Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6) | ||
| 2817 | { | ||
| 2818 | return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6); | ||
| 2819 | } | ||
| 2820 | |||
| 2821 | /* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7. */ | ||
| 2822 | Lisp_Object | ||
| 2823 | call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, | ||
| 2824 | Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7) | ||
| 2825 | { | ||
| 2826 | return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7); | ||
| 2827 | } | ||
| 2828 | |||
| 2829 | /* Call function fn with 8 arguments arg1, arg2, arg3, arg4, arg5, | ||
| 2830 | arg6, arg7, arg8. */ | ||
| 2831 | Lisp_Object | ||
| 2832 | call8 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, | ||
| 2833 | Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7, | ||
| 2834 | Lisp_Object arg8) | ||
| 2835 | { | ||
| 2836 | return CALLN (Ffuncall, fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); | ||
| 2837 | } | ||
| 2838 | |||
| 2839 | DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0, | 2769 | DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0, |
| 2840 | doc: /* Return t if OBJECT is a function. */) | 2770 | doc: /* Return t if OBJECT is a function. */) |
| 2841 | (Lisp_Object object) | 2771 | (Lisp_Object object) |