summaryrefslogtreecommitdiff
path: root/libguile/jit.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2019-06-18 21:40:55 +0200
committerAndy Wingo <wingo@pobox.com>2019-06-18 21:45:29 +0200
commitaf72d01de8c64776f550205c540f9678c5dda2e5 (patch)
tree9362039fb392c36e6e18ec8359bba769bb30a7b9 /libguile/jit.h
parente8203a3f8c34b0505fa0f914503348c1b85c74d3 (diff)
downloadguile-af72d01de8c64776f550205c540f9678c5dda2e5.tar.gz
Speed up returns in JIT
This patch is a bit unfortunate, in the sense that it exposes some of the JIT guts to the rest of the VM. Code needs to treat "machine return addresses" as valid if non-NULL (as before) and also not equal to a tier-down trampoline. This is because tier-down at a return needs the old frame pointer to load the "virtual return address", and the way this patch works is that it passes the vra in a well-known register. It's a custom calling convention for a certain kind of return. * libguile/jit.h (scm_jit_return_to_interpreter_trampoline): New internal global. * libguile/jit.c: (scm_jit_clear_mcode_return_addresses): Move here, from vm.c. Instead of zeroing return addresses, set them to the return-to-interpreter trampoline. * libguile/vm-engine.c (return-values): Don't enter mcode if the mra is scm_jit_return_to_interpreter_trampoline. * libguile/vm.c (capture_continuation): Treat the tier-down trampoline as NULL.
Diffstat (limited to 'libguile/jit.h')
-rw-r--r--libguile/jit.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libguile/jit.h b/libguile/jit.h
index 365be07e9..455f9c79c 100644
--- a/libguile/jit.h
+++ b/libguile/jit.h
@@ -1,7 +1,7 @@
#ifndef SCM_JIT_H
#define SCM_JIT_H
-/* Copyright 2018
+/* Copyright 2018-2019
Free Software Foundation, Inc.
This file is part of Guile.
@@ -62,6 +62,9 @@ SCM_INTERNAL void scm_jit_enter_mcode (scm_thread *thread,
const uint8_t *mcode);
SCM_INTERNAL void scm_jit_state_free (struct scm_jit_state *j);
+SCM_INTERNAL void *scm_jit_return_to_interpreter_trampoline;
+SCM_INTERNAL void scm_jit_clear_mcode_return_addresses (scm_thread *thread);
+
SCM_INTERNAL void scm_init_jit (void);
#endif /* SCM_JIT_H */