1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 12:20:20 +02:00

Intrinsics take registers from thread

* libguile/continuations.c (scm_i_make_continuation): Remove registers
  argument; instead get from thread.
* libguile/vm-engine.c (vm_engine): Adapt VM engine to not receive a
  registers argument, and thus to not pass it to intrinsics either.
* libguile/intrinsics.h:
* libguile/intrinsics.c (push_prompt):
* libguile/vm.c (capture_continuation, compose_continuation)
  (abort_to_prompt): Refactor these intrinsics to not take a registers
  argument; it's not necessary.
  (scm_call_n): Don't pass registers argument.
This commit is contained in:
Andy Wingo 2018-06-27 18:42:21 +02:00
parent 154a5de3d7
commit 64d114817a
6 changed files with 28 additions and 35 deletions

View file

@ -272,7 +272,7 @@
((uintptr_t) (ptr) % alignof_type (type) == 0)
static SCM
VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
VM_NAME (scm_thread *thread, int resume)
{
/* Instruction pointer: A pointer to the opcode that is currently
running. */
@ -714,7 +714,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
vmcont = SCM_PROGRAM_FREE_VARIABLE_REF (FP_REF (0), cont_idx);
SYNC_IP ();
CALL_INTRINSIC (compose_continuation, (thread, registers, vmcont));
CALL_INTRINSIC (compose_continuation, (thread, vmcont));
CACHE_REGISTER ();
NEXT (0);
}
@ -777,7 +777,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
SCM cont;
SYNC_IP ();
cont = CALL_INTRINSIC (capture_continuation, (thread, registers));
cont = CALL_INTRINSIC (capture_continuation, (thread));
RESET_FRAME (2);
@ -810,7 +810,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
it continues with the next instruction. */
ip++;
SYNC_IP ();
CALL_INTRINSIC (abort_to_prompt, (thread, registers));
CALL_INTRINSIC (abort_to_prompt, (thread));
/* If abort_to_prompt returned, that means there were no
intervening C frames to jump over, so we just continue
@ -1676,9 +1676,8 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
/* Push the prompt onto the dynamic stack. */
SYNC_IP ();
CALL_INTRINSIC (push_prompt,
(thread, registers, escape_only_p,
SP_REF (tag), FP_SLOT (proc_slot), ip + offset));
CALL_INTRINSIC (push_prompt, (thread, escape_only_p, SP_REF (tag),
FP_SLOT (proc_slot), ip + offset));
NEXT (3);
}