1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

JIT counter tweaks

* libguile/vm-engine.c (instrument-entry, instrument-loop): Make the
  counter check >=, so that we can set the threshold to 0 and still get
  compilation.
* libguile/jit.h (enum scm_jit_counter_value): Make the increments
  event.
This commit is contained in:
Andy Wingo 2018-09-02 10:54:35 +02:00
parent b176e714f8
commit 076c3ad8d7
2 changed files with 7 additions and 4 deletions

View file

@ -44,10 +44,13 @@ struct scm_jit_function_data
#endif
};
/* These values should be even, so that a function's counter is never
0xffffffff, so that setting the JIT threshold to 0xffffffff always
disables compilation. */
enum scm_jit_counter_value
{
SCM_JIT_COUNTER_ENTRY_INCREMENT = 15,
SCM_JIT_COUNTER_LOOP_INCREMENT = 1,
SCM_JIT_COUNTER_ENTRY_INCREMENT = 30,
SCM_JIT_COUNTER_LOOP_INCREMENT = 2,
};
#endif

View file

@ -471,7 +471,7 @@ VM_NAME (scm_thread *thread)
NEXT (0);
}
if (data->counter > scm_jit_counter_threshold)
if (data->counter >= scm_jit_counter_threshold)
{
const uint8_t *mcode;
@ -722,7 +722,7 @@ VM_NAME (scm_thread *thread)
data = (struct scm_jit_function_data *) (ip + data_offset);
if (data->counter > scm_jit_counter_threshold)
if (data->counter >= scm_jit_counter_threshold)
{
const uint8_t *mcode;