summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-04-30 09:42:57 +0200
committerJean Boussier <[email protected]>2025-05-08 07:58:05 +0200
commit0ea210d1ea257162642969edce665935cc87c643 ()
tree501f2563c5f81e19c408e32cda63b823a5785df9 /vm_insnhelper.c
parent4e30b77b90e463997de265af1e7a5819b4c46fcc (diff)
Rename `ivptr` -> `fields`, `next_iv_index` -> `next_field_index`
Ivars will longer be the only thing stored inline via shapes, so keeping the `iv_index` and `ivptr` names would be confusing. Instance variables won't be the only thing stored inline via shapes, so keeping the `ivptr` name would be confusing. `field` encompass anything that can be stored in a VALUE array. Similarly, `gen_ivtbl` becomes `gen_fields_tbl`.
Notes: Merged: https://.com/ruby/ruby/pull/13159
-rw-r--r--vm_insnhelper.c32
1 files changed, 16 insertions, 16 deletions
@@ -1230,7 +1230,7 @@ vm_getivar(VALUE obj, ID id, const rb_iseq_t *iseq, IVC ic, const struct rb_call
switch (BUILTIN_TYPE(obj)) {
case T_OBJECT:
- ivar_list = ROBJECT_IVPTR(obj);
VM_ASSERT(rb_ractor_shareable_p(obj) ? rb_ractor_shareable_p(val) : true);
#if !SHAPE_IN_BASIC_FLAGS
@@ -1256,7 +1256,7 @@ vm_getivar(VALUE obj, ID id, const rb_iseq_t *iseq, IVC ic, const struct rb_call
}
}
- ivar_list = RCLASS_IVPTR(obj);
#if !SHAPE_IN_BASIC_FLAGS
shape_id = RCLASS_SHAPE_ID(obj);
@@ -1266,12 +1266,12 @@ vm_getivar(VALUE obj, ID id, const rb_iseq_t *iseq, IVC ic, const struct rb_call
}
default:
if (FL_TEST_RAW(obj, FL_EXIVAR)) {
- struct gen_ivtbl *ivtbl;
- rb_gen_ivtbl_get(obj, id, &ivtbl);
#if !SHAPE_IN_BASIC_FLAGS
- shape_id = ivtbl->shape_id;
#endif
- ivar_list = ivtbl->as.shape.ivptr;
}
else {
return default_value;
@@ -1335,17 +1335,17 @@ vm_getivar(VALUE obj, ID id, const rb_iseq_t *iseq, IVC ic, const struct rb_call
switch (BUILTIN_TYPE(obj)) {
case T_CLASS:
case T_MODULE:
- table = (st_table *)RCLASS_IVPTR(obj);
break;
case T_OBJECT:
- table = ROBJECT_IV_HASH(obj);
break;
default: {
- struct gen_ivtbl *ivtbl;
- if (rb_gen_ivtbl_get(obj, 0, &ivtbl)) {
- table = ivtbl->as.complex.table;
}
break;
}
@@ -1469,7 +1469,7 @@ vm_setivar_default(VALUE obj, ID id, VALUE val, shape_id_t dest_shape_id, attr_i
shape_id_t shape_id = rb_generic_shape_id(obj);
#endif
- struct gen_ivtbl *ivtbl = 0;
// Cache hit case
if (shape_id == dest_shape_id) {
@@ -1490,17 +1490,17 @@ vm_setivar_default(VALUE obj, ID id, VALUE val, shape_id_t dest_shape_id, attr_i
return Qundef;
}
- rb_gen_ivtbl_get(obj, 0, &ivtbl);
if (shape_id != dest_shape_id) {
#if SHAPE_IN_BASIC_FLAGS
RBASIC_SET_SHAPE_ID(obj, dest_shape_id);
#else
- ivtbl->shape_id = dest_shape_id;
#endif
}
- RB_OBJ_WRITE(obj, &ivtbl->as.shape.ivptr[index], val);
RB_DEBUG_COUNTER_INC(ivar_set_ic_hit);
@@ -1544,7 +1544,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, shape_id_t dest_shape_id, attr_index_t i
break;
}
- VALUE *ptr = ROBJECT_IVPTR(obj);
RUBY_ASSERT(!rb_shape_obj_too_complex(obj));
RB_OBJ_WRITE(obj, &ptr[index], val);