summaryrefslogtreecommitdiff
path: root/libguile/vm-engine.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-08-13 10:27:13 +0200
committerAndy Wingo <wingo@pobox.com>2018-08-13 10:32:13 +0200
commit5df43b60a9c5186343c3270a710a7ccf1bcbbabd (patch)
tree9819ec999cbc1a0acadc7f58f7d3846bd57dd8b9 /libguile/vm-engine.c
parenta20feea43e3a8cf2460c254fb65d5e3aed6bd756 (diff)
downloadguile-5df43b60a9c5186343c3270a710a7ccf1bcbbabd.tar.gz
Adapt JIT calling convention; continuations take mra from stack
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Update prototype of capture-continuation. * libguile/jit.h: * libguile/jit.c (scm_jit_enter_mcode): Return void, not the vra. Instead, we expect the code to set vp->ip for the vra. * libguile/vm-engine.c (instrument-entry, instrument-loop) (return-values, abort): Adapt scm_jit_enter_mcode calling convention. (capture-continuation): No need to pass an mra; the intrinsic will read it from the stack. * libguile/vm.c (capture_continuation): Remove mra arg, as we take mra from the continuation. (scm_call_n): Adapt to scm_jit_enter_mcode change.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r--libguile/vm-engine.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 9789fc82d..8dc5c00c1 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -472,8 +472,8 @@ VM_NAME (scm_thread *thread)
if (mcode)
{
- ip = scm_jit_enter_mcode (thread, mcode);
- CACHE_SP ();
+ scm_jit_enter_mcode (thread, mcode);
+ CACHE_REGISTER ();
NEXT (0);
}
}
@@ -682,8 +682,8 @@ VM_NAME (scm_thread *thread)
if (mcode)
{
- ip = scm_jit_enter_mcode (thread, mcode);
- CACHE_SP ();
+ scm_jit_enter_mcode (thread, mcode);
+ CACHE_REGISTER ();
NEXT (0);
}
else
@@ -716,8 +716,8 @@ VM_NAME (scm_thread *thread)
if (mcode)
{
- ip = scm_jit_enter_mcode (thread, mcode);
- CACHE_SP ();
+ scm_jit_enter_mcode (thread, mcode);
+ CACHE_REGISTER ();
NEXT (0);
}
}
@@ -735,12 +735,11 @@ VM_NAME (scm_thread *thread)
VM_DEFINE_OP (15, capture_continuation, "capture-continuation", DOP1 (X8_S24))
{
uint32_t dst;
- uint8_t *mra = NULL;
UNPACK_24 (op, dst);
SYNC_IP ();
- SP_SET (dst, CALL_INTRINSIC (capture_continuation, (thread, mra)));
+ SP_SET (dst, CALL_INTRINSIC (capture_continuation, (thread)));
NEXT (1);
}
@@ -769,16 +768,10 @@ VM_NAME (scm_thread *thread)
ABORT_CONTINUATION_HOOK ();
if (mcode)
- {
- ip = scm_jit_enter_mcode (thread, mcode);
- CACHE_SP ();
- NEXT (0);
- }
- else
- {
- CACHE_REGISTER ();
- NEXT (0);
- }
+ scm_jit_enter_mcode (thread, mcode);
+
+ CACHE_REGISTER ();
+ NEXT (0);
}
/* builtin-ref dst:12 idx:12