Skip to content

Commit ae72986

Browse files
maximecbXrXr
authored andcommitted
Remove redundant mov
1 parent ff873c9 commit ae72986

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

yjit_codegen.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,8 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
804804
test(cb, flags_opnd, imm_opnd(ROBJECT_EMBED));
805805
jit_chain_guard(JCC_JZ, jit, &starting_context, max_chain_depth, side_exit);
806806

807-
// Load the variable
807+
// Store the ivar on the object
808808
x86opnd_t ivar_opnd = mem_opnd(64, REG0, offsetof(struct RObject, as.ary) + ivar_index * SIZEOF_VALUE);
809-
810809
mov(cb, ivar_opnd, REG1);
811810

812811
// 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
826825
// check that the extended table is big enough
827826
if (ivar_index >= ROBJECT_EMBED_LEN_MAX + 1) {
828827
// Check that the slot is inside the extended table (num_slots > index)
828+
ADD_COMMENT(cb, "check index in extended table");
829829
x86opnd_t num_slots = mem_opnd(32, REG0, offsetof(struct RObject, as.heap.numiv));
830830
cmp(cb, num_slots, imm_opnd(ivar_index));
831831
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
837837

838838
// Write the ivar to the extended table
839839
x86opnd_t ivar_opnd = mem_opnd(64, REG0, sizeof(VALUE) * ivar_index);
840-
mov(cb, REG1, val_to_write);
841840
mov(cb, ivar_opnd, REG1);
842841
}
843842

0 commit comments

Comments
 (0)