guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 02/02: JIT counter tweaks


From: Andy Wingo
Subject: [Guile-commits] 02/02: JIT counter tweaks
Date: Sun, 2 Sep 2018 05:00:54 -0400 (EDT)

wingo pushed a commit to branch lightning
in repository guile.

commit 076c3ad8d71f7d48374b79b04aa162802abb5e57
Author: Andy Wingo <address@hidden>
Date:   Sun Sep 2 10:54:35 2018 +0200

    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.
---
 libguile/jit.h       | 7 +++++--
 libguile/vm-engine.c | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libguile/jit.h b/libguile/jit.h
index a1863c2..365be07 100644
--- a/libguile/jit.h
+++ b/libguile/jit.h
@@ -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
 
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 4356159..06006a1 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -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;
 



reply via email to

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