Skip to content

Commit 925dec8

Browse files
committed
Rename rb_shape_set_shape_id in rb_obj_set_shape_id
1 parent ccf2b7c commit 925dec8

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ rb_gc_get_shape(VALUE obj)
373373
void
374374
rb_gc_set_shape(VALUE obj, uint32_t shape_id)
375375
{
376-
rb_shape_set_shape_id(obj, (uint32_t)shape_id);
376+
rb_obj_set_shape_id(obj, (uint32_t)shape_id);
377377
}
378378

379379
uint32_t

object.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj)
362362
}
363363

364364
rb_shape_copy_fields(dest, dest_buf, dest_shape_id, obj, src_buf, src_shape_id);
365-
rb_shape_set_shape_id(dest, dest_shape_id);
365+
rb_obj_set_shape_id(dest, dest_shape_id);
366366
}
367367

368368
static void
@@ -500,7 +500,7 @@ rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze)
500500
rb_evict_ivars_to_hash(clone);
501501
}
502502
else {
503-
rb_shape_set_shape_id(clone, next_shape_id);
503+
rb_obj_set_shape_id(clone, next_shape_id);
504504
}
505505
}
506506
break;
@@ -524,7 +524,7 @@ rb_obj_clone_setup(VALUE obj, VALUE clone, VALUE kwfreeze)
524524
rb_evict_ivars_to_hash(clone);
525525
}
526526
else {
527-
rb_shape_set_shape_id(clone, next_shape_id);
527+
rb_obj_set_shape_id(clone, next_shape_id);
528528
}
529529
break;
530530
}

shape.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ RBASIC_FIELDS_COUNT(VALUE obj)
230230

231231
shape_id_t rb_shape_traverse_from_new_root(shape_id_t initial_shape_id, shape_id_t orig_shape_id);
232232

233-
bool rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id);
233+
bool rb_obj_set_shape_id(VALUE obj, shape_id_t shape_id);
234234

235235
static inline bool
236236
rb_shape_obj_has_id(VALUE obj)

string.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,8 +959,7 @@ static VALUE
959959
setup_fake_str(struct RString *fake_str, const char *name, long len, int encidx)
960960
{
961961
fake_str->basic.flags = T_STRING|RSTRING_NOEMBED|STR_NOFREE|STR_FAKESTR;
962-
963-
rb_shape_set_shape_id((VALUE)fake_str, 0);
962+
RBASIC_SET_SHAPE_ID((VALUE)fake_str, ROOT_SHAPE_ID);
964963

965964
if (!name) {
966965
RUBY_ASSERT_ALWAYS(len == 0);

variable.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ rb_ivar_delete(VALUE obj, ID id, VALUE undef)
15541554
MEMCPY(ROBJECT_FIELDS(obj), fields, VALUE, new_fields_count);
15551555
xfree(fields);
15561556
}
1557-
rb_shape_set_shape_id(obj, next_shape_id);
1557+
rb_obj_set_shape_id(obj, next_shape_id);
15581558

15591559
if (locked) {
15601560
RB_VM_LOCK_LEAVE_LEV(&lev);
@@ -1617,13 +1617,13 @@ obj_transition_too_complex(VALUE obj, st_table *table)
16171617
if (!(RBASIC(obj)->flags & ROBJECT_EMBED)) {
16181618
old_fields = ROBJECT_FIELDS(obj);
16191619
}
1620-
rb_shape_set_shape_id(obj, shape_id);
1620+
rb_obj_set_shape_id(obj, shape_id);
16211621
ROBJECT_SET_FIELDS_HASH(obj, table);
16221622
break;
16231623
case T_CLASS:
16241624
case T_MODULE:
16251625
old_fields = RCLASS_PRIME_FIELDS(obj);
1626-
rb_shape_set_shape_id(obj, shape_id);
1626+
rb_obj_set_shape_id(obj, shape_id);
16271627
RCLASS_SET_FIELDS_HASH(obj, table);
16281628
break;
16291629
default:
@@ -1638,7 +1638,7 @@ obj_transition_too_complex(VALUE obj, st_table *table)
16381638
* and hold the table because the xmalloc could trigger a GC
16391639
* compaction. We want the table to be updated rather than
16401640
* the original fields. */
1641-
rb_shape_set_shape_id(obj, shape_id);
1641+
rb_obj_set_shape_id(obj, shape_id);
16421642
old_fields_tbl->as.complex.table = table;
16431643
old_fields = (VALUE *)old_fields_tbl;
16441644
}
@@ -1647,7 +1647,7 @@ obj_transition_too_complex(VALUE obj, st_table *table)
16471647
fields_tbl->as.complex.table = table;
16481648
st_insert(gen_ivs, (st_data_t)obj, (st_data_t)fields_tbl);
16491649

1650-
rb_shape_set_shape_id(obj, shape_id);
1650+
rb_obj_set_shape_id(obj, shape_id);
16511651
}
16521652
}
16531653

