diff options
| author | Andrea Corallo | 2026-03-12 14:30:54 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2026-03-12 14:30:54 +0100 |
| commit | 6198bb89b453a8b93113ac6bbb102043f5636334 (patch) | |
| tree | 0006eddd65f0a0508be443f1a0cc3f22d437c74f /src/pdumper.c | |
| parent | fe121ef586b4adf2befc7e2af42d65f7acc25891 (diff) | |
| download | emacs-scratch/better-comp.tar.gz emacs-scratch/better-comp.zip | |
nativecomp: optimize local CU calls at speed 2scratch/better-comp
* etc/NEWS: Document speed-2 local call optimization.
* etc/TODO: Remove completed item.
* lisp/emacs-lisp/comp.el
(comp--cu-local-func-c-name-v): New function.
(comp--call-optim-form-call): Enable named local direct calls
at speed 2.
(comp--function-trampoline-form): New helper.
(comp-trampoline-compile, comp-local-function-trampoline-compile):
Share trampoline generation.
* lisp/emacs-lisp/comp-run.el
(comp-local-function-trampoline--install-now): New function.
(comp-local-function-trampoline-install): Install local trampolines.
Defer trampoline compilation until after load.
* src/comp.c (emit_call, emit_ctxt_code, compile_function)
(load_comp_unit, unload_comp_unit): Add local function relocation
support.
(native_comp_local_function_p): New function.
(comp--install-local-function-trampoline): New subr.
(syms_of_comp): Register it and update trampoline docs.
* src/comp.h (Lisp_Native_Comp_Unit): Add local relocation slot.
(native_comp_local_function_p): Declare.
* src/data.c (Ffset): Install local trampolines for redefined
named local native functions. Keep skipping anonymous lambdas.
* src/pdumper.c: Clear local relocation state.
* test/src/comp-tests.el
(comp-tests--run-in-sub-emacs): New helper.
(comp-tests--direct-call-redefinition-form): New helper.
(comp-tests-direct-call-redefinition-speed-split): New test.
(comp-tests-anonymous-lambda-recompile): New test.
(comp-tests-direct-call-with-lambdas): Use an explicit output file.
Diffstat (limited to 'src/pdumper.c')
| -rw-r--r-- | src/pdumper.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pdumper.c b/src/pdumper.c index c21af24d9f1..7108aa64788 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -2960,6 +2960,7 @@ dump_native_comp_unit (struct dump_context *ctx, | |||
| 2960 | START_DUMP_PVEC (ctx, &comp_u->header, struct Lisp_Native_Comp_Unit, out); | 2960 | START_DUMP_PVEC (ctx, &comp_u->header, struct Lisp_Native_Comp_Unit, out); |
| 2961 | dump_pseudovector_lisp_fields (ctx, &out->header, &comp_u->header); | 2961 | dump_pseudovector_lisp_fields (ctx, &out->header, &comp_u->header); |
| 2962 | out->handle = NULL; | 2962 | out->handle = NULL; |
| 2963 | out->local_func_relocs = NULL; | ||
| 2963 | 2964 | ||
| 2964 | dump_off comp_u_off = finish_dump_pvec (ctx, &out->header); | 2965 | dump_off comp_u_off = finish_dump_pvec (ctx, &out->header); |
| 2965 | if (ctx->flags.dump_object_contents) | 2966 | if (ctx->flags.dump_object_contents) |