summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2022-07-18 15:38:12 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2022-07-18 14:06:30 -0700
commit85ea46730deff70172a9f50172f0011a7401f371 (patch)
tree7381061939a093300fe1d49fdb7b6bcd222ce904 /iseq.c
parent3ac9956dee1e4fbc413309d59a428e62de5cfed2 (diff)
downloadruby-85ea46730deff70172a9f50172f0011a7401f371.tar.gz
Separate TS_IVC and TS_ICVARC in is_entries buffers
This allows us to treat cvar caches differently than ivar caches.
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/iseq.c b/iseq.c
index 20ca93b596..0369830bdd 100644
--- a/iseq.c
+++ b/iseq.c
@@ -274,13 +274,11 @@ rb_iseq_each_value(const rb_iseq_t *iseq, iseq_value_itr_t * func, void *data)
union iseq_inline_storage_entry *is_entries = body->is_entries;
if (body->is_entries) {
- // IVC and ICVARC entries
+ // IVC entries
for (unsigned int i = 0; i < body->ivc_size; i++, is_entries++) {
IVC ivc = (IVC)is_entries;
if (ivc->entry) {
- if (RB_TYPE_P(ivc->entry->class_value, T_NONE)) {
- rb_bug("!! %u", ivc->entry->index);
- }
+ RUBY_ASSERT(!RB_TYPE_P(ivc->entry->class_value, T_NONE));
VALUE nv = func(data, ivc->entry->class_value);
if (ivc->entry->class_value != nv) {
@@ -289,6 +287,19 @@ rb_iseq_each_value(const rb_iseq_t *iseq, iseq_value_itr_t * func, void *data)
}
}
+ // ICVARC entries
+ for (unsigned int i = 0; i < body->icvarc_size; i++, is_entries++) {
+ ICVARC icvarc = (ICVARC)is_entries;
+ if (icvarc->entry) {
+ RUBY_ASSERT(!RB_TYPE_P(icvarc->entry->class_value, T_NONE));
+
+ VALUE nv = func(data, icvarc->entry->class_value);
+ if (icvarc->entry->class_value != nv) {
+ icvarc->entry->class_value = nv;
+ }
+ }
+ }
+
// ISE entries
for (unsigned int i = 0; i < body->ise_size; i++, is_entries++) {
union iseq_inline_storage_entry *const is = (union iseq_inline_storage_entry *)is_entries;