diff options
author | Andy Wingo <wingo@pobox.com> | 2018-09-15 10:54:14 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-09-15 10:54:14 +0200 |
commit | f03ff5304a5804a5a83c37d6640b99e0d842dc15 (patch) | |
tree | 14d4ccf580331681c8b9dd23589ca97c7d61ed15 | |
parent | 883bdc74530f1e602488f69f68cb8aa31199f951 (diff) | |
download | guile-f03ff5304a5804a5a83c37d6640b99e0d842dc15.tar.gz |
Turn on automatic JIT compilation by default
* libguile/jit.c (default_jit_threshold): New static const variable.
(scm_sys_jit_compile): Remove.
(scm_init_jit): Rename GUILE_JIT_COUNTER_THRESHOLD to
GUILE_JIT_THRESHOLD, and default to default_jit_threshold. Remove
%jit-compile definition.
-rw-r--r-- | libguile/jit.c | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/libguile/jit.c b/libguile/jit.c index 59c01877b..6f8d6cbca 100644 --- a/libguile/jit.c +++ b/libguile/jit.c @@ -123,8 +123,10 @@ +static const uint32_t default_jit_threshold = 50000; + /* Threshold for when to JIT-compile a function. Set from the - GUILE_JIT_COUNTER_THRESHOLD environment variable. */ + GUILE_JIT_THRESHOLD environment variable. */ uint32_t scm_jit_counter_threshold = -1; /* If positive, stop JIT compilation after the Nth compilation. Useful @@ -4711,28 +4713,6 @@ compute_mcode (scm_thread *thread, uint32_t *entry_ip, return entry_mcode; } -/* This is a temporary function; just here while we're still kicking the - tires. */ -static SCM -scm_sys_jit_compile (SCM fn) -{ - uint32_t *code; - struct scm_jit_function_data *data; - - if (!SCM_PROGRAM_P (fn)) - scm_wrong_type_arg ("%jit-compile", 1, fn); - - code = SCM_PROGRAM_CODE (fn); - if (code[0] != scm_op_instrument_entry) - scm_wrong_type_arg ("%jit-compile", 1, fn); - - data = (struct scm_jit_function_data *) (code + (int32_t)code[1]); - - compute_mcode (SCM_I_CURRENT_THREAD, code, data); - - return SCM_UNSPECIFIED; -} - const uint8_t * scm_jit_compute_mcode (scm_thread *thread, struct scm_jit_function_data *data) { @@ -4793,9 +4773,9 @@ 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_jit_counter_threshold = scm_getenv_int ("GUILE_JIT_THRESHOLD", + default_jit_threshold); jit_stop_after = scm_getenv_int ("GUILE_JIT_STOP_AFTER", -1); jit_pause_when_stopping = scm_getenv_int ("GUILE_JIT_PAUSE_WHEN_STOPPING", 0); - jit_log_level = scm_getenv_int ("GUILE_JIT_LOG_LEVEL", 0); - scm_c_define_gsubr ("%jit-compile", 1, 0, 0, (scm_t_subr) scm_sys_jit_compile); + jit_log_level = scm_getenv_int ("GUILE_JIT_LOG", 0); } |