mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +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:
parent
1735cc1fec
commit
7883290d88
2 changed files with 28 additions and 22 deletions
|
@ -311,7 +311,10 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
|
||||||
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
|
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
|
||||||
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
||||||
else
|
else
|
||||||
ip = (uint32_t *) vm_apply_non_program_code;
|
{
|
||||||
|
scm_vm_intrinsics.apply_non_program (thread);
|
||||||
|
CACHE_REGISTER ();
|
||||||
|
}
|
||||||
|
|
||||||
APPLY_HOOK ();
|
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))))
|
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
|
||||||
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
||||||
else
|
else
|
||||||
ip = (uint32_t *) vm_apply_non_program_code;
|
{
|
||||||
|
SYNC_IP ();
|
||||||
|
scm_vm_intrinsics.apply_non_program (thread);
|
||||||
|
CACHE_REGISTER ();
|
||||||
|
}
|
||||||
|
|
||||||
APPLY_HOOK ();
|
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))))
|
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
|
||||||
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
||||||
else
|
else
|
||||||
ip = (uint32_t *) vm_apply_non_program_code;
|
{
|
||||||
|
SYNC_IP ();
|
||||||
|
scm_vm_intrinsics.apply_non_program (thread);
|
||||||
|
CACHE_REGISTER ();
|
||||||
|
}
|
||||||
|
|
||||||
APPLY_HOOK ();
|
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))))
|
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
|
||||||
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
||||||
else
|
else
|
||||||
ip = (uint32_t *) vm_apply_non_program_code;
|
{
|
||||||
|
SYNC_IP ();
|
||||||
|
scm_vm_intrinsics.apply_non_program (thread);
|
||||||
|
CACHE_REGISTER ();
|
||||||
|
}
|
||||||
|
|
||||||
APPLY_HOOK ();
|
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))))
|
if (SCM_LIKELY (SCM_PROGRAM_P (FP_REF (0))))
|
||||||
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
ip = SCM_PROGRAM_CODE (FP_REF (0));
|
||||||
else
|
else
|
||||||
ip = (uint32_t *) vm_apply_non_program_code;
|
{
|
||||||
|
scm_vm_intrinsics.apply_non_program (thread);
|
||||||
|
CACHE_REGISTER ();
|
||||||
|
}
|
||||||
|
|
||||||
APPLY_HOOK ();
|
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))))
|
if (SCM_LIKELY (SCM_PROGRAM_P (SP_REF (1))))
|
||||||
ip = SCM_PROGRAM_CODE (SP_REF (1));
|
ip = SCM_PROGRAM_CODE (SP_REF (1));
|
||||||
else
|
else
|
||||||
ip = (uint32_t *) vm_apply_non_program_code;
|
{
|
||||||
|
scm_vm_intrinsics.apply_non_program (thread);
|
||||||
|
CACHE_REGISTER ();
|
||||||
|
}
|
||||||
|
|
||||||
APPLY_HOOK ();
|
APPLY_HOOK ();
|
||||||
|
|
||||||
|
@ -2027,18 +2048,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
|
||||||
NEXT (1);
|
NEXT (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* apply-non-program _:24
|
VM_DEFINE_OP (142, unused_142, NULL, NOP)
|
||||||
*
|
|
||||||
* 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 (143, unused_143, NULL, NOP)
|
VM_DEFINE_OP (143, unused_143, NULL, NOP)
|
||||||
VM_DEFINE_OP (144, unused_144, NULL, NOP)
|
VM_DEFINE_OP (144, unused_144, NULL, NOP)
|
||||||
VM_DEFINE_OP (145, unused_145, NULL, NOP)
|
VM_DEFINE_OP (145, unused_145, NULL, NOP)
|
||||||
|
|
|
@ -330,10 +330,6 @@ static const uint32_t vm_boot_continuation_code[] = {
|
||||||
SCM_PACK_OP_24 (halt, 0)
|
SCM_PACK_OP_24 (halt, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32_t vm_apply_non_program_code[] = {
|
|
||||||
SCM_PACK_OP_24 (apply_non_program, 0)
|
|
||||||
};
|
|
||||||
|
|
||||||
static const uint32_t vm_builtin_apply_code[] = {
|
static const uint32_t vm_builtin_apply_code[] = {
|
||||||
SCM_PACK_OP_24 (assert_nargs_ge, 3),
|
SCM_PACK_OP_24 (assert_nargs_ge, 3),
|
||||||
SCM_PACK_OP_24 (tail_apply, 0), /* proc in r1, args from r2 */
|
SCM_PACK_OP_24 (tail_apply, 0), /* proc in r1, args from r2 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue