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

ruby-changes:69022

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:16:35 +0900 (JST)
Subject: [ruby-changes:69022] dac830553e (master): Diff the local types in ctx_diff()

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

From dac830553ef486a97beb57d1531ccc9a0a4bdd9b Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Tue, 13 Apr 2021 14:32:21 -0400
Subject: Diff the local types in ctx_diff()

---
 yjit_core.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/yjit_core.c b/yjit_core.c
index 8657f05ca3..e7f419da4f 100644
--- a/yjit_core.c
+++ b/yjit_core.c
@@ -283,7 +283,18 @@ int ctx_diff(const ctx_t* src, const ctx_t* dst) https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L283
 
     diff += self_diff;
 
-    // TODO: when we track local types, need to check them too
+    // For each local type we track
+    for (size_t i = 0; i < MAX_LOCAL_TYPES; ++i)
+    {
+        val_type_t t_src = src->local_types[i];
+        val_type_t t_dst = dst->local_types[i];
+        int temp_diff = type_diff(t_src, t_dst);
+
+        if (temp_diff == INT_MAX)
+            return INT_MAX;
+
+        diff += temp_diff;
+    }
 
     // For each value on the temp stack
     for (size_t i = 0; i < src->stack_size; ++i)
@@ -658,7 +669,6 @@ void gen_branch( https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L669
 )
 {
     RUBY_ASSERT(target0.iseq != NULL);
-    //RUBY_ASSERT(target1.iseq != NULL);
     RUBY_ASSERT_ALWAYS(num_branches < MAX_BRANCHES);
     uint32_t branch_idx = num_branches++;
 
@@ -878,7 +888,7 @@ invalidate_block_version(block_t* block) https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L888
 
     // For each incoming branch
     uint32_t* branch_idx;
-    rb_darray_foreach(block->incoming, i, branch_idx)
+    rb_darray_foreach(block->incoming, incoming_idx, branch_idx)
     {
         //uint32_t branch_idx = block->incoming[i];
         branch_t* branch = &branch_entries[*branch_idx];
-- 
cgit v1.2.1


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

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