diff options
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c index 63a58be264c..db6aee9d7b1 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -4102,6 +4102,39 @@ If BASE-DIR is nil use the first entry in `comp-eln-load-path'. */) | |||
| 4102 | concat2 (base_dir, Vcomp_native_version_dir)); | 4102 | concat2 (base_dir, Vcomp_native_version_dir)); |
| 4103 | } | 4103 | } |
| 4104 | 4104 | ||
| 4105 | DEFUN ("comp--install-trampoline", Fcomp__install_trampoline, | ||
| 4106 | Scomp__install_trampoline, 2, 2, 0, | ||
| 4107 | doc: /* Install a TRAMPOLINE for primitive SUBR-NAME. */) | ||
| 4108 | (Lisp_Object subr_name, Lisp_Object trampoline) | ||
| 4109 | { | ||
| 4110 | CHECK_SYMBOL (subr_name); | ||
| 4111 | CHECK_SUBR (trampoline); | ||
| 4112 | Lisp_Object orig_subr = Fsymbol_function (subr_name); | ||
| 4113 | CHECK_SUBR (orig_subr); | ||
| 4114 | |||
| 4115 | /* FIXME: add a post dump load trampoline machinery to remove this | ||
| 4116 | check. */ | ||
| 4117 | if (will_dump_p ()) | ||
| 4118 | signal_error ("Trying to advice unexpected primitive before dumping", | ||
| 4119 | subr_name); | ||
| 4120 | |||
| 4121 | Lisp_Object subr_l = Vcomp_subr_list; | ||
| 4122 | ptrdiff_t i = ARRAYELTS (helper_link_table); | ||
| 4123 | FOR_EACH_TAIL (subr_l) | ||
| 4124 | { | ||
| 4125 | Lisp_Object subr = XCAR (subr_l); | ||
| 4126 | if (EQ (subr, orig_subr)) | ||
| 4127 | { | ||
| 4128 | freloc.link_table[i] = XSUBR (trampoline)->function.a0; | ||
| 4129 | return Qt; | ||
| 4130 | } | ||
| 4131 | i++; | ||
| 4132 | } | ||
| 4133 | signal_error ("Trying to install trampoline for non existent subr", | ||
| 4134 | subr_name); | ||
| 4135 | return Qnil; | ||
| 4136 | } | ||
| 4137 | |||
| 4105 | DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt, | 4138 | DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt, |
| 4106 | 0, 0, 0, | 4139 | 0, 0, 0, |
| 4107 | doc: /* Initialize the native compiler context. Return t on success. */) | 4140 | doc: /* Initialize the native compiler context. Return t on success. */) |
| @@ -5162,6 +5195,7 @@ native compiled one. */); | |||
| 5162 | 5195 | ||
| 5163 | defsubr (&Scomp_el_to_eln_filename); | 5196 | defsubr (&Scomp_el_to_eln_filename); |
| 5164 | defsubr (&Scomp_native_driver_options_effective_p); | 5197 | defsubr (&Scomp_native_driver_options_effective_p); |
| 5198 | defsubr (&Scomp__install_trampoline); | ||
| 5165 | defsubr (&Scomp__init_ctxt); | 5199 | defsubr (&Scomp__init_ctxt); |
| 5166 | defsubr (&Scomp__release_ctxt); | 5200 | defsubr (&Scomp__release_ctxt); |
| 5167 | defsubr (&Scomp__compile_ctxt_to_file); | 5201 | defsubr (&Scomp__compile_ctxt_to_file); |