1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 05:30:21 +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

@ -1,7 +1,7 @@
#ifndef SCM_STACKS_H
#define SCM_STACKS_H
/* Copyright 1995-1996,2000-2001,2004,2006,2008,2018
/* Copyright 1995-1996,2000-2001,2004,2006,2008,2018,2025
Free Software Foundation, Inc.
This file is part of Guile.
@ -43,7 +43,7 @@ SCM_API SCM scm_stack_type;
#define SCM_STACK_FRAME(obj) (SCM_STRUCT_SLOT_REF (obj,2))
#define SCM_SET_STACK_FRAME(obj,f) (SCM_STRUCT_SLOT_SET (obj,2,f))
#define SCM_FRAMEP(obj) (SCM_VM_FRAME_P (obj))
#define SCM_FRAMEP(obj) (scm_is_vm_frame (obj))
#define SCM_VALIDATE_STACK(pos, v) \
SCM_MAKE_VALIDATE_MSG (pos, v, STACKP, "stack")