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

ruby-changes:68829

From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:14:07 +0900 (JST)
Subject: [ruby-changes:68829] f8b4082be4 (master): YJIT: fix leak, remove unused field on block_t

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

From f8b4082be4e63876b6bf7d1aa66eaaa9bcb5d4ca Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Thu, 4 Mar 2021 15:56:34 -0500
Subject: YJIT: fix leak, remove unused field on block_t

This field was never used and is now covered by jit_mov_gc_ptr.
---
 ujit_codegen.c | 2 --
 ujit_core.c    | 1 -
 ujit_core.h    | 1 -
 ujit_iface.c   | 2 --
 4 files changed, 6 deletions(-)

diff --git a/ujit_codegen.c b/ujit_codegen.c
index 41662a8b2d..0b2c52a844 100644
--- a/ujit_codegen.c
+++ b/ujit_codegen.c
@@ -1414,8 +1414,6 @@ gen_oswb_iseq(jitstate_t* jit, ctx_t* ctx, struct rb_call_data * cd, const rb_ca https://github.com/ruby/ruby/blob/trunk/ujit_codegen.c#L1414
         return false;
     }
 
-    rb_gc_register_mark_object((VALUE)iseq); // FIXME: intentional LEAK!
-
     // Create a size-exit to fall back to the interpreter
     uint8_t* side_exit = ujit_side_exit(jit, ctx);
 
diff --git a/ujit_core.c b/ujit_core.c
index 651046cc55..f2215cc9bf 100644
--- a/ujit_core.c
+++ b/ujit_core.c
@@ -201,7 +201,6 @@ add_block_version(blockid_t blockid, block_t* block) https://github.com/ruby/ruby/blob/trunk/ujit_core.c#L201
     {
         // By writing the new block to the iseq, the iseq now
         // contains new references to Ruby objects. Run write barriers.
-        RB_OBJ_WRITTEN(iseq, Qundef, block->dependencies.iseq);
         RB_OBJ_WRITTEN(iseq, Qundef, block->dependencies.cc);
         RB_OBJ_WRITTEN(iseq, Qundef, block->dependencies.cme);
 
diff --git a/ujit_core.h b/ujit_core.h
index ac7d02ae12..92d2dd594f 100644
--- a/ujit_core.h
+++ b/ujit_core.h
@@ -125,7 +125,6 @@ typedef struct ujit_block_version https://github.com/ruby/ruby/blob/trunk/ujit_core.h#L125
     struct {
         VALUE cc;
         VALUE cme;
-        VALUE iseq;
     } dependencies;
 
     // Index one past the last instruction in the iseq
diff --git a/ujit_iface.c b/ujit_iface.c
index 54e8897d3b..d97418a986 100644
--- a/ujit_iface.c
+++ b/ujit_iface.c
@@ -689,7 +689,6 @@ rb_ujit_iseq_mark(const struct rb_iseq_constant_body *body) https://github.com/ruby/ruby/blob/trunk/ujit_iface.c#L689
             rb_gc_mark_movable((VALUE)block->blockid.iseq);
             rb_gc_mark_movable(block->dependencies.cc);
             rb_gc_mark_movable(block->dependencies.cme);
-            rb_gc_mark_movable(block->dependencies.iseq);
 
             // Walk over references to objects in generated code.
             uint32_t *offset_element;
@@ -718,7 +717,6 @@ rb_ujit_iseq_update_references(const struct rb_iseq_constant_body *body) https://github.com/ruby/ruby/blob/trunk/ujit_iface.c#L717
 
             block->dependencies.cc = rb_gc_location(block->dependencies.cc);
             block->dependencies.cme = rb_gc_location(block->dependencies.cme);
-            block->dependencies.iseq = rb_gc_location(block->dependencies.iseq);
 
             // Walk over references to objects in generated code.
             uint32_t *offset_element;
-- 
cgit v1.2.1


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

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