[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/41: Identify boot continuations by code, not closure
From: |
Andy Wingo |
Subject: |
[Guile-commits] 04/41: Identify boot continuations by code, not closure |
Date: |
Wed, 02 Dec 2015 08:06:45 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 02fc5a772bc95bbd70a81b8589bf261a3822f9bd
Author: Andy Wingo <address@hidden>
Date: Thu Nov 26 16:36:22 2015 +0100
Identify boot continuations by code, not closure
* libguile/vm.h:
* libguile/vm.c (scm_i_vm_is_boot_continuation_code): New internal
procedure.
* libguile/stacks.c (scm_make_stack):
* libguile/frames.c (scm_c_frame_previous): Use new helper to identify
boot frames.
---
libguile/frames.c | 7 ++-----
libguile/stacks.c | 3 +--
libguile/vm.c | 6 ++++++
libguile/vm.h | 1 +
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/libguile/frames.c b/libguile/frames.c
index 48e963a..312d53b 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -388,11 +388,8 @@ scm_c_frame_previous (enum scm_vm_frame_kind kind, struct
scm_frame *frame)
frame->sp_offset = stack_top - new_sp;
frame->ip = SCM_FRAME_RETURN_ADDRESS (this_fp);
- {
- SCM proc = scm_c_frame_closure (kind, frame);
- if (SCM_PROGRAM_P (proc) && SCM_PROGRAM_IS_BOOT (proc))
- goto again;
- }
+ if (scm_i_vm_is_boot_continuation_code (frame->ip))
+ goto again;
return 1;
}
diff --git a/libguile/stacks.c b/libguile/stacks.c
index 366176b..958103a 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -361,8 +361,7 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
/* Skip initial boot frame, if any. This is possible if the frame
originates from a captured continuation. */
- if (SCM_PROGRAM_P (scm_c_frame_closure (kind, &frame))
- && SCM_PROGRAM_IS_BOOT (scm_c_frame_closure (kind, &frame))
+ if (scm_i_vm_is_boot_continuation_code (frame.ip)
&& !scm_c_frame_previous (kind, &frame))
return SCM_BOOL_F;
diff --git a/libguile/vm.c b/libguile/vm.c
index 5ea6b2b..014ee65 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -661,6 +661,12 @@ static const scm_t_uint32
vm_builtin_call_with_current_continuation_code[] = {
};
+int
+scm_i_vm_is_boot_continuation_code (scm_t_uint32 *ip)
+{
+ return ip == vm_boot_continuation_code;
+}
+
static SCM
scm_vm_builtin_ref (unsigned idx)
{
diff --git a/libguile/vm.h b/libguile/vm.h
index 936633d..2ca4f2a 100644
--- a/libguile/vm.h
+++ b/libguile/vm.h
@@ -106,6 +106,7 @@ SCM_INTERNAL SCM scm_i_vm_capture_stack (union
scm_vm_stack_element *stack_top,
SCM_INTERNAL int scm_i_vm_cont_to_frame (SCM cont, struct scm_frame *frame);
SCM_INTERNAL void scm_i_vm_cont_print (SCM x, SCM port,
scm_print_state *pstate);
+SCM_INTERNAL int scm_i_vm_is_boot_continuation_code (scm_t_uint32 *ip);
SCM_INTERNAL void scm_bootstrap_vm (void);
SCM_INTERNAL void scm_init_vm (void);
- [Guile-commits] branch master updated (13edcf5 -> 2468871), Andy Wingo, 2015/12/02
- [Guile-commits] 03/41: Remove br-if-equal opcode, Andy Wingo, 2015/12/02
- [Guile-commits] 02/41: Don't compile equal? to br-if-equal, Andy Wingo, 2015/12/02
- [Guile-commits] 04/41: Identify boot continuations by code, not closure,
Andy Wingo <=
- [Guile-commits] 01/41: Fix miscompilation of closures allocated as vectors, Andy Wingo, 2015/12/02
- [Guile-commits] 08/41: Add frame-procedure-name, Andy Wingo, 2015/12/02
- [Guile-commits] 06/41: Apply of non-programs has IP that is not from prev frame, Andy Wingo, 2015/12/02
- [Guile-commits] 07/41: Remove primitive?, add primitive-code?, Andy Wingo, 2015/12/02
- [Guile-commits] 10/41: More robust low-level frame printer, Andy Wingo, 2015/12/02
- [Guile-commits] 05/41: All arities serialize a "closure" binding, Andy Wingo, 2015/12/02
- [Guile-commits] 12/41: ,registers doesn't use frame-procedure, Andy Wingo, 2015/12/02
- [Guile-commits] 11/41: Better frame-call-representation printing of GC clobbers, Andy Wingo, 2015/12/02
- [Guile-commits] 09/41: frame-call-representation avoids frame-procedure., Andy Wingo, 2015/12/02
- [Guile-commits] 15/41: Remove frame-procedure, Andy Wingo, 2015/12/02