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

Maybe enter JIT when returning from interpreted functions

* libguile/jit.c (scm_jit_compute_mcode): Minor optimization.
* libguile/vm-engine.c (return-values): Maybe return to JIT code.
This commit is contained in:
Andy Wingo 2018-08-29 17:54:19 +02:00
parent c03e2bbbb4
commit 24d09b16b6
2 changed files with 18 additions and 14 deletions

View file

@ -4425,14 +4425,11 @@ scm_sys_jit_compile (SCM fn)
const uint8_t *
scm_jit_compute_mcode (scm_thread *thread, struct scm_jit_function_data *data)
{
const uint32_t *start = (const uint32_t *) (((char *)data) + data->start);
uint8_t *mcode_start = data->mcode;
const uint32_t *vcode_start = (const uint32_t *) (((char *)data) + data->start);
/* Until the JIT is tested, don't automatically JIT-compile code.
Just return whatever code is already there. If we decide to buy
later, replace with something that wires up a call to
"compute_mcode". */
if (start == thread->vm.ip)
return data->mcode;
if (mcode_start && vcode_start == thread->vm.ip)
return mcode_start;
return NULL;
}