mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +02:00
JIT threshold controlled by environment variable
* libguile/jit.c (scm_jit_counter_threshold): Make a static variable instead of a compile-time constant. (scm_init_jit): Init scm_jit_counter_threshold from GUILE_JIT_COUNTER_THRESHOLD environment variable. Default is -1 indicating "never JIT". * libguile/vm-engine.c (instrument-entry, instrument-loop): Adapt to new variable.
This commit is contained in:
parent
def671974c
commit
cc997293e2
3 changed files with 10 additions and 3 deletions
|
@ -32,6 +32,7 @@
|
|||
#include "gsubr.h"
|
||||
#include "instructions.h"
|
||||
#include "intrinsics.h"
|
||||
#include "simpos.h" /* scm_getenv_int */
|
||||
#include "threads.h"
|
||||
#include "vm-builtins.h"
|
||||
#include "vm-operations.h"
|
||||
|
@ -121,6 +122,10 @@
|
|||
|
||||
|
||||
|
||||
/* Threshold for when to JIT-compile a function. Set from the
|
||||
GUILE_JIT_THRESHOLD environment variable. */
|
||||
uint32_t scm_jit_counter_threshold = -1;
|
||||
|
||||
/* Entry trampoline: saves registers, initializes THREAD and SP
|
||||
registers, and jumps into mcode. */
|
||||
static void (*enter_mcode) (scm_thread *thread, const uint8_t *mcode);
|
||||
|
@ -4465,5 +4470,6 @@ scm_jit_state_free (scm_jit_state *j)
|
|||
void
|
||||
scm_init_jit (void)
|
||||
{
|
||||
scm_jit_counter_threshold = scm_getenv_int ("GUILE_JIT_COUNTER_THRESHOLD", -1);
|
||||
scm_c_define_gsubr ("%jit-compile", 1, 0, 0, (scm_t_subr) scm_sys_jit_compile);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue