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

ruby-changes:68624

From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:11:02 +0900 (JST)
Subject: [ruby-changes:68624] 86c438d129 (master): Revert "Add workaround for inserting into addr2insn mapping"

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

From 86c438d12990d94fcd6ca1853423e19026de2a7f Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Tue, 22 Sep 2020 18:25:29 -0400
Subject: Revert "Add workaround for inserting into addr2insn mapping"

This reverts commit 6b765b7ca0dad82ffbdeea76c63a0cac5fdc4bfd.
It made things much slower and didn't fix the crash.
---
 ujit_compile.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/ujit_compile.c b/ujit_compile.c
index 5980df59f5..bfe75d1b7b 100644
--- a/ujit_compile.c
+++ b/ujit_compile.c
@@ -64,14 +64,7 @@ addr2insn_bookkeeping(void *code_ptr, int insn) https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L64
     const void * const translated_address = table[insn];
     st_data_t encoded_insn_data;
     if (st_lookup(rb_encoded_insn_data, (st_data_t)translated_address, &encoded_insn_data)) {
-        // This is a roundabout way of doing an insert. Doing a plain insert can cause GC
-        // while inserting. While inserting, the table is in an inconsistent state and the
-        // GC can do a lookup in the table.
-        st_table *new_table = st_copy(rb_encoded_insn_data);
-        st_table *old_table = rb_encoded_insn_data;
-        st_insert(new_table, (st_data_t)code_ptr, encoded_insn_data);
-        rb_encoded_insn_data = new_table;
-        st_free_table(old_table);
+        st_insert(rb_encoded_insn_data, (st_data_t)code_ptr, encoded_insn_data);
     }
     else {
         rb_bug("ujit: failed to find info for original instruction while dealing with addr2insn");
-- 
cgit v1.2.1


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

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