(cl-defmethod comp-emit-for-top-level ((form byte-to-native-function))
(let* ((name (byte-to-native-function-name form))
(f (gethash name (comp-ctxt-funcs-h comp-ctxt)))
- (args (comp-func-args f))
- (c-name (comp-func-c-name f))
- (doc (comp-func-doc f)))
+ (args (comp-func-args f)))
(cl-assert (and name f))
(comp-emit (comp-call 'comp--register-subr
(make-comp-mvar :constant name)
(make-comp-mvar :constant (if (comp-args-p args)
(comp-args-max args)
'many))
- (make-comp-mvar :constant c-name)
- (make-comp-mvar :constant doc)))))
+ (make-comp-mvar :constant (comp-func-c-name f))
+ (make-comp-mvar :constant (comp-func-doc f))
+ (make-comp-mvar :constant
+ (comp-func-int-spec f))))))
(cl-defmethod comp-emit-for-top-level ((form byte-to-native-top-level))
(let ((form (byte-to-native-top-level-form form)))
static union Aligned_Lisp_Subr Swatch_gc_cons_threshold =
{{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) },
{ .a4 = watch_gc_cons_threshold },
- 4, 4, "watch_gc_cons_threshold", 0, {0}}};
+ 4, 4, "watch_gc_cons_threshold", {0}, {0}, 0}};
XSETSUBR (watcher, &Swatch_gc_cons_threshold.s);
Fadd_variable_watcher (Qgc_cons_threshold, watcher);
static union Aligned_Lisp_Subr Swatch_gc_cons_percentage =
{{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) },
{ .a4 = watch_gc_cons_percentage },
- 4, 4, "watch_gc_cons_percentage", 0, {0}}};
+ 4, 4, "watch_gc_cons_percentage", {0}, {0}, 0}};
XSETSUBR (watcher, &Swatch_gc_cons_percentage.s);
Fadd_variable_watcher (Qgc_cons_percentage, watcher);
}
DEFUN ("comp--register-subr", Fcomp__register_subr,
Scomp__register_subr,
- 5, 5, 0,
+ 6, 6, 0,
doc: /* This gets called by top_level_run during load phase to register
each exported subr. */)
(Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg,
- Lisp_Object c_name, Lisp_Object doc)
+ Lisp_Object c_name, Lisp_Object doc, Lisp_Object intspec)
{
dynlib_handle_ptr handle = xmint_pointer (XCAR (load_handle_stack));
if (!handle)
x->s.min_args = XFIXNUM (minarg);
x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY;
x->s.symbol_name = xstrdup (SSDATA (Fsymbol_name (name)));
- x->s.intspec = NULL;
+ x->s.native_intspec = intspec;
x->s.native_doc = doc;
x->s.native_elisp = true;
defsubr (x);
if (SUBRP (fun))
{
+#ifdef HAVE_NATIVE_COMP
+ if (XSUBR (fun)->native_elisp && XSUBR (fun)->native_intspec)
+ return XSUBR (fun)->native_intspec;
+#endif
const char *spec = XSUBR (fun)->intspec;
if (spec)
return list2 (Qinteractive,
} function;
short min_args, max_args;
const char *symbol_name;
- const char *intspec;
+ union {
+ const char *intspec;
+#ifdef HAVE_NATIVE_COMP
+ Lisp_Object native_intspec;
+#endif
+ };
union {
EMACS_INT doc;
#ifdef HAVE_NATIVE_COMP
static union Aligned_Lisp_Subr sname = \
{{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \
{ .a ## maxargs = fnname }, \
- minargs, maxargs, lname, intspec, {0}}}; \
+ minargs, maxargs, lname, {intspec}, {0}, 0}}; \
Lisp_Object fnname
/* defsubr (Sname);