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

ruby-changes:69082

From: Aaron <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:46 +0900 (JST)
Subject: [ruby-changes:69082] 0ca04e2dd4 (master): Only clear the JIT function when we invalidate the entry block

https://git.ruby-lang.org/ruby.git/commit/?id=0ca04e2dd4

From 0ca04e2dd4d8624df09bf9065b4b96266da4771c Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Thu, 26 Aug 2021 11:41:47 -0700
Subject: Only clear the JIT function when we invalidate the entry block

We should only clear the JIT function when the entry point is
invalidated.  Right now we only support compiling functions with a PC
offset of zero (functions that take optional parameters can start at
non-zero PC), so this patch just checks that the index is 0 before
clearing the jit function
---
 yjit_core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/yjit_core.c b/yjit_core.c
index 413411a375..ef6017b74d 100644
--- a/yjit_core.c
+++ b/yjit_core.c
@@ -1122,7 +1122,14 @@ invalidate_block_version(block_t *block) https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L1122
     // interpreter will run the iseq
 
 #if JIT_ENABLED
-    iseq->body->jit_func = 0;
+    // Only clear the jit_func when we're invalidating the JIT entry block.
+    // We only support compiling iseqs from index 0 right now.  So entry
+    // points will always have an instruction index of 0.  We'll need to
+    // change this in the future when we support optional parameters because
+    // they enter the function with a non-zero PC
+    if (block->blockid.idx == 0) {
+        iseq->body->jit_func = 0;
+    }
 #endif
 
     // TODO:
-- 
cgit v1.2.1


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

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