Skip to content

Commit a79ed42

Browse files
author
Maxime Chevalier-Boisvert
committed
Remove redundant mov
1 parent 61723b7 commit a79ed42

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

yjit_codegen.c

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

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

811810
// Push the ivar on the stack
@@ -825,6 +824,7 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
825824
// check that the extended table is big enough
826825
if (ivar_index >= ROBJECT_EMBED_LEN_MAX + 1) {
827826
// Check that the slot is inside the extended table (num_slots > index)
827+
ADD_COMMENT(cb, "check index in extended table");
828828
x86opnd_t num_slots = mem_opnd(32, REG0, offsetof(struct RObject, as.heap.numiv));
829829
cmp(cb, num_slots, imm_opnd(ivar_index));
830830
jle_ptr(cb, COUNTED_EXIT(side_exit, setivar_idx_out_of_range));
@@ -836,7 +836,6 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
836836

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

0 commit comments

Comments
 (0)