@@ -804,9 +804,8 @@ gen_set_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
804
804
test (cb , flags_opnd , imm_opnd (ROBJECT_EMBED ));
805
805
jit_chain_guard (JCC_JZ , jit , & starting_context , max_chain_depth , side_exit );
806
806
807
- // Load the variable
807
+ // Store the ivar on the object
808
808
x86opnd_t ivar_opnd = mem_opnd (64 , REG0 , offsetof(struct RObject , as .ary ) + ivar_index * SIZEOF_VALUE );
809
-
810
809
mov (cb , ivar_opnd , REG1 );
811
810
812
811
// 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
826
825
// check that the extended table is big enough
827
826
if (ivar_index >= ROBJECT_EMBED_LEN_MAX + 1 ) {
828
827
// Check that the slot is inside the extended table (num_slots > index)
828
+ ADD_COMMENT (cb , "check index in extended table" );
829
829
x86opnd_t num_slots = mem_opnd (32 , REG0 , offsetof(struct RObject , as .heap .numiv ));
830
830
cmp (cb , num_slots , imm_opnd (ivar_index ));
831
831
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
837
837
838
838
// Write the ivar to the extended table
839
839
x86opnd_t ivar_opnd = mem_opnd (64 , REG0 , sizeof (VALUE ) * ivar_index );
840
- mov (cb , REG1 , val_to_write );
841
840
mov (cb , ivar_opnd , REG1 );
842
841
}
843
842
0 commit comments