1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

Inline handling of non-program apply

* libguile/vm.c (vm_apply_non_program_code): Remove, now unneeded.
* libguile/vm-engine.c (vm_engine, call, tail-call, tail-call/shuffle)
  (tail-apply, call/cc): Inline handling of non-programs, as will be the
  case with JIT code.
This commit is contained in:
Andy Wingo 2018-06-27 13:54:45 +02:00
parent 1735cc1fec
commit 7883290d88
2 changed files with 28 additions and 22 deletions

View file

@ -311,7 +311,10 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
ip = SCM_PROGRAM_CODE (FP_REF (0));
else
ip = (uint32_t *) vm_apply_non_program_code;
{
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
}
APPLY_HOOK ();
@ -389,7 +392,11 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
ip = SCM_PROGRAM_CODE (FP_REF (0));
else
ip = (uint32_t *) vm_apply_non_program_code;
{
SYNC_IP ();
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
}
APPLY_HOOK ();
@ -449,7 +456,11 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
ip = SCM_PROGRAM_CODE (FP_REF (0));
else
ip = (uint32_t *) vm_apply_non_program_code;
{
SYNC_IP ();
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
}
APPLY_HOOK ();
@ -502,7 +513,11 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
ip = SCM_PROGRAM_CODE (FP_REF (0));
else
ip = (uint32_t *) vm_apply_non_program_code;
{
SYNC_IP ();
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
}
APPLY_HOOK ();
@ -739,7 +754,10 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
ip = SCM_PROGRAM_CODE (FP_REF (0));
else
ip = (uint32_t *) vm_apply_non_program_code;
{
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
}
APPLY_HOOK ();
@ -767,7 +785,10 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
if (SCM_LIKELY (SCM_PROGRAM_P (SP_REF (1))))
ip = SCM_PROGRAM_CODE (SP_REF (1));
else
ip = (uint32_t *) vm_apply_non_program_code;
{
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
}
APPLY_HOOK ();
@ -2027,18 +2048,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
NEXT (1);
}
/* apply-non-program _:24
*
* Used by the VM as a trampoline to apply non-programs.
*/
VM_DEFINE_OP (142, apply_non_program, "apply-non-program", OP1 (X32))
{
SYNC_IP ();
scm_vm_intrinsics.apply_non_program (thread);
CACHE_REGISTER ();
NEXT (0);
}
VM_DEFINE_OP (142, unused_142, NULL, NOP)
VM_DEFINE_OP (143, unused_143, NULL, NOP)
VM_DEFINE_OP (144, unused_144, NULL, NOP)
VM_DEFINE_OP (145, unused_145, NULL, NOP)