diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-16 21:34:56 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-16 21:34:56 -0700 |
commit | ba498170706db2c1a53dc3427c584dd74230deef (patch) | |
tree | 57ea36d9d2c5e1faa9b808b26064769337f9a3b1 /gc.c | |
parent | ef95bcaaf056210281a5d5b6916559bad28fd217 (diff) | |
download | txr-ba498170706db2c1a53dc3427c584dd74230deef.tar.gz txr-ba498170706db2c1a53dc3427c584dd74230deef.tar.bz2 txr-ba498170706db2c1a53dc3427c584dd74230deef.zip |
vm: handle FVM function type thorughout run-time.
* gc.c (mark_obj): Recognize FVM functions and mark their
vm_desc.
* lib.c (equal): Handle equality for FVM. If the environment
pointers are equal, consider the functions equal.
(funcall, funcall1, funcall2, funcall3, funcall4):
Recognize and call FVM functions. However, there is
a lack of robustness here that needs to be addressed:
vm_execute_closure doesn't check whether there are
too many or not enough arguments. Interpreted functions
have a run-time check inside bind_args.
(obj_print_impl): Don't print VM functions as #<intrinsic fun...>
but rather #<vm fun>.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -372,8 +372,12 @@ tail_call: mark_obj_tail(obj->pk.symhash); case FUN: mark_obj(obj->f.env); - if (obj->f.functype == FINTERP) + switch (obj->f.functype) { + case FINTERP: mark_obj_tail(obj->f.f.interp_fun); + case FVM: + mark_obj_tail(obj->f.f.vm_desc); + } return; case VEC: { |