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

ruby-changes:68921

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:16:36 +0900 (JST)
Subject: [ruby-changes:68921] e66c9f8c62 (master): Remove redundant mov

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

From e66c9f8c621eb710085b45a4274e2a2135de57d5 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Wed, 21 Apr 2021 23:36:53 -0400
Subject: Remove redundant mov

---
 yjit_codegen.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/yjit_codegen.c b/yjit_codegen.c
index ea4dfa9215..e835d3442d 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -804,9 +804,8 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L804
             test(cb, flags_opnd, imm_opnd(ROBJECT_EMBED));
             jit_chain_guard(JCC_JZ, jit, &starting_context, max_chain_depth, side_exit);
 
-            // Load the variable
+            // Store the ivar on the object
             x86opnd_t ivar_opnd = mem_opnd(64, REG0, offsetof(struct RObject, as.ary) + ivar_index * SIZEOF_VALUE);
-
             mov(cb, ivar_opnd, REG1);
 
             // Push the ivar on the stack
@@ -826,6 +825,7 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L825
             // check that the extended table is big enough
             if (ivar_index >= ROBJECT_EMBED_LEN_MAX + 1) {
                 // Check that the slot is inside the extended table (num_slots > index)
+                ADD_COMMENT(cb, "check index in extended table");
                 x86opnd_t num_slots = mem_opnd(32, REG0, offsetof(struct RObject, as.heap.numiv));
                 cmp(cb, num_slots, imm_opnd(ivar_index));
                 jle_ptr(cb, COUNTED_EXIT(side_exit, setivar_idx_out_of_range));
@@ -837,7 +837,6 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L837
 
             // Write the ivar to the extended table
             x86opnd_t ivar_opnd = mem_opnd(64, REG0, sizeof(VALUE) * ivar_index);
-            mov(cb, REG1, val_to_write);
             mov(cb, ivar_opnd, REG1);
         }
 
-- 
cgit v1.2.1


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

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