diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2022-06-06 10:48:42 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2022-07-18 12:44:01 -0700 |
commit | ecff3349953e17491630ef7b68c5ac6b095d39bf (patch) | |
tree | 084ea5e0c33bd4597d09ae9e45cae791513c8049 /vm_callinfo.h | |
parent | f240e28dfe373bee30a170fd78d11cc5d71ef945 (diff) | |
download | ruby-ecff3349953e17491630ef7b68c5ac6b095d39bf.tar.gz |
Extract vm_ic_entry API to mimic vm_cc behavior
Diffstat (limited to 'vm_callinfo.h')
-rw-r--r-- | vm_callinfo.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vm_callinfo.h b/vm_callinfo.h index f17035b27f..fd2215be7d 100644 --- a/vm_callinfo.h +++ b/vm_callinfo.h @@ -9,6 +9,7 @@ */ #include "debug_counter.h" +#include "internal/class.h" enum vm_call_flag_bits { VM_CALL_ARGS_SPLAT_bit, /* m(*args) */ @@ -363,6 +364,18 @@ vm_cc_attr_index_p(const struct rb_callcache *cc) return cc->aux_.attr_index > 0; } +static inline uint32_t +vm_ic_entry_index(const struct iseq_inline_iv_cache_entry *ic) +{ + return ic->entry->index; +} + +static inline bool +vm_ic_entry_p(const struct iseq_inline_iv_cache_entry *ic) +{ + return ic->entry; +} + static inline unsigned int vm_cc_cmethod_missing_reason(const struct rb_callcache *cc) { @@ -417,6 +430,13 @@ vm_cc_attr_index_set(const struct rb_callcache *cc, int index) } static inline void +vm_ic_entry_set(struct iseq_inline_iv_cache_entry *ic, struct rb_iv_index_tbl_entry *entry, const rb_iseq_t *iseq) +{ + ic->entry = entry; + RB_OBJ_WRITTEN(iseq, Qundef, entry->class_value); +} + +static inline void vm_cc_attr_index_initialize(const struct rb_callcache *cc) { VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); |