@@ -1831,7 +1831,7 @@ generic_fields_lookup_ensure_size(st_data_t *k, st_data_t *v, st_data_t u, int e
18311831

18321832
fields_lookup->fields_tbl = fields_tbl;
18331833
if (fields_lookup->shape_id) {
1834-
rb_shape_set_shape_id(fields_lookup->obj, fields_lookup->shape_id);
1834+
rb_obj_set_shape_id(fields_lookup->obj, fields_lookup->shape_id);
18351835
}
18361836

18371837
return ST_CONTINUE;
@@ -1986,7 +1986,7 @@ obj_ivar_set_shape_resize_fields(VALUE obj, attr_index_t old_capa, attr_index_t
19861986
static void
19871987
obj_ivar_set_set_shape_id(VALUE obj, shape_id_t shape_id, void *_data)
19881988
{
1989-
rb_shape_set_shape_id(obj, shape_id);
1989+
rb_obj_set_shape_id(obj, shape_id);
19901990
}
19911991

19921992
static void
@@ -2038,7 +2038,7 @@ rb_vm_set_ivar_id(VALUE obj, ID id, VALUE val)
20382038
}
20392039

20402040
bool
2041-
rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id)
2041+
rb_obj_set_shape_id(VALUE obj, shape_id_t shape_id)
20422042
{
20432043
if (rb_obj_shape_id(obj) == shape_id) {
20442044
return false;
@@ -2063,7 +2063,7 @@ void rb_obj_freeze_inline(VALUE x)
20632063
if (rb_shape_too_complex_p(next_shape_id) && !rb_shape_obj_too_complex_p(x)) {
20642064
rb_evict_fields_to_hash(x);
20652065
}
2066-
rb_shape_set_shape_id(x, next_shape_id);
2066+
rb_obj_set_shape_id(x, next_shape_id);
20672067

20682068
if (RBASIC_CLASS(x)) {
20692069
rb_freeze_singleton_class(x);
@@ -2354,7 +2354,7 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
23542354
}
23552355

23562356
if (!RSHAPE(dest_shape_id)->capacity) {
2357-
rb_shape_set_shape_id(dest, dest_shape_id);
2357+
rb_obj_set_shape_id(dest, dest_shape_id);
23582358
FL_UNSET(dest, FL_EXIVAR);
23592359
return;
23602360
}
@@ -2375,7 +2375,7 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
23752375
st_insert(generic_fields_tbl_no_ractor_check(obj), (st_data_t)dest, (st_data_t)new_fields_tbl);
23762376
}
23772377

2378-
rb_shape_set_shape_id(dest, dest_shape_id);
2378+
rb_obj_set_shape_id(dest, dest_shape_id);
23792379
}
23802380
return;
23812381

@@ -4671,7 +4671,7 @@ class_ivar_set_shape_resize_fields(VALUE obj, attr_index_t _old_capa, attr_index
46714671
static void
46724672
class_ivar_set_set_shape_id(VALUE obj, shape_id_t shape_id, void *_data)
46734673
{
4674-
rb_shape_set_shape_id(obj, shape_id);
4674+
rb_obj_set_shape_id(obj, shape_id);
46754675
}
46764676

46774677
static void

0 commit comments

Comments
 (0)