[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/02: Fix bug restoring a JIT continuation from the int
From: |
Andy Wingo |
Subject: |
[Guile-commits] 02/02: Fix bug restoring a JIT continuation from the interpreter |
Date: |
Wed, 19 Feb 2020 10:55:53 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit cc30168878972652ddde4489351b76dc53f20142
Author: Andy Wingo <address@hidden>
AuthorDate: Wed Feb 19 16:53:44 2020 +0100
Fix bug restoring a JIT continuation from the interpreter
* libguile/vm.c (push_interrupt_frame, compose_continuation): In places
where we push on synthetic frames before possibly going back to mcode,
make sure that the return mcode will trampoline back to the
interpreter. Fixes compose-continuation from the interpreter to
partial continuations with mcode.
---
libguile/vm.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libguile/vm.c b/libguile/vm.c
index ab6a629..b20c6eb 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -1051,6 +1051,11 @@ push_interrupt_frame (scm_thread *thread, uint8_t *mra)
size_t old_frame_size = frame_locals_count (thread);
SCM proc = scm_i_async_pop (thread);
+#if ENABLE_JIT
+ if (!mra)
+ mra = scm_jit_return_to_interpreter_trampoline;
+#endif
+
/* Reserve space for frame and callee. */
alloc_frame (thread, old_frame_size + frame_overhead + 1);
@@ -1191,6 +1196,12 @@ compose_continuation (scm_thread *thread, SCM cont)
if (SCM_UNLIKELY (! SCM_VM_CONT_REWINDABLE_P (cont)))
scm_wrong_type_arg_msg (NULL, 0, cont, "resumable continuation");
+#if ENABLE_JIT
+ if (!SCM_FRAME_MACHINE_RETURN_ADDRESS (vp->fp))
+ SCM_FRAME_SET_MACHINE_RETURN_ADDRESS
+ (vp->fp, scm_jit_return_to_interpreter_trampoline);
+#endif
+
nargs = frame_locals_count (thread) - 1;
args = alloca (nargs * sizeof (*args));
memcpy (args, vp->sp, nargs * sizeof (*args));