* libguile/gsubr.c (scm_allocate_subr_code):
(scm_make_subr_from_code): New functions.
(create_subr): Refactor in terms of new functions.
(scm_c_make_gsubr):
(scm_c_define_gsubr):
(scm_c_make_gsubr_with_generic):
(scm_c_define_gsubr_with_generic): Adapt.
* libguile/gsubr.c: Arrange to store flags alongside array of subrs.
One flag indicates the thread should also be passed as the first
argument; another says that the closure should be passed. Should remove
the need for arg shuffling in get_callee_vcode eventually.
(record_subr_name): Make the names be a vector; will integrate better
with precise tracing.
(create_subr): Add flags arg. Adapt callers.
(scm_apply_subr): Allow for passing thread or closure.
* libguile/gsubr-internal.h: Add new interfaces to see whether to pass
closure or thread. Pass thread to scm_apply_subr.
* libguile/jit.c (compile_subr_call): Allow for passing thread or
closure.
* libguile/vm-engine.c (subr_call): Pass thread.