diff options
author | Koichi Sasada <[email protected]> | 2023-07-31 12:26:27 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2023-07-31 14:04:31 +0900 |
commit | 36023d5cb751d62fca0c27901c07527b20170f4d () | |
tree | e042a12b89f942eb5b4424d04c80a1795fa79a7f /vm_callinfo.h | |
parent | 60ac719acc3e4eccab770ebdd959dffcb702f2f2 (diff) |
mark `cc->cme_` if it is for `super`
`vm_search_super_method()` makes orphan CCs (they are not connected from ccs) and `cc->cme_` can be collected before without marking.
Notes: Merged: https://.com/ruby/ruby/pull/8145
-rw-r--r-- | vm_callinfo.h | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -296,6 +296,15 @@ struct rb_callcache { #define VM_CALLCACHE_UNMARKABLE FL_FREEZE #define VM_CALLCACHE_ON_STACK FL_EXIVAR extern const struct rb_callcache *rb_vm_empty_cc(void); extern const struct rb_callcache *rb_vm_empty_cc_for_super(void); @@ -312,14 +321,30 @@ vm_cc_attr_index_initialize(const struct rb_callcache *cc, shape_id_t shape_id) static inline const struct rb_callcache * vm_cc_new(VALUE klass, const struct rb_callable_method_entry_struct *cme, - vm_call_handler call) { const struct rb_callcache *cc = (const struct rb_callcache *)rb_imemo_new(imemo_callcache, (VALUE)cme, (VALUE)call, 0, klass); vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID); RB_DEBUG_COUNTER_INC(cc_new); return cc; } #define VM_CC_ON_STACK(clazz, call, aux, cme) \ (struct rb_callcache) { \ .flags = T_IMEMO | \ @@ -439,9 +464,6 @@ vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *c /* callcache: mutate */ -#define VM_CALLCACHE_IVAR IMEMO_FL_USER0 -#define VM_CALLCACHE_BF IMEMO_FL_USER1 - static inline void vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call) { |