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

ruby-changes:69264

From: Aaron <ko1@a...>
Date: Thu, 21 Oct 2021 08:24:24 +0900 (JST)
Subject: [ruby-changes:69264] bf8557f487 (master): Add comments for new function

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

From bf8557f48719434261f9cf4051582868dca95363 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Fri, 10 Sep 2021 15:01:19 -0700
Subject: Add comments for new function

---
 vm_insnhelper.c | 8 ++++++--
 1 file 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 https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1371
     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) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1389
     }
     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
-- 
cgit v1.2.1


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

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