[前][次][番号順一覧][スレッド一覧]

ruby-changes:68689

From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:12:25 +0900 (JST)
Subject: [ruby-changes:68689] 498fe0fb52 (master): Move MicroJIT compilation threshold into MicroJIT's header

https://git.ruby-lang.org/ruby.git/commit/?id=498fe0fb52

From 498fe0fb52c4b3f7c8a4abdc9da1fffb2aa8c69b Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Thu, 22 Oct 2020 14:16:39 -0400
Subject: Move MicroJIT compilation threshold into MicroJIT's header

---
 mjit.h         | 3 +--
 ujit_compile.h | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mjit.h b/mjit.h
index fc99da04a7..51ba66921c 100644
--- a/mjit.h
+++ b/mjit.h
@@ -150,8 +150,7 @@ mjit_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/mjit.h#L150
     }
 
 #ifndef MJIT_HEADER
-    const int ujit_call_threashold = 10;
-    if (rb_ujit_enabled_p() && !mjit_call_p && body->total_calls == ujit_call_threashold)  {
+    if (rb_ujit_enabled_p() && !mjit_call_p && body->total_calls == UJIT_CALL_THRESHOLD)  {
         rb_ujit_compile_iseq(iseq);
         return Qundef;
     }
diff --git a/ujit_compile.h b/ujit_compile.h
index b849b391d5..89ee85d938 100644
--- a/ujit_compile.h
+++ b/ujit_compile.h
@@ -20,6 +20,8 @@ bool rb_ujit_enabled_p(void) https://github.com/ruby/ruby/blob/trunk/ujit_compile.h#L20
     return rb_ujit_enabled;
 }
 
+#define UJIT_CALL_THRESHOLD (10u)
+
 void rb_ujit_init(void);
 uint8_t *ujit_compile_insn(const rb_iseq_t *iseq, unsigned int insn_idx, unsigned int *next_ujit_idx);
 void rb_ujit_compile_iseq(const rb_iseq_t *iseq);
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]