mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
subrs are now VM trampoline procedures
* libguile/_scm.h: Add foreign.h and programs.h to the private include list, as snarfing subrs with static allocation now needs access to some of their enums and macros. * libguile/gsubr.c (create_gsubr): Instead of creating a tc7_gsubr object, create a VM program with the call-subr opcode, so that the representation of subrs is now gsubrs. CPP and elisp, together at last. (scm_subr_objcode_trampoline): New function, used by the SCM_DEFINE snarf macro. * libguile/gsubr.h (SCM_SUBR_META_INFO, SCM_SUBR_PROPS) (SCM_SET_SUBR_GENERIC_LOC, SCM_SUBR_ARITY_TO_TYPE): Remove these macros. They were never deprecated, but hopefully people aren't using them. (SCM_SUBRF, SCM_SUBR_NAME, SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC): Update to work on the new subr representation. * libguile/objcodes.h (SCM_F_OBJCODE_IS_STATIC): New flag, indicates that the "backing store" of the objcode is statically allocated. * libguile/procprop.c (scm_sym_name): Define here instead of in gsubr.c. * libguile/snarf.h (SCM_DEFINE): If we are doing static allocation, statically allocate the foreign object, the object table, and the program, and use some SCM_SNARF_INITtery to fix things up. Unfortunately I have not been able to make this immutable. It might be possible, though. (SCM_IMMUTABLE_CELL, SCM_STATIC_DOUBLE_CELL, SCM_IMMUTABLE_FOREIGN): (SCM_STATIC_SUBR_OBJVECT, SCM_STATIC_PROGRAM): New helper macros.
This commit is contained in:
parent
97812f4d38
commit
fd12a19a5e
7 changed files with 851 additions and 62 deletions
|
@ -79,6 +79,8 @@
|
|||
#include "libguile/boolean.h" /* Everyone wonders about the truth. */
|
||||
#include "libguile/threads.h" /* You are not alone. */
|
||||
#include "libguile/snarf.h" /* Everyone snarfs. */
|
||||
#include "libguile/foreign.h" /* Snarfing needs the foreign data structures. */
|
||||
#include "libguile/programs.h" /* ... and program.h. */
|
||||
#include "libguile/variable.h"
|
||||
#include "libguile/modules.h"
|
||||
#include "libguile/inline.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue