summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-09-10 15:01:19 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:40 -0400
commitbf8557f48719434261f9cf4051582868dca95363 (patch)
tree39529c78baea4909438cb3781dc16d4021b287fa
parent25f8431d46c0b394c6003356cf5f0c78a1cbd122 (diff)
Add comments for new function
-rw-r--r--vm_insnhelper.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 772850a728..0b15794210 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1371,6 +1371,10 @@ rb_vm_setinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, VALUE val, IV
vm_setinstancevariable(iseq, obj, id, val, ic);
}
+/* Set the instance variable +val+ on object +obj+ at the +index+.
+ * This function only works with T_OBJECT objects, so make sure
+ * +obj+ is of type T_OBJECT before using this function.
+ */
VALUE
rb_vm_set_ivar_idx(VALUE obj, uint32_t index, VALUE val)
{
@@ -1385,8 +1389,8 @@ rb_vm_set_ivar_idx(VALUE obj, uint32_t index, VALUE val)
}
VALUE *ptr = ROBJECT_IVPTR(obj);
RB_OBJ_WRITE(obj, &ptr[index], val);
- RB_DEBUG_COUNTER_INC(ivar_set_ic_hit);
- return val; /* inline cache hit */
+
+ return val;
}
static VALUE