guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: Turn on automatic JIT compilation by default


From: Andy Wingo
Subject: [Guile-commits] 01/01: Turn on automatic JIT compilation by default
Date: Sat, 15 Sep 2018 04:58:44 -0400 (EDT)

wingo pushed a commit to branch lightning
in repository guile.

commit f03ff5304a5804a5a83c37d6640b99e0d842dc15
Author: Andy Wingo <address@hidden>
Date:   Sat Sep 15 10:54:14 2018 +0200

    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.
---
 libguile/jit.c | 32 ++++++--------------------------
 1 file changed, 6 insertions(+), 26 deletions(-)

diff --git a/libguile/jit.c b/libguile/jit.c
index 59c0187..6f8d6cb 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);
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]