1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

abort-to-prompt uses an intrinsic

* libguile/control.h:
* libguile/control.c (scm_i_make_composable_continuation): Rename from
  make_partial_continuation and expose internally.
  (scm_abort_to_prompt_star): Adapt to scm_i_vm_abort name change.
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Define
  abort_to_prompt intrinsic.
* libguile/throw.c (abort_to_prompt): Adapt to scm_i_vm_abort name
  change.
* libguile/vm-engine.c (abort): Use abort_to_prompt intrinsic.
* libguile/vm.c (capture_delimited_continuation): Move here from
  control.c where it was named reify_partial_continuation.
  (scm_i_vm_abort): Move from control.c where it was named
  scm_c_abort (and only exposed internally).
  (abort_to_prompt): New intrinsic, replacing vm_abort.
* libguile/vm.h: Add setjmp include and scm_i_vm_abort decl.
This commit is contained in:
Andy Wingo 2018-06-26 16:19:16 +02:00
parent 03a9b71479
commit e7778c62aa
7 changed files with 138 additions and 135 deletions

View file

@ -781,15 +781,12 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
*/
VM_DEFINE_OP (16, abort, "abort", OP1 (X32))
{
uint32_t nlocals = FRAME_LOCALS_COUNT ();
ASSERT (nlocals >= 2);
/* FIXME: Really we should capture the caller's registers. Until
then, manually advance the IP so that when the prompt resumes,
it continues with the next instruction. */
ip++;
SYNC_IP ();
vm_abort (VP, FP_REF (1), nlocals - 2, registers);
scm_vm_intrinsics.abort_to_prompt (thread, registers);
/* vm_abort should not return */
abort ();