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

Add indirect-tail-call VM instruction

* libguile/vm-engine.c (indirect_tail_call): New instruction.
* libguile/jit.c (compile_indirect_tail_call):
(compile_indirect_tail_call_slow): Add JIT support.
* module/system/vm/assembler.scm (system):
* module/system/vm/disassembler.scm (instruction-has-fallthrough?):
(stack-effect-parsers): Add assembler support.
This commit is contained in:
Andy Wingo 2021-05-25 14:13:37 +02:00
parent 896960dade
commit a1eb526b0c
4 changed files with 51 additions and 4 deletions

View file

@ -3478,7 +3478,22 @@ VM_NAME (scm_thread *thread)
NEXT (4);
}
VM_DEFINE_OP (167, unused_167, NULL, NOP)
/* indirect-tail-call _:24
*
* Pop a function pointer off the top of the stack and tail-call it.
*/
VM_DEFINE_OP (167, indirect_tail_call, "indirect-tail-call", OP1 (X32))
{
VM_ASSERT (FRAME_LOCALS_COUNT () > 0, abort());
uint32_t *code = SP_REF_PTR (0);
VP->sp = sp = sp + 1;
ip = code;
NEXT (0);
}
VM_DEFINE_OP (168, unused_168, NULL, NOP)
VM_DEFINE_OP (169, unused_169, NULL, NOP)
VM_DEFINE_OP (170, unused_170, NULL, NOP)