1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-08 13:10:19 +02:00

Inline "struct scm_frame" into tagged frame objects

This avoids an indirection and will make the tracer's job easier.

* libguile/frames.h (struct scm_vm_frame): New data type.
(scm_is_vm_frame):
(scm_vm_frame):
(scm_vm_frame_kind):
(scm_vm_frame_fp):
(scm_vm_frame_sp):
(scm_vm_frame_ip):
(scm_frame_init_from_vm_frame): New helpers.

* libguile/frames.c:
* libguile/stacks.c:
* libguile/stacks.h:
* libguile/vm.c: Update all users of SCM_VM_FRAME_* macros to use new
helpers.
This commit is contained in:
Andy Wingo 2025-05-29 21:53:36 +02:00
parent 75842cf215
commit aa73d31ded
5 changed files with 101 additions and 57 deletions

View file

@ -333,8 +333,9 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
}
else if (SCM_VM_FRAME_P (obj))
{
kind = SCM_VM_FRAME_KIND (obj);
memcpy (&frame, SCM_VM_FRAME_DATA (obj), sizeof frame);
struct scm_vm_frame *f = scm_vm_frame (obj);
kind = scm_vm_frame_kind (f);
scm_frame_init_from_vm_frame (&frame, f);
}
else if (SCM_CONTINUATIONP (obj))
/* FIXME: Narrowing to prompt tags should narrow with respect to the prompts