diff options
author | Jean Boussier <[email protected]> | 2025-05-28 12:28:42 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-05-28 12:29:25 +0200 |
commit | 658fcbe91a7c74ba33aee96c8a6c10f13ff3e6d9 (patch) | |
tree | c0bc60cb99fe3985812b075284f01f5c65d3e33b | |
parent | a0e9af0146ab04e6d9eb8f5435ecdf383144af60 (diff) |
Get rid of `vm_cc_attr_index` and `vm_cc_attr_index_dest_shape_id`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13455
-rw-r--r-- | vm_callinfo.h | 15 | ||||
-rw-r--r-- | vm_insnhelper.c | 5 |
2 files changed, 3 insertions, 17 deletions
diff --git a/vm_callinfo.h b/vm_callinfo.h index 975b78ae8c..d2160a9ff9 100644 --- a/vm_callinfo.h +++ b/vm_callinfo.h @@ -415,21 +415,6 @@ vm_cc_call(const struct rb_callcache *cc) return cc->call_; } -static inline attr_index_t -vm_cc_attr_index(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - return (attr_index_t)((cc->aux_.attr.value & SHAPE_FLAG_MASK) - 1); -} - -static inline shape_id_t -vm_cc_attr_index_dest_shape_id(const struct rb_callcache *cc) -{ - VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); - - return cc->aux_.attr.value >> SHAPE_FLAG_SHIFT; -} - static inline void vm_cc_atomic_shape_and_index(const struct rb_callcache *cc, shape_id_t * shape_id, attr_index_t * index) { diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 45fcb8c10e..cf7e554dd9 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3944,8 +3944,9 @@ vm_call_attrset_direct(rb_execution_context_t *ec, rb_control_frame_t *cfp, cons RB_DEBUG_COUNTER_INC(ccf_attrset); VALUE val = *(cfp->sp - 1); cfp->sp -= 2; - attr_index_t index = vm_cc_attr_index(cc); - shape_id_t dest_shape_id = vm_cc_attr_index_dest_shape_id(cc); + attr_index_t index; + shape_id_t dest_shape_id; + vm_cc_atomic_shape_and_index(cc, &dest_shape_id, &index); ID id = vm_cc_cme(cc)->def->body.attr.id; rb_check_frozen(obj); VALUE res = vm_setivar(obj, id, val, dest_shape_id, index); |