diff options
author | Andy Wingo <wingo@pobox.com> | 2018-07-16 15:42:05 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-07-20 11:42:30 +0200 |
commit | 043432fd573648fe8591672aca7e2438b71e6774 (patch) | |
tree | 15e0f687c0bb1283b3fa066ed4ef23404e757a23 /libguile/vm-engine.c | |
parent | b1705bd0f0181a6496223b26cb5da68fa470ccaa (diff) | |
download | guile-043432fd573648fe8591672aca7e2438b71e6774.tar.gz |
Reserve frame word for machine return address
* libguile/frames.h: Add machine return address to diagram.
(SCM_FRAME_MACHINE_RETURN_ADDRESS):
(SCM_FRAME_SET_MACHINE_RETURN_ADDRESS): New macros.
(SCM_FRAME_PREVIOUS_SP):
(SCM_FRAME_DYNAMIC_LINK):
(SCM_FRAME_SET_DYNAMIC_LINK): Adapt for new frame size.
* libguile/vm-engine.c (halt): Set frame size to 3.
(call, call-label): Set mRA to 0.
* libguile/vm.c (push_interrupt_frame, reinstate_continuation_x):
(scm_call_n): Set frame size to 3. In push_interrupt_frame, init the
mRA of the frame.
(vm_builtin_call_with_values_code, vm_handle_interrupt_code): Allocate
larger frames.
* module/language/cps/slot-allocation.scm (allocate-slots): Frame size
is 3.
* module/system/vm/disassembler.scm (define-clobber-parser): Bump frame
size.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index cf4cab7ff..341a006fd 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -321,7 +321,7 @@ VM_NAME (scm_thread *thread) */ VM_DEFINE_OP (0, halt, "halt", OP1 (X32)) { - size_t frame_size = 2; + size_t frame_size = 3; /* Boot closure, then empty frame, then callee, then values. */ size_t first_value = 1 + frame_size + 1; uint32_t nvals = FRAME_LOCALS_COUNT_FROM (first_value); @@ -373,6 +373,7 @@ VM_NAME (scm_thread *thread) VP->fp = SCM_FRAME_SLOT (old_fp, proc - 1); SCM_FRAME_SET_DYNAMIC_LINK (VP->fp, old_fp); SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (VP->fp, ip + 2); + SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (VP->fp, 0); RESET_FRAME (nlocals); @@ -416,6 +417,7 @@ VM_NAME (scm_thread *thread) VP->fp = SCM_FRAME_SLOT (old_fp, proc - 1); SCM_FRAME_SET_DYNAMIC_LINK (VP->fp, old_fp); SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS (VP->fp, ip + 3); + SCM_FRAME_SET_MACHINE_RETURN_ADDRESS (VP->fp, 0); RESET_FRAME (nlocals); |