From ecff3349953e17491630ef7b68c5ac6b095d39bf Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Mon, 6 Jun 2022 10:48:42 -0400 Subject: Extract vm_ic_entry API to mimic vm_cc behavior --- vm_callinfo.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'vm_callinfo.h') 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) { @@ -416,6 +429,13 @@ vm_cc_attr_index_set(const struct rb_callcache *cc, int index) *(int *)&cc->aux_.attr_index = index + 1; } +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) { -- cgit v1.2.1