diff options
author | Jemma Issroff <[email protected]> | 2022-07-18 15:38:12 -0400 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2022-07-18 14:06:30 -0700 |
commit | 85ea46730deff70172a9f50172f0011a7401f371 (patch) | |
tree | 7381061939a093300fe1d49fdb7b6bcd222ce904 /iseq.c | |
parent | 3ac9956dee1e4fbc413309d59a428e62de5cfed2 (diff) |
Separate TS_IVC and TS_ICVARC in is_entries buffers
This allows us to treat cvar caches differently than ivar caches.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6148
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -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; |